Create PIRFunctions.c

all explained at simplearmprojects.blogspot.com