Defined RF pins.

Conflicts:
	libraries/radio/SX127x/sx1272/sx1272-hal.cpp
	libraries/radio/SX127x/sx1272/sx1272-hal.h
pull/1339/head
Wojciech Gorniak 2015-09-07 12:13:34 +02:00
parent feccab3e21
commit f22236b460
3 changed files with 16 additions and 41 deletions

View File

@ -166,7 +166,19 @@ typedef enum {
SPI_MOSI = D11,
SPI_MISO = D12,
SPI_SCK = D13,
SPI_CS = D10
SPI_CS = D10,
RF_SPI_MOSI = PA_7,
RF_SPI_MISO = PA_6,
RF_SPI_SCK = PA_5,
RF_SPI_CS = PA_4,
RF_RESET = PC_4,
RF_DIO0 = PC_10,
RF_DIO1 = PC_11,
RF_DIO2 = PC_12,
RF_DIO3 = PD_2,
RF_DIO4 = PB_5,
RF_DIO5 = PB_6,
RF_RXTX_SW = PC_13
} PinName;
typedef enum {

View File

@ -39,12 +39,7 @@ SX1272MB1xAS::SX1272MB1xAS( void ( *txDone )( ), void ( *txTimeout ) ( ), void (
PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5,
PinName antSwitch )
: SX1272( txDone, txTimeout, rxDone, rxTimeout, rxError, fhssChangeChannel, cadDone, mosi, miso, sclk, nss, reset, dio0, dio1, dio2, dio3, dio4, dio5),
antSwitch( antSwitch ),
#if( defined ( TARGET_NUCLEO_L152RE ) )
fake( D8 )
#else
fake( A3 )
#endif
antSwitch( antSwitch )
{
Reset( );
@ -63,35 +58,6 @@ SX1272MB1xAS::SX1272MB1xAS( void ( *txDone )( ), void ( *txTimeout ) ( ), void (
this->settings.State = IDLE ;
}
SX1272MB1xAS::SX1272MB1xAS( void ( *txDone )( ), void ( *txTimeout ) ( ), void ( *rxDone ) ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ),
void ( *rxTimeout ) ( ), void ( *rxError ) ( ), void ( *fhssChangeChannel ) ( uint8_t channelIndex ), void ( *cadDone ) ( bool ChannelActivityDetected ) )
#if defined ( TARGET_NUCLEO_L152RE )
: SX1272( txDone, txTimeout, rxDone, rxTimeout, rxError, fhssChangeChannel, cadDone, D11, D12, D13, D10, A0, D2, D3, D4, D5, A3, D9 ), // For NUCLEO L152RE dio4 is on port A3
antSwitch( A4 ),
fake( D8 )
#else
: SX1272( txDone, txTimeout, rxDone, rxTimeout, rxError, fhssChangeChannel, cadDone, D11, D12, D13, PA_4, PC_4, PC_10, PC_11, PC_12, PD_2, PB_5, PB_6 ),
antSwitch( PB_1 ),
fake( PC_2 )
#endif
{
Reset( );
RxChainCalibration( );
IoInit( );
SetOpMode( RF_OPMODE_SLEEP );
IoIrqInit( dioIrq );
RadioRegistersInit( );
SetModem( MODEM_FSK );
this->settings.State = IDLE ;
}
//-------------------------------------------------------------------------
// Board relative functions
//-------------------------------------------------------------------------

View File

@ -27,8 +27,6 @@ protected:
*/
DigitalInOut antSwitch;
DigitalIn fake;
private:
static const RadioRegisters_t RadioRegsInit[];
@ -37,9 +35,8 @@ public:
void ( *rxTimeout ) ( ), void ( *rxError ) ( ), void ( *fhssChangeChannel ) ( uint8_t channelIndex ), void ( *cadDone ) ( bool ChannelActivityDetected ),
PinName mosi, PinName miso, PinName sclk, PinName nss, PinName reset,
PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5,
PinName antSwitch );
SX1272MB1xAS( void ( *txDone )( ), void ( *txTimeout ) ( ), void ( *rxDone ) ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ),
void ( *rxTimeout ) ( ), void ( *rxError ) ( ), void ( *fhssChangeChannel ) ( uint8_t channelIndex ), void ( *cadDone ) ( bool ChannelActivityDetected ) );
PinName antSwitch );
virtual ~SX1272MB1xAS( ) { };
protected: