1
enums/enums.h@0:7e14d7c443f1, 2016-10-08 (annotated)
- Committer:
- floatlei
- Date:
- Sat Oct 08 02:35:14 2016 +0000
- Revision:
- 0:7e14d7c443f1
11
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
floatlei | 0:7e14d7c443f1 | 1 | /* |
floatlei | 0:7e14d7c443f1 | 2 | / _____) _ | | |
floatlei | 0:7e14d7c443f1 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
floatlei | 0:7e14d7c443f1 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
floatlei | 0:7e14d7c443f1 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
floatlei | 0:7e14d7c443f1 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
floatlei | 0:7e14d7c443f1 | 7 | (C) 2014 Semtech |
floatlei | 0:7e14d7c443f1 | 8 | |
floatlei | 0:7e14d7c443f1 | 9 | Description: - |
floatlei | 0:7e14d7c443f1 | 10 | |
floatlei | 0:7e14d7c443f1 | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
floatlei | 0:7e14d7c443f1 | 12 | |
floatlei | 0:7e14d7c443f1 | 13 | Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin |
floatlei | 0:7e14d7c443f1 | 14 | */ |
floatlei | 0:7e14d7c443f1 | 15 | #ifndef __ENUMS_H__ |
floatlei | 0:7e14d7c443f1 | 16 | #define __ENUMS_H__ |
floatlei | 0:7e14d7c443f1 | 17 | |
floatlei | 0:7e14d7c443f1 | 18 | /*! |
floatlei | 0:7e14d7c443f1 | 19 | * Radio driver internal state machine states definition |
floatlei | 0:7e14d7c443f1 | 20 | */ |
floatlei | 0:7e14d7c443f1 | 21 | typedef enum RadioState |
floatlei | 0:7e14d7c443f1 | 22 | { |
floatlei | 0:7e14d7c443f1 | 23 | RF_IDLE = 0, |
floatlei | 0:7e14d7c443f1 | 24 | RF_RX_RUNNING, |
floatlei | 0:7e14d7c443f1 | 25 | RF_TX_RUNNING, |
floatlei | 0:7e14d7c443f1 | 26 | RF_CAD, |
floatlei | 0:7e14d7c443f1 | 27 | }RadioState_t; |
floatlei | 0:7e14d7c443f1 | 28 | |
floatlei | 0:7e14d7c443f1 | 29 | /*! |
floatlei | 0:7e14d7c443f1 | 30 | * Type of the modem. [LORA / FSK] |
floatlei | 0:7e14d7c443f1 | 31 | */ |
floatlei | 0:7e14d7c443f1 | 32 | typedef enum ModemType |
floatlei | 0:7e14d7c443f1 | 33 | { |
floatlei | 0:7e14d7c443f1 | 34 | MODEM_FSK = 0, |
floatlei | 0:7e14d7c443f1 | 35 | MODEM_LORA |
floatlei | 0:7e14d7c443f1 | 36 | }RadioModems_t; |
floatlei | 0:7e14d7c443f1 | 37 | |
floatlei | 0:7e14d7c443f1 | 38 | /*! |
floatlei | 0:7e14d7c443f1 | 39 | * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS] |
floatlei | 0:7e14d7c443f1 | 40 | */ |
floatlei | 0:7e14d7c443f1 | 41 | typedef enum BoardType |
floatlei | 0:7e14d7c443f1 | 42 | { |
floatlei | 0:7e14d7c443f1 | 43 | SX1276MB1MAS = 0, |
floatlei | 0:7e14d7c443f1 | 44 | SX1276MB1LAS, |
floatlei | 0:7e14d7c443f1 | 45 | UNKNOWN |
floatlei | 0:7e14d7c443f1 | 46 | }BoardType_t; |
floatlei | 0:7e14d7c443f1 | 47 | |
floatlei | 0:7e14d7c443f1 | 48 | /*! |
floatlei | 0:7e14d7c443f1 | 49 | * Radio FSK modem parameters |
floatlei | 0:7e14d7c443f1 | 50 | */ |
floatlei | 0:7e14d7c443f1 | 51 | typedef struct |
floatlei | 0:7e14d7c443f1 | 52 | { |
floatlei | 0:7e14d7c443f1 | 53 | int8_t Power; |
floatlei | 0:7e14d7c443f1 | 54 | uint32_t Fdev; |
floatlei | 0:7e14d7c443f1 | 55 | uint32_t Bandwidth; |
floatlei | 0:7e14d7c443f1 | 56 | uint32_t BandwidthAfc; |
floatlei | 0:7e14d7c443f1 | 57 | uint32_t Datarate; |
floatlei | 0:7e14d7c443f1 | 58 | uint16_t PreambleLen; |
floatlei | 0:7e14d7c443f1 | 59 | bool FixLen; |
floatlei | 0:7e14d7c443f1 | 60 | uint8_t PayloadLen; |
floatlei | 0:7e14d7c443f1 | 61 | bool CrcOn; |
floatlei | 0:7e14d7c443f1 | 62 | bool IqInverted; |
floatlei | 0:7e14d7c443f1 | 63 | bool RxContinuous; |
floatlei | 0:7e14d7c443f1 | 64 | uint32_t TxTimeout; |
floatlei | 0:7e14d7c443f1 | 65 | }RadioFskSettings_t; |
floatlei | 0:7e14d7c443f1 | 66 | |
floatlei | 0:7e14d7c443f1 | 67 | /*! |
floatlei | 0:7e14d7c443f1 | 68 | * Radio FSK packet handler state |
floatlei | 0:7e14d7c443f1 | 69 | */ |
floatlei | 0:7e14d7c443f1 | 70 | typedef struct |
floatlei | 0:7e14d7c443f1 | 71 | { |
floatlei | 0:7e14d7c443f1 | 72 | uint8_t PreambleDetected; |
floatlei | 0:7e14d7c443f1 | 73 | uint8_t SyncWordDetected; |
floatlei | 0:7e14d7c443f1 | 74 | int8_t RssiValue; |
floatlei | 0:7e14d7c443f1 | 75 | int32_t AfcValue; |
floatlei | 0:7e14d7c443f1 | 76 | uint8_t RxGain; |
floatlei | 0:7e14d7c443f1 | 77 | uint16_t Size; |
floatlei | 0:7e14d7c443f1 | 78 | uint16_t NbBytes; |
floatlei | 0:7e14d7c443f1 | 79 | uint8_t FifoThresh; |
floatlei | 0:7e14d7c443f1 | 80 | uint8_t ChunkSize; |
floatlei | 0:7e14d7c443f1 | 81 | }RadioFskPacketHandler_t; |
floatlei | 0:7e14d7c443f1 | 82 | |
floatlei | 0:7e14d7c443f1 | 83 | /*! |
floatlei | 0:7e14d7c443f1 | 84 | * Radio LoRa modem parameters |
floatlei | 0:7e14d7c443f1 | 85 | */ |
floatlei | 0:7e14d7c443f1 | 86 | typedef struct |
floatlei | 0:7e14d7c443f1 | 87 | { |
floatlei | 0:7e14d7c443f1 | 88 | int8_t Power; |
floatlei | 0:7e14d7c443f1 | 89 | uint32_t Bandwidth; |
floatlei | 0:7e14d7c443f1 | 90 | uint32_t Datarate; |
floatlei | 0:7e14d7c443f1 | 91 | bool LowDatarateOptimize; |
floatlei | 0:7e14d7c443f1 | 92 | uint8_t Coderate; |
floatlei | 0:7e14d7c443f1 | 93 | uint16_t PreambleLen; |
floatlei | 0:7e14d7c443f1 | 94 | bool FixLen; |
floatlei | 0:7e14d7c443f1 | 95 | uint8_t PayloadLen; |
floatlei | 0:7e14d7c443f1 | 96 | bool CrcOn; |
floatlei | 0:7e14d7c443f1 | 97 | bool FreqHopOn; |
floatlei | 0:7e14d7c443f1 | 98 | uint8_t HopPeriod; |
floatlei | 0:7e14d7c443f1 | 99 | bool IqInverted; |
floatlei | 0:7e14d7c443f1 | 100 | bool RxContinuous; |
floatlei | 0:7e14d7c443f1 | 101 | uint32_t TxTimeout; |
floatlei | 0:7e14d7c443f1 | 102 | }RadioLoRaSettings_t; |
floatlei | 0:7e14d7c443f1 | 103 | |
floatlei | 0:7e14d7c443f1 | 104 | /*! |
floatlei | 0:7e14d7c443f1 | 105 | * Radio LoRa packet handler state |
floatlei | 0:7e14d7c443f1 | 106 | */ |
floatlei | 0:7e14d7c443f1 | 107 | typedef struct |
floatlei | 0:7e14d7c443f1 | 108 | { |
floatlei | 0:7e14d7c443f1 | 109 | int8_t SnrValue; |
floatlei | 0:7e14d7c443f1 | 110 | int8_t RssiValue; |
floatlei | 0:7e14d7c443f1 | 111 | uint8_t Size; |
floatlei | 0:7e14d7c443f1 | 112 | }RadioLoRaPacketHandler_t; |
floatlei | 0:7e14d7c443f1 | 113 | |
floatlei | 0:7e14d7c443f1 | 114 | /*! |
floatlei | 0:7e14d7c443f1 | 115 | * Radio Settings |
floatlei | 0:7e14d7c443f1 | 116 | */ |
floatlei | 0:7e14d7c443f1 | 117 | typedef struct |
floatlei | 0:7e14d7c443f1 | 118 | { |
floatlei | 0:7e14d7c443f1 | 119 | RadioState State; |
floatlei | 0:7e14d7c443f1 | 120 | ModemType Modem; |
floatlei | 0:7e14d7c443f1 | 121 | uint32_t Channel; |
floatlei | 0:7e14d7c443f1 | 122 | RadioFskSettings_t Fsk; |
floatlei | 0:7e14d7c443f1 | 123 | RadioFskPacketHandler_t FskPacketHandler; |
floatlei | 0:7e14d7c443f1 | 124 | RadioLoRaSettings_t LoRa; |
floatlei | 0:7e14d7c443f1 | 125 | RadioLoRaPacketHandler_t LoRaPacketHandler; |
floatlei | 0:7e14d7c443f1 | 126 | }RadioSettings_t; |
floatlei | 0:7e14d7c443f1 | 127 | |
floatlei | 0:7e14d7c443f1 | 128 | |
floatlei | 0:7e14d7c443f1 | 129 | #endif //__ENUMS_H__ |