SX1261 and sx1262 common library
Dependents: SX126xDevKit SX1262PingPong SX126X_TXonly SX126X_PingPong_Demo ... more
Fork of SX126xLib by
Diff: sx126x-hal.cpp
- Revision:
- 5:e488e6f185f3
- Parent:
- 4:c6ef863d0b07
- Child:
- 6:1e2345700991
--- a/sx126x-hal.cpp Mon Sep 04 15:16:44 2017 +0000 +++ b/sx126x-hal.cpp Fri Mar 09 13:19:45 2018 +0000 @@ -45,9 +45,10 @@ /*! * \brief Used to block execution to give enough time to Busy to go up + * in order to respect Tsw, see datasheet ยง8.3.1 */ #define WaitOnCounter( ) for( uint8_t counter = 0; counter < 15; counter++ ) \ - { __nop( ); } + { __NOP( ); } // This code handles cases where assert_param is undefined @@ -57,11 +58,12 @@ SX126xHal::SX126xHal( PinName mosi, PinName miso, PinName sclk, PinName nss, PinName busy, PinName dio1, PinName dio2, PinName dio3, PinName rst, - PinName deviceSelect, PinName antSwPower, RadioCallbacks_t *callbacks ) + PinName freqSel, PinName deviceSelect, PinName antSwPower, RadioCallbacks_t *callbacks ) : SX126x( callbacks ), RadioNss( nss ), RadioReset( rst ), BUSY( busy ), + FreqSelect( freqSel ), DeviceSelect( deviceSelect ), antSwitchPower( antSwPower ) { @@ -292,6 +294,11 @@ return( DeviceSelect.read( ) ); } +uint8_t SX126xHal::GetFreqSelect( void ) +{ + return( FreqSelect.read( ) ); +} + void SX126xHal::AntSwOn( void ) { antSwitchPower = 1;