Driver for the SX1280 RF Transceiver
Dependents: SX1280PingPong RangignMaster RangingSlave MSNV2-Terminal_V1-6 ... more
Diff: sx1280-hal.cpp
- Revision:
- 12:c4f110f3fe3e
- Parent:
- 11:d60df50e108f
diff -r d60df50e108f -r c4f110f3fe3e sx1280-hal.cpp --- a/sx1280-hal.cpp Wed Jul 18 08:48:34 2018 +0000 +++ b/sx1280-hal.cpp Thu Nov 08 10:08:44 2018 +0000 @@ -153,24 +153,6 @@ { RadioUart->format( 9, SerialBase::Even, 1 ); // 8 data bits + 1 even parity bit + 1 stop bit RadioUart->baud( 115200 ); - - // By default the SX1280 UART is setup to handle bytes MSB first. - // In order to setup the radio to use the UART standard way we first send - // the equivalent of a WriteRegister with reversed bit order in order to - // change the endianness. - uint8_t regVal = 0; - RadioUart->putc( 0x98 ); // Reversed opcode for read register (0x19) - RadioUart->putc( 0x10 ); // Reversed MSB register address (0x08) - RadioUart->putc( 0x18 ); // Reversed LSB register address (0x18) - RadioUart->putc( 0x80 ); // Reversed value for reading only 1 byte (0x01) - regVal = RadioUart->getc( )& 0xF3; // Read reversed value and mask it - - RadioUart->putc( 0x18 ); // Reversed opcode for read register (0x18) - RadioUart->putc( 0x10 ); // Reversed MSB register address (0x08) - RadioUart->putc( 0x18 ); // Reversed LSB register address (0x18) - RadioUart->putc( 0x80 ); // Reversed value for writing only 1 byte (0x01) - RadioUart->putc( regVal ); // The new value of the register - // After this point, the UART is running standard mode: 8 data bit, 1 even // parity bit, 1 stop bit, 115200 baud, LSB first wait_us( 10 );