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];
139 #define ADC_VOLTAGE_MAX 1800
140 #define ADC_RAW_MAX (2 << ADC_BITS)
141 #define ADC_TO_MVOLTS(x) ((double)((x)/2 << ADC_BITS) * (double)ADC_VOLTAGE_MAX)
143 /** Number of ADC pins **/
144 #define ADC_NUM_PINS 8
146 #define ADC_DEVICE_PATH "/sys/bus/iio/devices/iio:device0/"
148 /** PWM names to sysfs numbers **/
149 #define EHRPWM0A 0 //P9_22
150 #define EHRPWM0B 1 //P9_21 - period paired with EHRPWM0A
151 #define EHRPWM1A 3 //P9_14
152 #define EHRPWM1B 4 //P9_16 - period paired with EHRPWM1A
153 #define ECAP0 2 //P9_42
154 #define ECAP2 7 //P9_28
155 #define EHRPWM2A 5 //P8_19
156 #define EHRPWM2B 6 //P8_13 - period paired with EHRPWM2A
158 /** Number of PWM pins **/
159 #define PWM_NUM_PINS 8
161 /** Path to PWM sysfs **/
162 #define PWM_DEVICE_PATH "/sys/class/pwm"
164 #endif //_BBB_PIN_DEFINES_H