2 * @file bbb_pin_defines.h
3 * @brief Defines pins on Beaglebone Black
6 #ifndef _BBB_PIN_DEFINES_H
7 #define _BBB_PIN_DEFINES_H
9 /** The number of expansion pins on the BBB **/
10 #define BBB_PIN_COUNT 92
15 #define GPIO0_2 2 // Used for PWM
16 #define GPIO0_3 3 // Used for PWM
118 #define GPIO_DEVICE_PATH "/sys/class/gpio"
120 /** Number of useable GPIO pins **/
121 #define GPIO_NUM_PINS 43
122 /** The max usable GPIO number **/
123 #define GPIO_MAX_NUMBER 115
126 extern const unsigned char g_pin_gpio_to_index[GPIO_MAX_NUMBER+1];
127 extern const unsigned char g_pin_index_to_gpio[GPIO_NUM_PINS];
140 /** Number of ADC pins **/
141 #define ADC_NUM_PINS 8
143 #define ADC_DEVICE_PATH "/sys/bus/iio/devices/iio:device0/"
145 /** PWM names to sysfs numbers **/
146 #define EHRPWM0A 0 //P9_22
147 #define EHRPWM0B 1 //P9_21 - period paired with EHRPWM0A
148 #define EHRPWM1A 3 //P9_14
149 #define EHRPWM1B 4 //P9_16 - period paired with EHRPWM1A
150 #define ECAP0 2 //P9_42
151 #define ECAP2 7 //P9_28
152 #define EHRPWM2A 5 //P8_19
153 #define EHRPWM2B 6 //P8_13 - period paired with EHRPWM2A
155 /** Number of PWM pins **/
156 #define PWM_NUM_PINS 8
158 /** Path to PWM sysfs **/
159 #define PWM_DEVICE_PATH "/sys/class/pwm"
161 #endif //_BBB_PIN_DEFINES_H