1 #include "bbb_pin_defines.h"
4 * A lookup table from header number to GPIO pin number.
5 * e.g P8_13 is g_gpio_lut[0*46+13] = g_gpio_lut[13]
6 * e.g P9_13 is g_gpio_lut[1*46+13] = g_gpio_lut[59]
8 * Where the returned value is 0, there is no GPIO pin
11 const unsigned char g_pin_to_gpio[GPIO_LUT_SIZE] = {
12 0, 0, 0, 0, 0, 0, 0, 66, 67, 69, 68, 45, 44, 23,
13 26, 47, 46, 27, 65, 22, 0, 0, 0, 0, 0, 0, 61, 86,
14 88, 87, 89, 10, 11, 9, 81, 8, 80, 78, 79, 76, 77, 74,
15 75, 72, 73, 70, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16 0, 30, 60, 31, 50, 48, 51, 5, 4, 0, 0, 3, 2, 49,
17 15, 117, 14, 115, 0, 0, 112, 0, 0, 0, 0, 0, 0, 0,
18 0, 0, 0, 0, 0, 0, 0, 0, 0
22 * Converts GPIO number to index for g_gpio, or 128 if no map.
24 const unsigned char g_gpio_to_index[GPIO_INDEX_SIZE] = {
25 128, 128, 0, 1, 2, 3, 128, 128, 4, 5, 6, 7, 128, 128,
26 8, 9, 128, 128, 128, 128, 128, 128, 10, 11, 128, 128, 12, 13,
27 128, 128, 14, 15, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
28 128, 128, 16, 17, 18, 19, 20, 21, 22, 23, 128, 128, 128, 128,
29 128, 128, 128, 128, 24, 25, 128, 128, 128, 26, 27, 28, 29, 30,
30 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 128, 128,
31 128, 128, 43, 44, 45, 46, 128, 128, 128, 128, 128, 128, 128, 128,
32 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
33 47, 128, 128, 48, 128, 49, 128, 128, 128, 128, 128, 128, 128, 128,
38 * Converts index number of g_gpio into the gpio number
40 const unsigned char g_index_to_gpio[GPIO_NUM_PINS] = {
41 2, 3, 4, 5, 8, 9, 10, 11, 14, 15, 22, 23, 26, 27,
42 30, 31, 44, 45, 46, 47, 48, 49, 50, 51, 60, 61, 65, 66,
43 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
44 81, 86, 87, 88, 89, 112, 115, 117
48 * Converts PWM index to PWM number
49 * e.g index 3 becomes 6 for /sys/class/pwm/pwm6
51 const unsigned char g_pin_safe_pwm[PWM_NUM_SAFE_PINS] = {