Appiko
S2LP_Commands.h
Go to the documentation of this file.
1 
37 /* Define to prevent recursive inclusion -------------------------------------*/
38 #ifndef __S2LP_COMMANDS_H
39 #define __S2LP_COMMANDS_H
40 
41 
42 /* Includes ------------------------------------------------------------------*/
43 
44 #include "S2LP_Regs.h"
45 #include "S2LP_Types.h"
46 
47 
48 #ifdef __cplusplus
49  extern "C" {
50 #endif
51 
52 
74 typedef enum
75 {
76  CMD_TX = ((uint8_t)(0x60)),
77  CMD_RX = ((uint8_t)(0x61)),
78  CMD_READY = ((uint8_t)(0x62)),
79  CMD_STANDBY = ((uint8_t)(0x63)),
80  CMD_SLEEP = ((uint8_t)(0x64)),
81  CMD_LOCKRX = ((uint8_t)(0x65)),
82  CMD_LOCKTX = ((uint8_t)(0x66)),
83  CMD_SABORT = ((uint8_t)(0x67)),
84  CMD_LDC_RELOAD = ((uint8_t)(0x68)),
85  CMD_RCO_CALIB = ((uint8_t)(0x69)),
86  CMD_SRES = ((uint8_t)(0x70)),
87  CMD_FLUSHRXFIFO = ((uint8_t)(0x71)),
88  CMD_FLUSHTXFIFO = ((uint8_t)(0x72)),
89  CMD_SEQUENCE_UPDATE = ((uint8_t)(0x73)),
90 } S2LPCmd;
91 
92 
120 #define S2LPCmdStrobeTx() {uint8_t tmp=0x9C; S2LPSpiWriteRegisters(0x76,1,&tmp);\
121  S2LPCmdStrobeCommand(CMD_TX);}
122 
129 //#define S2LPCmdStrobeRx() S2LPCmdStrobeCommand(CMD_RX)
130 #define S2LPCmdStrobeRx() {uint8_t tmp=0x90; S2LPSpiWriteRegisters(0x76,1,&tmp);\
131  S2LPCmdStrobeCommand(CMD_RX);}
132 
133 
134 #define S2LPCmdStrobeReady() S2LPCmdStrobeCommand(CMD_READY)
135 #define S2LPCmdStrobeStandby() S2LPCmdStrobeCommand(CMD_STANDBY)
136 #define S2LPCmdStrobeSleep() S2LPCmdStrobeCommand(CMD_SLEEP)
137 #define S2LPCmdStrobeLockRx() S2LPCmdStrobeCommand(CMD_LOCKRX)
138 #define S2LPCmdStrobeLockTx() S2LPCmdStrobeCommand(CMD_LOCKTX)
139 #define S2LPCmdStrobeSabort() S2LPCmdStrobeCommand(CMD_SABORT)
140 #define S2LPCmdStrobeLdcReload() S2LPCmdStrobeCommand(CMD_LDC_RELOAD)
141 #define S2LPCmdStrobeSequenceUpdate() S2LPCmdStrobeCommand(CMD_SEQUENCE_UPDATE)
142 #define S2LPCmdStrobeSres() S2LPCmdStrobeCommand(CMD_SRES)
143 #define S2LPCmdStrobeFlushRxFifo() S2LPCmdStrobeCommand(CMD_FLUSHRXFIFO)
144 #define S2LPCmdStrobeFlushTxFifo() S2LPCmdStrobeCommand(CMD_FLUSHTXFIFO)
145 
146 
157 void S2LPCmdStrobeCommand(S2LPCmd xCommandCode);
158 
159 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif
181 
182 /******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/
S2LPCmd
S2LP Commands codes enumeration.
Definition: S2LP_Commands.h:74
void S2LPCmdStrobeCommand(S2LPCmd xCommandCode)
Send a specific command to S2LP.
This file contains all the registers address and masks.
Header file for S2-LP types.