pin pong

Dependents:   SX1272PingPong

Fork of SX1276Lib by Semtech

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers enums.h Source File

enums.h

00001 /*
00002  / _____)             _              | |
00003 ( (____  _____ ____ _| |_ _____  ____| |__
00004  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00005  _____) ) ____| | | || |_| ____( (___| | | |
00006 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00007     (C) 2014 Semtech
00008 
00009 Description: -
00010 
00011 License: Revised BSD License, see LICENSE.TXT file include in the project
00012 
00013 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
00014 */
00015 #ifndef __ENUMS_H__
00016 #define __ENUMS_H__
00017 
00018 /*!
00019  * Radio driver internal state machine states definition
00020  */
00021 typedef enum RadioState
00022 {
00023     RF_IDLE = 0,
00024     RF_RX_RUNNING,
00025     RF_TX_RUNNING,
00026     RF_CAD,
00027 }RadioState_t;
00028 
00029 /*!
00030  *    Type of the modem. [LORA / FSK]
00031  */
00032 typedef enum ModemType
00033 {
00034     MODEM_FSK = 0,
00035     MODEM_LORA
00036 }RadioModems_t;
00037 
00038 /*!
00039  * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS]
00040  */
00041 typedef enum BoardType
00042 {
00043     SX1276MB1MAS = 0,
00044     SX1276MB1LAS,
00045     SX1272RF1,
00046     UNKNOWN
00047 }BoardType_t;
00048 
00049 /*!
00050  * Radio FSK modem parameters
00051  */
00052 typedef struct
00053 {
00054     int8_t   Power;
00055     uint32_t Fdev;
00056     uint32_t Bandwidth;
00057     uint32_t BandwidthAfc;
00058     uint32_t Datarate;
00059     uint16_t PreambleLen;
00060     bool     FixLen;
00061     uint8_t  PayloadLen;
00062     bool     CrcOn;
00063     bool     IqInverted;
00064     bool     RxContinuous;
00065     uint32_t TxTimeout;
00066 }RadioFskSettings_t ;
00067 
00068 /*!
00069  * Radio FSK packet handler state
00070  */
00071 typedef struct
00072 {
00073     uint8_t  PreambleDetected;
00074     uint8_t  SyncWordDetected;
00075     int8_t   RssiValue;
00076     int32_t  AfcValue;
00077     uint8_t  RxGain;
00078     uint16_t Size;
00079     uint16_t NbBytes;
00080     uint8_t  FifoThresh;
00081     uint8_t  ChunkSize;
00082 }RadioFskPacketHandler_t ;
00083 
00084 /*!
00085  * Radio LoRa modem parameters
00086  */
00087 typedef struct
00088 {
00089     int8_t   Power;
00090     uint32_t Bandwidth;
00091     uint32_t Datarate;
00092     bool     LowDatarateOptimize;
00093     uint8_t  Coderate;
00094     uint16_t PreambleLen;
00095     bool     FixLen;
00096     uint8_t  PayloadLen;
00097     bool     CrcOn;
00098     bool     FreqHopOn;
00099     uint8_t  HopPeriod;
00100     bool     IqInverted;
00101     bool     RxContinuous;
00102     uint32_t TxTimeout;
00103 }RadioLoRaSettings_t ;
00104 
00105 /*!
00106  * Radio LoRa packet handler state
00107  */
00108 typedef struct
00109 {
00110     int8_t SnrValue;
00111     int8_t RssiValue;
00112     uint8_t Size;
00113 }RadioLoRaPacketHandler_t ;
00114 
00115 /*!
00116  * Radio Settings
00117  */
00118 typedef struct
00119 {
00120     RadioState               State;
00121     ModemType                Modem;
00122     uint32_t                 Channel;
00123     RadioFskSettings_t        Fsk;
00124     RadioFskPacketHandler_t   FskPacketHandler;
00125     RadioLoRaSettings_t       LoRa;
00126     RadioLoRaPacketHandler_t  LoRaPacketHandler;
00127 }RadioSettings_t ;
00128 
00129 
00130 #endif //__ENUMS_H__