Fork of SX1276Lib for the NiceRF SX1276 module.

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     UNKNOWN
00046 }BoardType_t;
00047 
00048 /*!
00049  * Radio FSK modem parameters
00050  */
00051 typedef struct
00052 {
00053     int8_t   Power;
00054     uint32_t Fdev;
00055     uint32_t Bandwidth;
00056     uint32_t BandwidthAfc;
00057     uint32_t Datarate;
00058     uint16_t PreambleLen;
00059     bool     FixLen;
00060     uint8_t  PayloadLen;
00061     bool     CrcOn;
00062     bool     IqInverted;
00063     bool     RxContinuous;
00064     uint32_t TxTimeout;
00065 }RadioFskSettings_t ;
00066 
00067 /*!
00068  * Radio FSK packet handler state
00069  */
00070 typedef struct
00071 {
00072     uint8_t  PreambleDetected;
00073     uint8_t  SyncWordDetected;
00074     int8_t   RssiValue;
00075     int32_t  AfcValue;
00076     uint8_t  RxGain;
00077     uint16_t Size;
00078     uint16_t NbBytes;
00079     uint8_t  FifoThresh;
00080     uint8_t  ChunkSize;
00081 }RadioFskPacketHandler_t ;
00082 
00083 /*!
00084  * Radio LoRa modem parameters
00085  */
00086 typedef struct
00087 {
00088     int8_t   Power;
00089     uint32_t Bandwidth;
00090     uint32_t Datarate;
00091     bool     LowDatarateOptimize;
00092     uint8_t  Coderate;
00093     uint16_t PreambleLen;
00094     bool     FixLen;
00095     uint8_t  PayloadLen;
00096     bool     CrcOn;
00097     bool     FreqHopOn;
00098     uint8_t  HopPeriod;
00099     bool     IqInverted;
00100     bool     RxContinuous;
00101     uint32_t TxTimeout;
00102 }RadioLoRaSettings_t ;
00103 
00104 /*!
00105  * Radio LoRa packet handler state
00106  */
00107 typedef struct
00108 {
00109     int8_t SnrValue;
00110     int8_t RssiValue;
00111     uint8_t Size;
00112 }RadioLoRaPacketHandler_t ;
00113 
00114 /*!
00115  * Radio Settings
00116  */
00117 typedef struct
00118 {
00119     RadioState               State;
00120     ModemType                Modem;
00121     uint32_t                 Channel;
00122     RadioFskSettings_t        Fsk;
00123     RadioFskPacketHandler_t   FskPacketHandler;
00124     RadioLoRaSettings_t       LoRa;
00125     RadioLoRaPacketHandler_t  LoRaPacketHandler;
00126 }RadioSettings_t ;
00127 
00128 
00129 #endif //__ENUMS_H__