test
Dependents: Telemetria_RX_SD_GPS_copy Telemetria_RX_SD_GPS Telemetria_TX Telemetria_TX ... more
Diff: sx1276/sx1276.h
- Revision:
- 38:d9189d958db8
- Parent:
- 34:07e89f23c734
- Child:
- 39:706c32eda7e7
--- a/sx1276/sx1276.h Sat May 06 12:12:29 2017 +0000 +++ b/sx1276/sx1276.h Sun May 07 18:09:10 2017 +0200 @@ -14,7 +14,7 @@ */ /* - * additional development to make it more generic across multiple os versions + * additional development to make it more generic across multiple OS versions * (c) 2017 Helmut Tschemernjak * 30826 Garbsen (Hannover) Germany */ @@ -25,7 +25,11 @@ #include "radio.h" #include "./registers/sx1276Regs-Fsk.h" #include "./registers/sx1276Regs-LoRa.h" -#include "./typedefs/typedefs.h" + +class SX1276; +class SX1276Generic; + + /*! * Radio wake-up time from sleep @@ -68,6 +72,33 @@ #endif +/*! + * FSK bandwidth definition + */ +typedef struct +{ + uint32_t bandwidth; + uint8_t RegValue; +}FskBandwidth_t; + + + +/*! + * Radio registers definition + */ +typedef struct +{ + ModemType Modem; + uint8_t Addr; + uint8_t Value; +}RadioRegisters_t; + +/*! + * Hardware IO IRQ callback function definition + */ +typedef void ( SX1276::*DioIrqHandler )( void ); + + typedef enum { LORA_BANKWIDTH_7kHz = 0, // 7.8 kHz requires TCXO LORA_BANKWIDTH_10kHz = 1, // 10.4 kHz requires TCXO @@ -141,6 +172,7 @@ RadioSettings_t settings; static const FskBandwidth_t FskBandwidths[]; + protected: /*! @@ -163,6 +195,12 @@ * @param [IN] events Structure containing the driver callback functions */ virtual void Init( RadioEvents_t *events ); + + /*! + * @brief Initializes the radio registers + */ + virtual void RadioRegistersInit(void); + /*! * Return current radio status * @@ -285,6 +323,7 @@ bool fixLen, bool crcOn, bool freqHopOn, uint8_t hopPeriod, bool iqInverted, uint32_t timeout ); + /*! * @brief Checks if the given RF frequency is supported by the hardware * @@ -435,7 +474,9 @@ //------------------------------------------------------------------------- // Board relative functions //------------------------------------------------------------------------- - + static const RadioRegisters_t RadioRegsInit[]; +private: + protected: /*! * @brief Initializes the radio I/Os pins interface @@ -443,11 +484,6 @@ virtual void IoInit( void ) = 0; /*! - * @brief Initializes the radio registers - */ - virtual void RadioRegistersInit( ) = 0; - - /*! * @brief Initializes the radio SPI */ virtual void SpiInit( void ) = 0; @@ -509,6 +545,12 @@ */ virtual void SetAntSw( uint8_t opMode ) = 0; + /* + * The the Timeout for a given Timer. + */ + virtual void SetTimeout(Timeout_t timer, int timeout_ms) = 0; + + protected: /*!