3 * @brief Definition of functions for controlling pins on the Beaglebone Black
11 #include "bbb_pin_defines.h"
13 #if defined(_BBB) || defined(_BBB_PIN_SRC)
14 // Initialise / Deinitialise functions
15 extern void GPIO_Export(int pin);
16 extern void GPIO_Unexport(int pin);
18 extern void PWM_Export(int pin);
19 extern void PWM_Unexport(int pin);
21 extern void ADC_Export(int pin);
22 extern void ADC_Unexport(int pin);
24 // Pin reading/setting functions
25 extern bool GPIO_Read(int pin);
26 extern void GPIO_Set(int pin, bool value);
28 extern int ADC_Read(int pin);
30 extern void PWM_Set(int pin, bool polarity, long period, long duty); // period and duty are in ns
31 extern void PWM_Stop(int pin);
33 //Empty defines so it compiles on any platform that's not the BBB
34 #define GPIO_Export(pin)
35 #define GPIO_Unexport(pin)
37 #define PWM_Export(pin)
38 #define PWM_Unexport(pin)
40 #define ADC_Export(pin)
41 #define ADC_Unexport(pin)
43 #define GPIO_Read(pin) 0
44 #define GPIO_Set(pin, value)
46 #define ADC_Read(pin) 0
48 #define PWM_Set(pin, polarity, period, duty)