38 #ifndef CASCODA_CHILI_GPIO_H
39 #define CASCODA_CHILI_GPIO_H
45 #define GPIO_BASE GPIOA_BASE
48 #define MGPIO_PORT(portnum) ((GPIO_T *)(GPIO_BASE + (portnum * 0x40UL)))
50 #define MGPIO_PORTPIN(portnum, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE + (0x40 * (portnum))) + ((pin) << 2))))
52 #define BITMASK(x) (1UL << x)
84 #define ZIG_RESET_PORT PA
85 #define ZIG_RESET_PNUM PN_A
86 #define ZIG_RESET_PIN 11
87 #define ZIG_RESET_PVAL PA11
89 #define ZIG_IRQB_PORT PA
90 #define ZIG_IRQB_PNUM PN_A
91 #define ZIG_IRQB_PIN 10
92 #define ZIG_IRQB_PVAL PA10
93 #define ZIG_IRQB_IRQn GPABC_IRQn
95 #define SPI_MOSI_PORT PB
96 #define SPI_MOSI_PNUM PN_B
97 #define SPI_MOSI_PIN 0
98 #define SPI_MOSI_PVAL PB0
100 #define SPI_MISO_PORT PB
101 #define SPI_MISO_PNUM PN_B
102 #define SPI_MISO_PIN 1
103 #define SPI_MISO_PVAL PB1
105 #define SPI_SCLK_PORT PB
106 #define SPI_SCLK_PNUM PN_B
107 #define SPI_SCLK_PIN 2
108 #define SPI_SCLK_PVAL PB2
110 #define SPI_CS_PORT PB
111 #define SPI_CS_PNUM PN_B
113 #define SPI_CS_PVAL PB3
115 #define CHARGE_STAT_PORT PA
116 #define CHARGE_STAT_PNUM PN_A
117 #define CHARGE_STAT_PIN 12
118 #define CHARGE_STAT_PVAL PA12
120 #if (CASCODA_CHILI_REV == 3)
121 #define PROGRAM_PORT PB
122 #define PROGRAM_PNUM PN_B
123 #define PROGRAM_PIN 15
124 #define PROGRAM_PVAL PB15
127 #define VOLTS_TEST_PORT PB
128 #define VOLTS_TEST_PNUM PN_B
129 #define VOLTS_TEST_PIN 12
130 #define VOLTS_TEST_PVAL PB12
132 #define VOLTS_PORT PA
133 #define VOLTS_PNUM PN_A
135 #define VOLTS_PVAL PA0
137 #if defined(USE_UART)
138 #define UART_TXD_PORT PB
139 #define UART_TXD_PNUM PN_B
140 #define UART_TXD_PIN 5
141 #define UART_TXD_PVAL PB5
144 #if defined(USE_UART)
145 #define UART_RXD_PORT PB
146 #define UART_RXD_PNUM PN_B
147 #define UART_RXD_PIN 4
148 #define UART_RXD_PVAL PB4
151 #if (CASCODA_CHILI_REV == 2)
152 #define BATT_ON_PORT PA
153 #define BATT_ON_PNUM PN_A
154 #define BATT_ON_PIN 8
155 #define BATT_ON_PVAL PA8
158 #if (CASCODA_CHILI_REV != 2) && (CASCODA_CHILI_REV != 3)
159 #error "Unsupported Chili Revision"
Declaration of platform abstraction functions.
Type definitions used by Cascoda baremetal drivers.
unsigned char u8_t
Definition: cascoda_types.h:46
void CHILI_ModuleSetMFP(enPortnum portnum, u8_t portbit, u8_t func)
Sets MFP Functionality.
Definition: cascoda_gpio_chili.c:193
u8_t CHILI_ModuleGetPortBitFromPin(u8_t mpin)
Gets pin number from module pin.
Definition: cascoda_gpio_chili.c:154
enPortnum
Definition: cascoda_chili_gpio.h:56
@ PN_NA
Definition: cascoda_chili_gpio.h:63
@ PN_A
Definition: cascoda_chili_gpio.h:57
@ PN_D
Definition: cascoda_chili_gpio.h:60
@ PN_F
Definition: cascoda_chili_gpio.h:62
@ PN_E
Definition: cascoda_chili_gpio.h:61
@ PN_B
Definition: cascoda_chili_gpio.h:58
@ PN_C
Definition: cascoda_chili_gpio.h:59
u8_t CHILI_ModuleGetIndexFromPin(u8_t mpin)
Gets List Index from Module Pin.
Definition: cascoda_gpio_chili.c:180
void CHILI_ModulePowerUpGPIOs(void)
Re-configure GPIOs for PowerUp.
Definition: cascoda_gpio_chili.c:252
void CHILI_ModulePowerDownGPIOs(void)
Re-configure GPIOs for PowerDown.
Definition: cascoda_gpio_chili.c:231
void CHILI_ModulePinIRQHandler(enPortnum portnum)
ISR: Module Pin Interrupt Handling.
Definition: cascoda_gpio_chili.c:271
u8_t CHILI_ModuleGetPortNumFromPin(u8_t mpin)
Gets port number from module pin.
Definition: cascoda_gpio_chili.c:167
u8_t CHILI_ModuleGetPinFromPort(enPortnum portnum, u8_t portbit)
Gets Module Pin from List index.
Definition: cascoda_gpio_chili.c:141