Appiko
S2LP_Types.c
Go to the documentation of this file.
1 
24 /* Includes ------------------------------------------------------------------*/
25 #include "S2LP_Types.h"
26 #include "S2LP_Regs.h"
27 #include "MCU_Interface.h"
28 
29 
83 
106 #ifdef S2LP_USE_FULL_ASSERT
107 
114 void s_assert_failed(uint8_t* file, uint32_t line)
115 {
116  /* User can add his own implementation to report the file name and line number */
117  printf("Wrong parameters value: file %s on line %d\r\n", file, line);
118 
119  /* Infinite loop */
120  while (1)
121  {
122  }
123 }
124 #endif
125 
126 
134 {
135  uint8_t tempRegValue;
136  /* Read the MC_STATE both from register and from SPI header and exit when they match.
137  This will protect against possible transition state changes */
138  do
139  {
140  /* Reads the MC_STATE register to update the g_xStatus */
141  g_xStatus = S2LPSpiReadRegisters(MC_STATE0_ADDR, 1, &tempRegValue);
142  }
143  while((tempRegValue>>1)!=g_xStatus.MC_STATE);
144 
145 }
146 
147 
166 /******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/
volatile S2LPStatus g_xStatus
S2LP Status global variable. This global variable of S2LPStatus type is updated on every SPI transact...
Definition: S2LP_Types.c:82
#define MC_STATE0_ADDR
MC_STATE0 register.
Definition: S2LP_Regs.h:1484
S2LPState MC_STATE
Definition: S2LP_Types.h:119
S2LP Status. This definition represents the single field of the S2LP status returned on each SPI tran...
Definition: S2LP_Types.h:117
This file contains all the registers address and masks.
void S2LPRefreshStatus(void)
Updates the gState (the global variable used to maintain memory of S2LP Status) reading the MC_STATE ...
Definition: S2LP_Types.c:133
Header file for low level S2LP SPI driver.
Header file for S2-LP types.