Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
cascoda_gpio_chili.c File Reference
#include <stdio.h>
#include <string.h>
#include "Nano100Series.h"
#include "adc.h"
#include "gpio.h"
#include "spi.h"
#include "sys.h"
#include "timer.h"
#include "uart.h"
#include "usbd.h"
#include "cascoda-bm/cascoda_evbme.h"
#include "cascoda-bm/cascoda_interface.h"
#include "cascoda-bm/cascoda_spi.h"
#include "cascoda-bm/cascoda_types.h"
#include "cascoda-util/cascoda_time.h"
#include "ca821x_api.h"
#include "cascoda_chili.h"
#include "cascoda_chili_gpio.h"
Include dependency graph for cascoda_gpio_chili.c:

Classes

struct  pinlist
 
struct  pinstatus
 

Enumerations

enum  {
  PIN_SWITCH = 9 , PIN_LED_GREEN = 101 , PIN_LED_RED = 102 , PIN_USB_PRESENT = 103 ,
  NUM_MODULEPINS = 13
}
 

Functions

struct ModuleSpecialPins BSP_GetModuleSpecialPins (void)
 Get the struct of special pins for the platform. More...
 
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...
 
ca_error BSP_ModuleRegisterGPIOInput (struct gpio_input_args *args)
 Registers GPIO Input Functionality for Module Pin. More...
 
ca_error BSP_ModuleRegisterGPIOOutput (u8_t mpin, module_pin_type isled)
 Registers GPIO Output Functionality for Module Pin. More...
 
ca_error BSP_ModuleRegisterGPIOOutputOD (u8_t mpin, module_pin_type isled)
 Registers GPIO Open Drain Output Functionality for Module Pin. More...
 
ca_error BSP_ModuleRegisterGPIOSharedInputOutputOD (struct gpio_input_args *args, module_pin_type isled)
 Registers GPIO Input AND Open Drain Output Functionality for Module Pin. More...
 
ca_error BSP_ModuleDeregisterGPIOPin (u8_t mpin)
 Unregisters GPIO Functionality for Module Pin to Default Settings. More...
 
u8_t BSP_ModuleIsGPIOPinRegistered (u8_t mpin)
 Checks if a Module Pin is already registered / used. More...
 
ca_error BSP_ModuleSetGPIOPin (u8_t mpin, u8_t val)
 Sets Module Pin GPIO Output Value. More...
 
ca_error BSP_ModuleSenseGPIOPin (u8_t mpin, u8_t *val)
 Senses GPIO Input Value of Module Pin. More...
 
ca_error BSP_ModuleSetGPIOOutputPermanent (u8_t mpin)
 Sets Module Pin GPIO Output as permanently driven (don't tristate in Power-Down) More...
 
ca_error BSP_ModuleReadVoltsPin (u8_t mpin, u32_t *val)
 Reads ADC Conversion Value on Module Pin. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PIN_SWITCH 
PIN_LED_GREEN 
PIN_LED_RED 
PIN_USB_PRESENT 
NUM_MODULEPINS 

number of dynamically available module i/o pins

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