Merge pull request #275 from geeksville/post1

NRF52 / RAK815 work items
This commit is contained in:
Kevin Hester 2020-07-13 14:14:40 -07:00 committed by GitHub
commit e9be03b76c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 9 deletions

View File

@ -22,10 +22,10 @@ This software is 100% open source and developed by a group of hobbyist experimen
We currently support three models of radios. We currently support three models of radios.
- TTGO T-Beam - TTGO T-Beam (usually the recommended choice)
- [T-Beam V0.7 w/ NEO-6M](https://www.aliexpress.com/item/4000574335430.html) - [T-Beam V1.1 w/ NEO-6M - special Meshtastic version](https://www.aliexpress.com/item/4001178678568.html) (Includes built-in OLED display and they have **preinstalled** the meshtastic software)
- [T-Beam V1.0 w/ NEO-6M - special Meshtastic version](https://www.aliexpress.com/item/4001178678568.html) (Includes built-in OLED display and they have **preinstalled** the meshtastic software)
- [T-Beam V1.0 w/ NEO-M8N](https://www.aliexpress.com/item/33047631119.html) (slightly better GPS) - [T-Beam V1.0 w/ NEO-M8N](https://www.aliexpress.com/item/33047631119.html) (slightly better GPS)
- [T-Beam V0.7 w/ NEO-6M](https://www.aliexpress.com/item/4000574335430.html) (will work but **you must use the tbeam0.7 firmware ** - but the T-Beam V1.0 or later are better!)
- 3D printable cases - 3D printable cases
- [T-Beam V0](https://www.thingiverse.com/thing:3773717) - [T-Beam V0](https://www.thingiverse.com/thing:3773717)
- [T-Beam V1](https://www.thingiverse.com/thing:3830711) - [T-Beam V1](https://www.thingiverse.com/thing:3830711)

View File

@ -1,3 +1,3 @@
export VERSION=0.7.10 export VERSION=0.7.11

Binary file not shown.

View File

@ -3,9 +3,9 @@
## RAK815 ## RAK815
TODO: TODO:
* LORA: P0.23 is for PABOOST? see page 2 in RAK813 sechematic P0.22 is for HF_RF_CPS? Look up datasheet for PE4259 Until this is fixed I bet the range is quite poor. DIO2 is not controlling PABOOST on this board!
* i2c gps comms not quite right - i2c gps comms not quite right
* measure power draw - measure power draw
### Bootloader ### Bootloader

View File

@ -12,6 +12,18 @@ RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOL
// FIXME - we assume devices never get destroyed // FIXME - we assume devices never get destroyed
} }
/** Some boards require GPIO control of tx vs rx paths */
void RF95Interface::setTransmitEnable(bool txon)
{
#ifdef RF95_TXEN
digitalWrite(RF95_TXEN, txon ? 1 : 0);
#endif
#ifdef RF95_RXEN
digitalWrite(RF95_RXEN, txon ? 0 : 1);
#endif
}
/// Initialise the Driver transport hardware and software. /// Initialise the Driver transport hardware and software.
/// Make sure the Driver is properly configured before calling init(). /// Make sure the Driver is properly configured before calling init().
/// \return true if initialisation succeeded. /// \return true if initialisation succeeded.
@ -30,6 +42,22 @@ bool RF95Interface::init()
digitalWrite(RF95_TCXO, 1); digitalWrite(RF95_TCXO, 1);
#endif #endif
/*
#define RF95_TXEN (22) // If defined, this pin should be set high prior to transmit (controls an external analog switch)
#define RF95_RXEN (23) // If defined, this pin should be set high prior to receive (controls an external analog switch)
*/
#ifdef RF95_TXEN
pinMode(RF95_TXEN, OUTPUT);
digitalWrite(RF95_TXEN, 0);
#endif
#ifdef RF95_RXEN
pinMode(RF95_RXEN, OUTPUT);
digitalWrite(RF95_RXEN, 1);
#endif
setTransmitEnable(false);
int res = lora->begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength); int res = lora->begin(freq, bw, sf, cr, syncWord, power, currentLimit, preambleLength);
DEBUG_MSG("RF95 init result %d\n", res); DEBUG_MSG("RF95 init result %d\n", res);
@ -104,8 +132,18 @@ void RF95Interface::setStandby()
completeSending(); // If we were sending, not anymore completeSending(); // If we were sending, not anymore
} }
/** We override to turn on transmitter power as needed.
*/
void RF95Interface::configHardwareForSend()
{
setTransmitEnable(true);
RadioLibInterface::configHardwareForSend();
}
void RF95Interface::startReceive() void RF95Interface::startReceive()
{ {
setTransmitEnable(false);
setStandby(); setStandby();
int err = lora->startReceive(); int err = lora->startReceive();
assert(err == ERR_NONE); assert(err == ERR_NONE);

View File

@ -52,4 +52,13 @@ class RF95Interface : public RadioLibInterface
virtual void addReceiveMetadata(MeshPacket *mp); virtual void addReceiveMetadata(MeshPacket *mp);
virtual void setStandby(); virtual void setStandby();
/**
* We override to turn on transmitter power as needed.
*/
virtual void configHardwareForSend();
private:
/** Some boards require GPIO control of tx vs rx paths */
void setTransmitEnable(bool txon);
}; };

View File

@ -119,8 +119,7 @@ void SX1262Interface::addReceiveMetadata(MeshPacket *mp)
mp->rx_snr = lora.getSNR(); mp->rx_snr = lora.getSNR();
} }
/** start an immediate transmit /** We override to turn on transmitter power as needed.
* We override to turn on transmitter power as needed.
*/ */
void SX1262Interface::configHardwareForSend() void SX1262Interface::configHardwareForSend()
{ {