EVE 1.0
radio.h
Go to the documentation of this file.
1 /*! @file radio.h
2  * @brief This file is contains the public radio interface functions.
3  *
4  * @b COPYRIGHT
5  * @n Silicon Laboratories Confidential
6  * @n Copyright 2012 Silicon Laboratories, Inc.
7  * @n http://www.silabs.com
8  */
9 
10 #ifndef RADIO_H_
11 #define RADIO_H_
12 
13 #include <dev/gpio.h>
14 #include <dev/spi.h>
15 /*****************************************************************************
16  * Global Macros & Definitions
17  *****************************************************************************/
18 /*! Maximal packet length definition (FIFO size) */
19 #define RADIO_MAX_PACKET_LENGTH 64u
20 
21 /*****************************************************************************
22  * Global Typedefs & Enums
23  *****************************************************************************/
24 typedef struct
25 {
26  const uint8_t *Radio_ConfigurationArray;
27 
28  uint8_t Radio_ChannelNumber;
29  uint8_t Radio_PacketLength;
30  uint8_t Radio_State_After_Power_Up;
31 
32  uint16_t Radio_Delay_Cnt_After_Reset;
33 
34  uint8_t Radio_CustomPayload[RADIO_MAX_PACKET_LENGTH];
35 } tRadioConfiguration;
36 
37 typedef struct si4455_ph_int_t {
38  union {
39  uint8_t Raw;
40  struct {
41  uint8_t RxFifoAlmostFull : 1;
42  uint8_t TxFifoAlmostEmpty : 1;
43  uint8_t Reserved1 : 1;
44  uint8_t Crc32Error : 1;
45  uint8_t PacketRx : 1;
46  uint8_t PacketSent : 1;
47  uint8_t Reserved2 : 2;
48  };
49  };
50 } si4455_ph_int_t;
51 
52 typedef struct si4455_modem_int_t {
53  union {
54  uint8_t Raw;
55  struct {
56  uint8_t SyncDetect : 1;
57  uint8_t PreambleDetect : 1;
58  uint8_t InvalidPreamble : 1;
59  uint8_t Rssi : 1;
60  uint8_t RssiJump : 1;
61  uint8_t InvalidSync : 1;
62  uint8_t PostambleDetect : 1;
63  uint8_t Reserved1 : 1;
64  };
65  };
66 } si4455_modem_int_t;
67 
68 typedef struct si4455_chip_int_t {
69  union {
70  uint8_t Raw;
71  struct {
72  uint8_t Reserved1 : 2;
73  uint8_t ChipReady : 1;
74  uint8_t CmdErr : 1;
75  uint8_t StateChange : 1;
76  uint8_t FifoUnderflowOverflowError : 1;
77  uint8_t Cal : 1;
78  uint8_t Reserved2 : 1;
79  };
80  };
81 } si4455_chip_int_t;
82 
83 struct si4455_state_t
84 {
85  si4455_ph_int_t intPh;
86  si4455_modem_int_t intModem;
87  si4455_chip_int_t intChip;
88  bool ctsWentHigh;
89 };
90 
91 struct si4455_t
92 {
93  const struct spi_t *Spi;
94  const struct spi_cs_t SpiCs;
95  uint32_t SpiBaudrate;
96  struct si4455_state_t *State;
97  const uint8_t *Config;
98  uint8_t SdnPin;
99  uint8_t IrqPin;
100 };
101 
102 /*****************************************************************************
103  * Global Variable Declarations
104  *****************************************************************************/
105 
106 /*****************************************************************************
107  * Global Function Declarations
108  *****************************************************************************/
109 void vRadio_Init(const struct si4455_t *radio);
110 bool gRadio_CheckTransmitted(const struct si4455_t *radio);
111 void vRadio_StartTx(const struct si4455_t *radio, uint8_t channel, uint8_t *data, uint8_t length);
112 
113 #endif /* RADIO_H_ */
Driver for port initialisazion and IO functions for nRF52 uC.
Definition: spi.h:113
Driver for the MCU&#39;s SPI blocks.
#define RADIO_MAX_PACKET_LENGTH
Definition: radio.h:19
uint8_t data[USBNET_RX_BUF_SIZE]
Definition: usbnet.h:140
Definition: spi.h:166