Fork with intent to refactor and add support for American 902-928(915) Frequency Bands
Diff: sx1276/sx1276-hal.h
- Revision:
- 34:07e89f23c734
- Parent:
- 31:e50929bd3f32
diff -r 5db0d1e716b1 -r 07e89f23c734 sx1276/sx1276-hal.h --- a/sx1276/sx1276-hal.h Mon May 01 18:56:35 2017 +0200 +++ b/sx1276/sx1276-hal.h Sat May 06 11:52:23 2017 +0200 @@ -12,6 +12,13 @@ Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin */ + +/* + * additional development to make it more generic across multiple os versions + * (c) 2017 Helmut Tschemernjak + * 30826 Garbsen (Hannover) Germany + */ + #ifndef __SX1276_HAL_H__ #define __SX1276_HAL_H__ #include "sx1276.h" @@ -44,36 +51,55 @@ /*! * Actual implementation of a SX1276 radio, includes some modifications to make it compatible with the MB1 LAS board */ -class SX1276MB1xAS : public SX1276 +class SX1276Generic : public SX1276 { protected: /*! * Antenna switch GPIO pins objects */ - DigitalInOut AntSwitch; -#ifdef MURATA_ANT_SWITCH - DigitalInOut AntSwitchTX; - DigitalInOut AntSwitchTXBoost; -#endif + DigitalInOut *_antSwitch; + DigitalInOut *_antSwitchTX; + DigitalInOut *_antSwitchTXBoost; + + /*! + * SX1276 Reset pin + */ + DigitalInOut *_reset; + + /*! + * TCXO being used with the Murata Module + */ + DigitalOut *_tcxo; - DigitalIn Fake; - + /*! + * SPI Interface + */ + SPI *_spi; // mosi, miso, sclk + DigitalOut *_nss; + + /*! + * SX1276 DIO pins + */ + InterruptIn *_dio0; + InterruptIn *_dio1; + InterruptIn *_dio2; + InterruptIn *_dio3; + InterruptIn *_dio4; + DigitalIn *_dio5; + private: static const RadioRegisters_t RadioRegsInit[]; public: - SX1276MB1xAS( RadioEvents_t *events, + SX1276Generic( RadioEvents_t *events, BoardType_t board, PinName mosi, PinName miso, PinName sclk, PinName nss, PinName reset, PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5, -#ifdef MURATA_ANT_SWITCH - PinName antSwitch, PinName antSwitchTX, PinName antSwitchTXBoost); -#else - PinName antSwitch ); -#endif + PinName antSwitch = NC, PinName antSwitchTX= NC, PinName antSwitchTXBoost = NC, PinName tcxo = NC); - SX1276MB1xAS( RadioEvents_t *events ); + + SX1276Generic( RadioEvents_t *events ); - virtual ~SX1276MB1xAS( ) { }; + virtual ~SX1276Generic(); protected: /*!