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