Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
cascoda_chili_gpio.h File Reference
Include dependency graph for cascoda_chili_gpio.h:

Go to the source code of this file.

Macros

#define GPIO_BASE   GPIOA_BASE
 
#define MGPIO_PORT(portnum)   ((GPIO_T *)(GPIO_BASE + (portnum * 0x40UL)))
 
#define MGPIO_PORTPIN(portnum, pin)   (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE + (0x40 * (portnum))) + ((pin) << 2))))
 
#define BITMASK(x)   (1UL << x)
 
#define PMFP_GPIO   0
 
#define PMFP_SPI   3
 
#define PMFP_UART   1
 
#define PMFP_ADC   1
 
#define ZIG_RESET_PORT   PA
 
#define ZIG_RESET_PNUM   PN_A
 
#define ZIG_RESET_PIN   11
 
#define ZIG_RESET_PVAL   PA11
 
#define ZIG_IRQB_PORT   PA
 
#define ZIG_IRQB_PNUM   PN_A
 
#define ZIG_IRQB_PIN   10
 
#define ZIG_IRQB_PVAL   PA10
 
#define ZIG_IRQB_IRQn   GPABC_IRQn
 
#define SPI_MOSI_PORT   PB
 
#define SPI_MOSI_PNUM   PN_B
 
#define SPI_MOSI_PIN   0
 
#define SPI_MOSI_PVAL   PB0
 
#define SPI_MISO_PORT   PB
 
#define SPI_MISO_PNUM   PN_B
 
#define SPI_MISO_PIN   1
 
#define SPI_MISO_PVAL   PB1
 
#define SPI_SCLK_PORT   PB
 
#define SPI_SCLK_PNUM   PN_B
 
#define SPI_SCLK_PIN   2
 
#define SPI_SCLK_PVAL   PB2
 
#define SPI_CS_PORT   PB
 
#define SPI_CS_PNUM   PN_B
 
#define SPI_CS_PIN   3
 
#define SPI_CS_PVAL   PB3
 
#define CHARGE_STAT_PORT   PA
 
#define CHARGE_STAT_PNUM   PN_A
 
#define CHARGE_STAT_PIN   12
 
#define CHARGE_STAT_PVAL   PA12
 
#define VOLTS_TEST_PORT   PB
 
#define VOLTS_TEST_PNUM   PN_B
 
#define VOLTS_TEST_PIN   12
 
#define VOLTS_TEST_PVAL   PB12
 
#define VOLTS_PORT   PA
 
#define VOLTS_PNUM   PN_A
 
#define VOLTS_PIN   0
 
#define VOLTS_PVAL   PA0
 

Typedefs

typedef enum enPortnum enPortnum
 

Enumerations

enum  enPortnum {
  PN_A = 0 , PN_B = 1 , PN_C = 2 , PN_D = 3 ,
  PN_E = 4 , PN_F = 5 , PN_NA = 255 , PN_A = 0 ,
  PN_B = 1 , PN_C = 2 , PN_D = 3 , PN_E = 4 ,
  PN_F = 5 , PN_G = 6 , PN_H = 7 , PN_NA = 255
}
 

Functions

u8_t CHILI_ModuleGetPinFromPort (enPortnum portnum, u8_t portbit)
 Gets Module Pin from List index. More...
 
u8_t CHILI_ModuleGetPortBitFromPin (u8_t mpin)
 Gets pin number from module pin. More...
 
u8_t CHILI_ModuleGetPortNumFromPin (u8_t mpin)
 Gets port number from module pin. More...
 
u8_t CHILI_ModuleGetIndexFromPin (u8_t mpin)
 Gets List Index from Module Pin. More...
 
void CHILI_ModuleSetMFP (enPortnum portnum, u8_t portbit, u8_t func)
 Sets MFP Functionality. More...
 
void CHILI_ModulePowerDownGPIOs (void)
 Re-configure GPIOs for PowerDown. More...
 
void CHILI_ModulePowerUpGPIOs (void)
 Re-configure GPIOs for PowerUp. More...
 
void CHILI_ModulePinIRQHandler (enPortnum portnum)
 ISR: Module Pin Interrupt Handling. More...
 

Macro Definition Documentation

◆ BITMASK

#define BITMASK (   x)    (1UL << x)

◆ CHARGE_STAT_PIN

#define CHARGE_STAT_PIN   12

◆ CHARGE_STAT_PNUM

#define CHARGE_STAT_PNUM   PN_A

◆ CHARGE_STAT_PORT

#define CHARGE_STAT_PORT   PA

◆ CHARGE_STAT_PVAL

#define CHARGE_STAT_PVAL   PA12

◆ GPIO_BASE

#define GPIO_BASE   GPIOA_BASE

◆ MGPIO_PORT

#define MGPIO_PORT (   portnum)    ((GPIO_T *)(GPIO_BASE + (portnum * 0x40UL)))

◆ MGPIO_PORTPIN

#define MGPIO_PORTPIN (   portnum,
  pin 
)    (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE + (0x40 * (portnum))) + ((pin) << 2))))

◆ PMFP_ADC

#define PMFP_ADC   1

◆ PMFP_GPIO

#define PMFP_GPIO   0

◆ PMFP_SPI

#define PMFP_SPI   3

◆ PMFP_UART

#define PMFP_UART   1

◆ SPI_CS_PIN

#define SPI_CS_PIN   3

◆ SPI_CS_PNUM

#define SPI_CS_PNUM   PN_B

◆ SPI_CS_PORT

#define SPI_CS_PORT   PB

◆ SPI_CS_PVAL

#define SPI_CS_PVAL   PB3

◆ SPI_MISO_PIN

#define SPI_MISO_PIN   1

◆ SPI_MISO_PNUM

#define SPI_MISO_PNUM   PN_B

◆ SPI_MISO_PORT

#define SPI_MISO_PORT   PB

◆ SPI_MISO_PVAL

#define SPI_MISO_PVAL   PB1

◆ SPI_MOSI_PIN

#define SPI_MOSI_PIN   0

◆ SPI_MOSI_PNUM

#define SPI_MOSI_PNUM   PN_B

◆ SPI_MOSI_PORT

#define SPI_MOSI_PORT   PB

◆ SPI_MOSI_PVAL

#define SPI_MOSI_PVAL   PB0

◆ SPI_SCLK_PIN

#define SPI_SCLK_PIN   2

◆ SPI_SCLK_PNUM

#define SPI_SCLK_PNUM   PN_B

◆ SPI_SCLK_PORT

#define SPI_SCLK_PORT   PB

◆ SPI_SCLK_PVAL

#define SPI_SCLK_PVAL   PB2

◆ VOLTS_PIN

#define VOLTS_PIN   0

◆ VOLTS_PNUM

#define VOLTS_PNUM   PN_A

◆ VOLTS_PORT

#define VOLTS_PORT   PA

◆ VOLTS_PVAL

#define VOLTS_PVAL   PA0

◆ VOLTS_TEST_PIN

#define VOLTS_TEST_PIN   12

◆ VOLTS_TEST_PNUM

#define VOLTS_TEST_PNUM   PN_B

◆ VOLTS_TEST_PORT

#define VOLTS_TEST_PORT   PB

◆ VOLTS_TEST_PVAL

#define VOLTS_TEST_PVAL   PB12

◆ ZIG_IRQB_IRQn

#define ZIG_IRQB_IRQn   GPABC_IRQn

◆ ZIG_IRQB_PIN

#define ZIG_IRQB_PIN   10

◆ ZIG_IRQB_PNUM

#define ZIG_IRQB_PNUM   PN_A

◆ ZIG_IRQB_PORT

#define ZIG_IRQB_PORT   PA

◆ ZIG_IRQB_PVAL

#define ZIG_IRQB_PVAL   PA10

◆ ZIG_RESET_PIN

#define ZIG_RESET_PIN   11

◆ ZIG_RESET_PNUM

#define ZIG_RESET_PNUM   PN_A

◆ ZIG_RESET_PORT

#define ZIG_RESET_PORT   PA

◆ ZIG_RESET_PVAL

#define ZIG_RESET_PVAL   PA11

Typedef Documentation

◆ enPortnum

typedef enum enPortnum enPortnum

Enumeration Type Documentation

◆ enPortnum

enum enPortnum
Enumerator
PN_A 
PN_B 
PN_C 
PN_D 
PN_E 
PN_F 
PN_NA 
PN_A 
PN_B 
PN_C 
PN_D 
PN_E 
PN_F 
PN_G 
PN_H 
PN_NA 

Function Documentation

◆ CHILI_ModuleGetIndexFromPin()

u8_t CHILI_ModuleGetIndexFromPin ( u8_t  mpin)

Gets List Index from Module Pin.

Parameters
mpin- module pin number
Returns
list index or P_NA

◆ CHILI_ModuleGetPinFromPort()

u8_t CHILI_ModuleGetPinFromPort ( enPortnum  portnum,
u8_t  portbit 
)

Gets Module Pin from List index.

Parameters
portnum- port number
portbit- pin number
Returns
list index or P_NA

◆ CHILI_ModuleGetPortBitFromPin()

u8_t CHILI_ModuleGetPortBitFromPin ( u8_t  mpin)

Gets pin number from module pin.

Parameters
mpin- module pin number
Returns
list index or P_NA

◆ CHILI_ModuleGetPortNumFromPin()

u8_t CHILI_ModuleGetPortNumFromPin ( u8_t  mpin)

Gets port number from module pin.

Parameters
mpin- module pin number
Returns
list index or P_NA

◆ CHILI_ModulePinIRQHandler()

void CHILI_ModulePinIRQHandler ( enPortnum  portnum)

ISR: Module Pin Interrupt Handling.

◆ CHILI_ModulePowerDownGPIOs()

void CHILI_ModulePowerDownGPIOs ( void  )

Re-configure GPIOs for PowerDown.

◆ CHILI_ModulePowerUpGPIOs()

void CHILI_ModulePowerUpGPIOs ( void  )

Re-configure GPIOs for PowerUp.

◆ CHILI_ModuleSetMFP()

void CHILI_ModuleSetMFP ( enPortnum  portnum,
u8_t  portbit,
u8_t  func 
)

Sets MFP Functionality.

Parameters
portnum- returned port number
portbit- returned port b
func- function to set the pin to