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_real_to_gpio[BBB_PIN_COUNT+1];
127 extern const unsigned char g_pin_gpio_to_index[GPIO_MAX_NUMBER+1];
128 extern const unsigned char g_pin_index_to_gpio[GPIO_NUM_PINS];
141 /** Number of ADC pins **/
142 #define ADC_NUM_PINS 8
144 #define ADC_DEVICE_PATH "/sys/bus/iio/devices/iio:device0/"
146 /** PWM names to sysfs numbers **/
147 #define EHRPWM0A 0 //P9_22
148 #define EHRPWM0B 1 //P9_21 - period paired with EHRPWM0A
149 #define EHRPWM1A 3 //P9_14
150 #define EHRPWM1B 4 //P9_16 - period paired with EHRPWM1A
151 #define ECAP0 2 //P9_42
152 #define ECAP2 7 //P9_28
153 #define EHRPWM2A 5 //P8_19
154 #define EHRPWM2B 6 //P8_13 - period paired with EHRPWM2A
156 /** Number of PWM pins **/
157 #define PWM_NUM_PINS 8
159 /** Number of PWM pins which are guaranteed not to interfere with one another **/
160 #define PWM_NUM_SAFE_PINS 5
162 /** Path to PWM sysfs **/
163 #define PWM_DEVICE_PATH "/sys/class/pwm"
165 /** Maps internal pin number to safe 'pwmX' number **/
166 extern const unsigned char g_pin_safe_pwm[PWM_NUM_SAFE_PINS];
168 #endif //_BBB_PIN_DEFINES_H