X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fbbb_pin_defines.h;h=05eb5a9b93e9ea5f9604d2a4c145845b703bcee1;hb=dcd713d443d683f0440e65cf69d88f2bcaf89c42;hp=661f9693c29d597bf126c1f9f944fdfcca3cd241;hpb=334c0f768757075c94f4080f3275fc6cd006e6f7;p=matches%2FMCTX3420.git diff --git a/server/bbb_pin_defines.h b/server/bbb_pin_defines.h index 661f969..05eb5a9 100644 --- a/server/bbb_pin_defines.h +++ b/server/bbb_pin_defines.h @@ -114,6 +114,13 @@ /** Number of useable GPIO pins **/ #define GPIO_NUM_PINS 50 +/* 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" @@ -131,23 +138,29 @@ /** Number of ADC pins **/ #define ADC_NUM_PINS 8 -/** Path to export ADCs with**/ -#define ADC_EXPORT_PATH "/sys/devices/bone_capemgr.9/slots" -/** Path at which ADCs appear **/ -#define ADC_DEVICE_PATH "/sys/devices/ocp.3/helper.16" +#define ADC_DEVICE_PATH "/sys/bus/iio/devices/iio:device0/" -/** PWM defines **/ -#define EHRPWM0A 0 -#define EHRPWM0B 1 -// No other PWM pins work! +/** PWM names to sysfs numbers **/ +#define EHRPWM0A 0 //P9_22 +#define EHRPWM0B 1 //P9_21 - period paired with EHRPWM0A +#define EHRPWM1A 3 //P9_14 +#define EHRPWM1B 4 //P9_16 - period paired with EHRPWM1A +#define ECAP0 2 //P9_42 +#define ECAP2 7 //P9_28 +#define EHRPWM2A 5 //P8_19 +#define EHRPWM2B 6 //P8_13 - period paired with EHRPWM2A /** Number of PWM pins **/ -#define PWM_NUM_PINS 2 +#define PWM_NUM_PINS 8 + +/** Number of PWM pins which are guaranteed not to interfere with one another **/ +#define PWM_NUM_SAFE_PINS 5 /** Path to PWM sysfs **/ #define PWM_DEVICE_PATH "/sys/class/pwm" - +/** Maps internal pin number to safe 'pwmX' number **/ +extern const unsigned char g_pin_safe_pwm[PWM_NUM_SAFE_PINS]; #endif //_BBB_PIN_DEFINES_H