(1) Adafruit BlueFruit library has no function to shut down BLE. Best you can do is stop advertising.
(2) Wire.end()
(3) SPI.end()
(4) Serialx.end() (for each Serial port initialized. Not sure if it works on USB port (Serial)
(5) The nRF52840 does not have WiFi
(6) Don’t use the loop to wait for events, use semaphores, timers and interrupts to handle events.
(1) Adafruit BlueFruit library has no function to shut down BLE. Best you can do is stop advertising.
I didn´t find this Adafruit BlueFruit library in the PlatformIO. Where I could find it?
Wire.end():
I need to keep I2C1 on. What is the I2C2 address?
SPI.end():
I need to keep SPI1 on. What is the SPI2 address?
Serialx.end() (for each Serial port initialized. Not sure if it works on USB port (Serial).
ok
(5) The nRF52840 does not have WiFi
ok
(6) Don’t use the loop to wait for events, use semaphores, timers and interrupts to handle events.
ok
(1) Bluefruit.Advertising.start(timeout); Set timeout to e.g. 1 second and it will stop advertising after 1 second. After that the BLE power consumption is close to zero (can’t really measure it)
(2) Wire.begin == I2C2
(3) You have only one SPI available for external usage, so it is just SPI.end().