X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fbbb_pin_defines.h;h=868636b9cbd01fec636363d3f58eb2070d2adffa;hb=29cdd749c2c6c87a23287a398035a103086aa224;hp=05eb5a9b93e9ea5f9604d2a4c145845b703bcee1;hpb=ead840a6e5b98790edb419bde8a02e476b443dc4;p=matches%2FMCTX3420.git diff --git a/server/bbb_pin_defines.h b/server/bbb_pin_defines.h index 05eb5a9..868636b 100644 --- a/server/bbb_pin_defines.h +++ b/server/bbb_pin_defines.h @@ -6,6 +6,9 @@ #ifndef _BBB_PIN_DEFINES_H #define _BBB_PIN_DEFINES_H +/** The number of expansion pins on the BBB **/ +#define BBB_PIN_COUNT 92 + /** GPIO0 defines **/ #define GPIO0_1 1 @@ -111,18 +114,18 @@ #define GPIO2_31 95 #define GPIO2_32 96 +/** Export path **/ +#define GPIO_DEVICE_PATH "/sys/class/gpio" + /** Number of useable GPIO pins **/ -#define GPIO_NUM_PINS 50 +#define GPIO_NUM_PINS 43 +/** The max usable GPIO number **/ +#define GPIO_MAX_NUMBER 115 /* Luts */ -#define GPIO_LUT_SIZE 93 -#define GPIO_INDEX_SIZE 128 -extern const unsigned char g_pin_to_gpio[GPIO_LUT_SIZE]; -extern const unsigned char g_gpio_to_index[GPIO_INDEX_SIZE]; -extern const unsigned char g_index_to_gpio[GPIO_NUM_PINS]; - -/** Export path **/ -#define GPIO_DEVICE_PATH "/sys/class/gpio" +extern const unsigned char g_pin_real_to_gpio[BBB_PIN_COUNT+1]; +extern const unsigned char g_pin_gpio_to_index[GPIO_MAX_NUMBER+1]; +extern const unsigned char g_pin_index_to_gpio[GPIO_NUM_PINS]; #define ADC_BITS 12 #define ADC_DIGITS 5