RAK4631 is almost feature complete

1.2-legacy
Kevin Hester 2021-04-12 13:25:55 +08:00
rodzic 7224782d23
commit 55b38a7b02
7 zmienionych plików z 36 dodań i 41 usunięć

Wyświetl plik

@ -4,13 +4,17 @@
https://docs.rakwireless.com/Product-Categories/WisBlock/Quickstart/#wisblock-base-2 https://docs.rakwireless.com/Product-Categories/WisBlock/Quickstart/#wisblock-base-2
FIXME - list required, recommended and optional components
GPS module: GPS module:
Supposedly "Install in slot A only" but I think installing on the back would fit better with the OLED. FIXME. Supposedly "Install in slot A only" but I think installing on the back would fit better with the OLED. FIXME.
https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1910/Overview/#product-description https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1910/Overview/#product-description
ST KPS22HB ST LPS22HB
baro sensor baro & temp sensor, i2c address 0x5c
https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1902/Overview/#product-description https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1902/Overview/#product-description
https://www.st.com/en/mems-and-sensors/lps22hb.html
https://www.st.com/resource/en/datasheet/lps22hb.pdf
OLED OLED
https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1921/Overview/#product-features https://docs.rakwireless.com/Product-Categories/WisBlock/RAK1921/Overview/#product-features
@ -27,29 +31,17 @@ https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/#spec
## TODO ## TODO
* Turn off external 3V3 supply when not using GPS to save power!
> 3V3_S is another 3.3 V power supply, it can be controlled by the MCU in order to disconnect the power sensors during idle periods to save power. 3V3_S is controlled by IO2 pin on the WisBlock Core board. > 3V3_S is another 3.3 V power supply, it can be controlled by the MCU in order to disconnect the power sensors during idle periods to save power. 3V3_S is controlled by IO2 pin on the WisBlock Core board.
Set IO2=1, 3V3_S is on. Set IO2=1, 3V3_S is on.
Set IO2=0, 3V3_S is off. Set IO2=0, 3V3_S is off.
* DONE solder header
* DONE attach antenna
* get building (LORA disabled)
* DONE FIX LEDs
* DONE FIX BUTTONs
* DONE FIX I2C assignment
* FIX LORA SPI
* FIX GPS GPIO assignment
* Disable Bluetooth
* Disable LORA
* Boot
* Enable LORA but no TX
* Enable LORA TX
* Enable bluetooth * Enable bluetooth
* Relase as standard part of build (including UF2s) * Relase as standard part of build (including UF2s)
* Make this doc into a nice HOWTO: what to order, how to connect (which device in which slots), how to install software * Make this doc into a nice HOWTO: what to order, how to connect (which device in which slots), how to install software
* Setup battery voltage sensing * Setup battery voltage sensing
* Set bluetooth PIN support * Set bluetooth PIN support
* Confirm low power draw * Confirm low power draw
* Confirm that OLED works
* send in PR to https://github.com/geeksville/WisBlock for boards define * send in PR to https://github.com/geeksville/WisBlock for boards define
* *

2
proto

@ -1 +1 @@
Subproject commit ff66c549498052a1a3cf75f8ad1a66a4adcdc413 Subproject commit 6e05f72a1a75322bcbea21980386a61b2945fd4f

Wyświetl plik

@ -409,6 +409,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define HW_VENDOR HardwareModel_PPR #define HW_VENDOR HardwareModel_PPR
#elif defined(RAK4630)
#define HW_VENDOR HardwareModel_RAK4631
#elif NRF52_SERIES #elif NRF52_SERIES
#define HW_VENDOR HardwareModel_NRF52_UNKNOWN #define HW_VENDOR HardwareModel_NRF52_UNKNOWN

Wyświetl plik

@ -427,11 +427,12 @@ void setup()
readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time) readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time)
#ifdef GENIEBLOCKS #ifdef GENIEBLOCKS
I'm intentionally breaking your build so you see this note. Feel free to revert if not correct. I think you can Im intentionally breaking your build so you see this note.Feel free to revert if not correct.I think you can
removed this code by instead defining PIN_GPS_RESET and use the shared code in GPS.cpp instead. remove this GPS_RESET_N code by instead defining PIN_GPS_RESET and
use the shared code in GPS.cpp instead.- geeksville
// gps setup // gps setup
pinMode(GPS_RESET_N, OUTPUT); pinMode(GPS_RESET_N, OUTPUT);
pinMode(GPS_EXTINT, OUTPUT); pinMode(GPS_EXTINT, OUTPUT);
digitalWrite(GPS_RESET_N, HIGH); digitalWrite(GPS_RESET_N, HIGH);
digitalWrite(GPS_EXTINT, LOW); digitalWrite(GPS_EXTINT, LOW);

Wyświetl plik

@ -21,6 +21,7 @@ typedef enum _HardwareModel {
HardwareModel_TBEAM0p7 = 6, HardwareModel_TBEAM0p7 = 6,
HardwareModel_T_ECHO = 7, HardwareModel_T_ECHO = 7,
HardwareModel_TLORA_V1_1p3 = 8, HardwareModel_TLORA_V1_1p3 = 8,
HardwareModel_RAK4631 = 9,
HardwareModel_LORA_RELAY_V1 = 32, HardwareModel_LORA_RELAY_V1 = 32,
HardwareModel_NRF52840DK = 33, HardwareModel_NRF52840DK = 33,
HardwareModel_PPR = 34, HardwareModel_PPR = 34,

Wyświetl plik

@ -44,10 +44,23 @@ void getMacAddr(uint8_t *dmac)
} }
} }
static void initBrownout()
{
auto vccthresh = POWER_POFCON_THRESHOLD_V17;
auto err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled);
assert(err_code == NRF_SUCCESS);
err_code = sd_power_pof_threshold_set(vccthresh);
assert(err_code == NRF_SUCCESS);
// We don't bother with setting up brownout if soft device is disabled - because during production we always use softdevice
}
NRF52Bluetooth *nrf52Bluetooth; NRF52Bluetooth *nrf52Bluetooth;
static bool bleOn = false; static bool bleOn = false;
static const bool useSoftDevice = false; // Set to false for easier debugging static const bool useSoftDevice = true; // Set to false for easier debugging
void setBluetoothEnable(bool on) void setBluetoothEnable(bool on)
{ {
@ -59,6 +72,9 @@ void setBluetoothEnable(bool on)
else { else {
nrf52Bluetooth = new NRF52Bluetooth(); nrf52Bluetooth = new NRF52Bluetooth();
nrf52Bluetooth->setup(); nrf52Bluetooth->setup();
// We delay brownout init until after BLE because BLE starts soft device
initBrownout();
} }
} }
} else { } else {
@ -81,20 +97,6 @@ int printf(const char *fmt, ...)
return res; return res;
} }
void initBrownout()
{
auto vccthresh = POWER_POFCON_THRESHOLD_V17;
if (useSoftDevice) {
auto err_code = sd_power_pof_enable(POWER_POFCON_POF_Enabled);
assert(err_code == NRF_SUCCESS);
err_code = sd_power_pof_threshold_set(vccthresh);
assert(err_code == NRF_SUCCESS);
}
// We don't bother with setting up brownout if soft device is disabled - because during production we always use softdevice
}
void checkSDEvents() void checkSDEvents()
{ {
if (useSoftDevice) { if (useSoftDevice) {
@ -147,8 +149,6 @@ void nrf52Setup()
// randomSeed(r); // randomSeed(r);
DEBUG_MSG("FIXME, call randomSeed\n"); DEBUG_MSG("FIXME, call randomSeed\n");
// ::printf("TESTING PRINTF\n"); // ::printf("TESTING PRINTF\n");
initBrownout();
} }
void cpuDeepSleep(uint64_t msecToWake) void cpuDeepSleep(uint64_t msecToWake)

Wyświetl plik

@ -171,9 +171,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define GPS_RX_PIN PIN_SERIAL1_RX #define GPS_RX_PIN PIN_SERIAL1_RX
#define GPS_TX_PIN PIN_SERIAL1_TX #define GPS_TX_PIN PIN_SERIAL1_TX
// Meshtastic specific flags
#define USE_SEGGER
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif