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
12 #define GPIO0_2 2 // Used for PWM
13 #define GPIO0_3 3 // Used for PWM
114 /** Number of useable GPIO pins **/
115 #define GPIO_NUM_PINS 50
118 #define GPIO_LUT_SIZE 93
119 #define GPIO_INDEX_SIZE 128
120 extern const unsigned char g_pin_to_gpio[GPIO_LUT_SIZE];
121 extern const unsigned char g_gpio_to_index[GPIO_INDEX_SIZE];
122 extern const unsigned char g_index_to_gpio[GPIO_NUM_PINS];
125 #define GPIO_DEVICE_PATH "/sys/class/gpio"
138 /** Number of ADC pins **/
139 #define ADC_NUM_PINS 8
141 #define ADC_DEVICE_PATH "/sys/bus/iio/devices/iio:device0/"
143 /** PWM names to sysfs numbers **/
144 #define EHRPWM0A 0 //P9_22
145 #define EHRPWM0B 1 //P9_21 - period paired with EHRPWM0A
146 #define EHRPWM1A 3 //P9_14
147 #define EHRPWM1B 4 //P9_16 - period paired with EHRPWM1A
148 #define ECAP0 2 //P9_42
149 #define ECAP2 7 //P9_28
150 #define EHRPWM2A 5 //P8_19
151 #define EHRPWM2B 6 //P8_13 - period paired with EHRPWM2A
153 /** Number of PWM pins **/
154 #define PWM_NUM_PINS 8
156 /** Number of PWM pins which are guaranteed not to interfere with one another **/
157 #define PWM_NUM_SAFE_PINS 5
159 /** Path to PWM sysfs **/
160 #define PWM_DEVICE_PATH "/sys/class/pwm"
162 /** Maps internal pin number to safe 'pwmX' number **/
163 extern const unsigned char g_pin_safe_pwm[PWM_NUM_SAFE_PINS];
165 #endif //_BBB_PIN_DEFINES_H