1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /*! @file radio.h
- * @brief This file contains the public functions controlling the radio chip.
- *
- * @b COPYRIGHT
- * @n Silicon Laboratories Confidential
- * @n Copyright 2012 Silicon Laboratories, Inc.
- * @n http://www.silabs.com
- */
- #ifndef RADIO_H_
- #define RADIO_H_
- #include "stm32f10x.h"
- #include <stdbool.h>
- /*****************************************************************************
- * Global Macros & Definitions
- *****************************************************************************/
- extern uint8_t fixRadioPacket[];
- extern uint8_t customRadioPacket[];
- /*! Maximal packet length definition (FIFO size) */
- #define RADIO_MAX_PACKET_LENGTH 64
-
- /*****************************************************************************
- * Global Typedefs & Enums
- *****************************************************************************/
- typedef struct
- {
- uint8_t *Radio_ConfigurationArray;
- uint8_t Radio_ChannelNumber;
- uint8_t Radio_PacketLength;
- uint8_t Radio_State_After_Power_Up;
- uint16_t Radio_Delay_Cnt_After_Reset;
- uint8_t Radio_CustomPayload[RADIO_MAX_PACKET_LENGTH];
- } tRadioConfiguration;
- typedef enum
- {
- RFLR_STATE_IDLE,
- RFLR_STATE_RX_INIT,
- RFLR_STATE_RX_RUNNING,
- RFLR_STATE_RX_DONE,
-
- RFLR_STATE_RX_ACK_INIT,
- RFLR_STATE_RX_ACK_DONE,
- RFLR_STATE_RX_TIMEOUT,
-
- RFLR_STATE_TX_INIT,
- RFLR_STATE_TX_RUNNING,
- RFLR_STATE_TX_DONE,
- RFLR_STATE_TX_TIMEOUT,
-
- RFLR_STATE_TX_ACK_INIT,
- RFLR_STATE_TX_ACK_DONE,
-
- RFLR_STATE_SLEEP,
- }tRFLRStates;
- extern tRadioConfiguration* pRadioConfiguration;
- extern tRadioConfiguration RadioConfiguration;
- extern uint8_t Radio_Configuration_Data_Array[];
- extern uint8_t customRadioPacket[];
- void vRadio_Init(void);
- void vRadio_StartTx(uint8_t, uint8_t *);
- uint8_t bRadio_Check_Ezconfig(uint16_t);
- bool gRadio_CheckTransmitted(void);
- uint8_t bRadio_Check_Tx_RX(void);
- void vRadio_StartRX(uint8_t channel, uint8_t packetLenght );
- void vRadio_StartTx_Variable_Packet(uint8_t channel, uint8_t *pioRadioPacket, uint8_t length);
- void vRadio_StartSleep(void);
- uint16_t vRadio_getRxCount(void);
- uint8_t vRadio_getRssi(void);
- uint8_t vRadio_getPacketRssi(void);
- #endif /* RADIO_H_ */
|