Appiko
Functions
GPIO Private Functions

Functions

void S2LPGpioInit (SGpioInit *pxGpioInitStruct)
 Initialize the S2LP GPIOx according to the specified parameters in the pxGpioInitStruct. More...
 
void S2LPGpioSetLevel (S2LPGpioPin xGpioX, OutputLevel xLevel)
 Force S2LP GPIO_x configured as digital output, to VDD or GND. More...
 
OutputLevel S2LPGpioGetLevel (S2LPGpioPin xGpioX)
 Return output value (VDD or GND) of S2LP GPIO_x, when it is configured as digital output. More...
 
void S2LPGpioIrqDeInit (S2LPIrqs *pxIrqInit)
 Deinit the S2LPIrqs structure setting all the bitfield to 0. Moreover, it sets the IRQ mask registers to 0x00000000, disabling all IRQs. More...
 
void S2LPGpioIrqInit (S2LPIrqs *pxIrqInit)
 Enable the IRQs according to the user defined pxIrqInit structure. More...
 
void S2LPGpioIrqConfig (IrqList xIrq, SFunctionalState xNewState)
 Enable or disables a specific IRQ. More...
 
void S2LPGpioIrqGetMask (S2LPIrqs *pxIrqMask)
 Fill a pointer to a structure of S2LPIrqs type reading the IRQ_MASK registers. More...
 
void S2LPGpioIrqGetStatus (S2LPIrqs *pxIrqStatus)
 Fill a pointer to a structure of S2LPIrqs type reading the IRQ_STATUS registers. More...
 
void S2LPGpioIrqClearStatus (void)
 Clear the IRQ status registers. More...
 
SBool S2LPGpioIrqCheckFlag (IrqList xFlag)
 Verifie if a specific IRQ has been generated. The call resets all the IRQ status, so it can't be used in case of multiple raising interrupts. More...
 

Detailed Description

Function Documentation

◆ S2LPGpioGetLevel()

OutputLevel S2LPGpioGetLevel ( S2LPGpioPin  xGpioX)
Parameters
xGpioXSpecifies the GPIO to be read. This parameter can be one of following parameters:
  • S2LP_GPIO_0: S2LP GPIO_0
  • S2LP_GPIO_1: S2LP GPIO_1
  • S2LP_GPIO_2: S2LP GPIO_2
  • S2LP_GPIO_3: S2LP GPIO_3
Return values
OutputLevelLogical level of selected GPIO configured as digital output. This parameter can be: HIGH or LOW.

Definition at line 226 of file S2LP_Gpio.c.

◆ S2LPGpioInit()

void S2LPGpioInit ( SGpioInit pxGpioInitStruct)
Parameters
pxGpioInitStructpointer to a SGpioInit structure that contains the configuration information for the specified S2LP GPIO.
Return values
None.

Definition at line 168 of file S2LP_Gpio.c.

◆ S2LPGpioIrqCheckFlag()

SBool S2LPGpioIrqCheckFlag ( IrqList  xFlag)
Parameters
xFlagIRQ flag to be checked. This parameter can be any value of IrqList.
Return values
SBoolS_TRUE or S_FALSE.

Definition at line 418 of file S2LP_Gpio.c.

◆ S2LPGpioIrqClearStatus()

void S2LPGpioIrqClearStatus ( void  )
Parameters
None.
Return values
None.

Definition at line 403 of file S2LP_Gpio.c.

References g_xStatus.

◆ S2LPGpioIrqConfig()

void S2LPGpioIrqConfig ( IrqList  xIrq,
SFunctionalState  xNewState 
)
Parameters
xIrqIRQ to enable or disable. This parameter can be any value of IrqList.
xNewStatenew state for the IRQ. This parameter can be: S_ENABLE or S_DISABLE.
Return values
None.

Definition at line 303 of file S2LP_Gpio.c.

◆ S2LPGpioIrqDeInit()

void S2LPGpioIrqDeInit ( S2LPIrqs pxIrqInit)
Parameters
pxIrqInitpointer to a variable of type S2LPIrqs, in which all the bitfields will be settled to zero.
Return values
None.

Definition at line 253 of file S2LP_Gpio.c.

References g_xStatus.

◆ S2LPGpioIrqGetMask()

void S2LPGpioIrqGetMask ( S2LPIrqs pxIrqMask)
Parameters
pxIrqMaskpointer to a variable of type S2LPIrqs, through which the user can read which IRQs are enabled. All the bitfields equals to zero correspond to enabled IRQs, while all the bitfields equals to one correspond to disabled IRQs. This parameter is a pointer to a S2LPIrqs. For example suppose that the Power On Reset and RX Data ready are the only enabled IRQs.
S2LPIrqs myIrqMask;
S2LPIrqGetStatus(&myIrqMask);
Then myIrqMask.IRQ_POR and myIrqMask.IRQ_RX_DATA_READY are equal to 0 while all the other bitfields are equal to one.
Return values
None.

Definition at line 352 of file S2LP_Gpio.c.

References g_xStatus.

◆ S2LPGpioIrqGetStatus()

void S2LPGpioIrqGetStatus ( S2LPIrqs pxIrqStatus)
Parameters
pxIrqStatuspointer to a variable of type S2LPIrqs, through which the user can read the status of all the IRQs. All the bitfields equals to one correspond to the raised interrupts. This parameter is a pointer to a S2LPIrqs. For example suppose that the XO settling timeout is raised as well as the Sync word detection.
S2LPIrqs myIrqStatus;
S2LPGpioIrqGetStatus(&myIrqStatus);
Then myIrqStatus.IRQ_XO_COUNT_EXPIRED and myIrqStatus.IRQ_VALID_SYNC are equals to 1 while all the other bitfields are equals to zero.
Return values
None.

Definition at line 383 of file S2LP_Gpio.c.

References g_xStatus.

◆ S2LPGpioIrqInit()

void S2LPGpioIrqInit ( S2LPIrqs pxIrqInit)
Parameters
pxIrqInitpointer to a variable of type S2LPIrqs, through which the user enable specific IRQs. This parameter is a pointer to a S2LPIrqs. For example suppose to enable only the two IRQ Low Battery Level and Tx Data Sent:
S2LPIrqs myIrqInit = {0};
myIrqInit.IRQ_LOW_BATT_LVL = 1;
myIrqInit.IRQ_TX_DATA_SENT = 1;
S2LPGpioIrqInit(&myIrqInit);
Return values
None.

Definition at line 280 of file S2LP_Gpio.c.

References g_xStatus.

◆ S2LPGpioSetLevel()

void S2LPGpioSetLevel ( S2LPGpioPin  xGpioX,
OutputLevel  xLevel 
)
Parameters
xGpioXSpecifies the GPIO to be configured. This parameter can be one of following parameters:
  • S2LP_GPIO_0: S2LP GPIO_0
  • S2LP_GPIO_1: S2LP GPIO_1
  • S2LP_GPIO_2: S2LP GPIO_2
  • S2LP_GPIO_3: S2LP GPIO_3
xLevelSpecifies the level. This parameter can be: HIGH or LOW.
Return values
None.

Definition at line 195 of file S2LP_Gpio.c.