Add nrf5 platform (#830)
* Add NVRAM support This is an EEPROM replacement based on MCU's internal Flash memory. The NVRAM class is designed to be stateless. Each operation is written to flash immediately. The last 16k(nRF51)/32k(nRF52) of Flash memory are managed by the VirtualPage class. This class allows writing a single emulated 4k page up 40,000 times. The NVRAM class is a log based byte-wise storage allowing up to 40,000,000 writes depending on the number of used addresses. Each four allocated addresses from the beginning of the NVRAM reduce the write log by one. When first 256 bytes of the emulated storage are used, there is an average writing capacity of 145,000 cycles per byte. When the write log is full, the NVRAM is compressed into a new flash page. After a new page is ready, the old page is released. This process can take up to 4500 ms and cannot be interrupted. The NVRAM functionality can easily be ported to ESP8266 or SAMD by providing a Flash interface. * Add NRF5 platform support This is the support of the Nordic Semiconductor NRF51 (nrf51822, nrf51422) and NRF52 (nrf52832) platform. Based on arduino-nRF5 (https://github.com/sandeepmistry/arduino-nRF5). The included radio driver is compatible with the NRF24 devices. Using a SoftDevice (BLE)is not supported and must be removed before flashing MySensors with a "mass_erase" operation.
This commit is contained in:
+99
@@ -94,6 +94,7 @@
|
||||
|
||||
// Selecting uplink transport layer is optional (for a gateway node).
|
||||
//#define MY_RADIO_RF24
|
||||
//#define MY_RADIO_NRF5_ESB
|
||||
//#define MY_RADIO_RFM69
|
||||
//#define MY_RADIO_RFM95
|
||||
//#define MY_RS485
|
||||
@@ -668,6 +669,100 @@
|
||||
#define MY_SOFT_SPI_MOSI_PIN (15)
|
||||
#endif
|
||||
|
||||
/**********************************
|
||||
* NRF5_ESB Driver Defaults
|
||||
* The NRF5_ESB driver is compatible
|
||||
* to RF24
|
||||
***********************************/
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_ENABLE_ENCRYPTION
|
||||
* @brief Enables RF24 compatible ncryption (all nodes and gateway must have
|
||||
* this enabled, and all must be personalized with the same AES key)
|
||||
* This is compatible to MY_RF24_ENABLE_ENCRYPTION. Because the Initialization
|
||||
* Vector is always 0, the Encryption is weak.
|
||||
*/
|
||||
//#define MY_NRF5_ESB_ENABLE_ENCRYPTION
|
||||
|
||||
/**
|
||||
* @def MY_DEBUG_VERBOSE_NRF5_ESB
|
||||
* @brief Enable MY_DEBUG_VERBOSE_NRF5_ESB flag for verbose debug prints related
|
||||
* to the NRF5_ESB driver. Requires DEBUG to be enabled.
|
||||
*/
|
||||
//#define MY_DEBUG_VERBOSE_NRF5_ESB
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_PA_LEVEL
|
||||
* @brief Default NRF5 PA level. Override in sketch if needed.
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_PA_LEVEL
|
||||
#define MY_NRF5_ESB_PA_LEVEL NRF5_PA_MAX
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_CHANNEL
|
||||
* @brief RF channel for the sensor net, 0-125.
|
||||
* Frequence: 2400 Mhz - 2525 Mhz Channels: 126
|
||||
* http://www.mysensors.org/radio/nRF24L01Plus.pdf
|
||||
* 0 => 2400 Mhz (RF24 channel 1)
|
||||
* 1 => 2401 Mhz (RF24 channel 2)
|
||||
* 76 => 2476 Mhz (RF24 channel 77)
|
||||
* 83 => 2483 Mhz (RF24 channel 84)
|
||||
* 124 => 2524 Mhz (RF24 channel 125)
|
||||
* 125 => 2525 Mhz (RF24 channel 126)
|
||||
* In some countries there might be limitations, in Germany for example only the
|
||||
* range 2400,0 - 2483,5 Mhz is allowed
|
||||
* http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2013_10_WLAN_2,4GHz_pdf.pdf
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_CHANNEL
|
||||
#define MY_NRF5_ESB_CHANNEL 76
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_MODE
|
||||
* @brief NRF5 mode (NRF5_250KBPS for 250kbs, NRF5_1MBPS for 1Mbps or NRF5_2MBPS
|
||||
* for 2Mbps).
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_MODE
|
||||
#define MY_NRF5_ESB_MODE NRF5_250KBPS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_BASE_RADIO_ID
|
||||
* @brief NRF5 radio network identifier.
|
||||
*
|
||||
* This acts as base value for sensor nodeId addresses. Change this (or channel)
|
||||
* if you have more than one sensor network.
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_BASE_RADIO_ID
|
||||
#define MY_NRF5_ESB_BASE_RADIO_ID 0x00, 0xFC, 0xE1, 0xA8, 0xA8
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_ADDR_WIDTH
|
||||
* @brief NRF5 address width.
|
||||
*
|
||||
* This defines the width of the complete address.
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_ADDR_WIDTH
|
||||
#define MY_NRF5_ESB_ADDR_WIDTH 5
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_RX_BUFFER_SIZE
|
||||
* @brief Declare the amount of incoming messages that can be buffered at driver
|
||||
* level.
|
||||
*/
|
||||
#ifndef MY_NRF5_ESB_RX_BUFFER_SIZE
|
||||
#define MY_NRF5_ESB_RX_BUFFER_SIZE (20)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def MY_NRF5_ESB_REVERSE_ACK
|
||||
* @brief Switch to SI24R1 or faked NRF24L01+ compatible ACK mode.
|
||||
*/
|
||||
//#define MY_NRF5_ESB_REVERSE_ACK
|
||||
|
||||
/**********************************
|
||||
* RFM69 Driver Defaults
|
||||
***********************************/
|
||||
@@ -1213,6 +1308,10 @@
|
||||
#define MY_RF24_ENABLE_ENCRYPTION
|
||||
#define MY_RX_MESSAGE_BUFFER_FEATURE
|
||||
#define MY_RX_MESSAGE_BUFFER_SIZE
|
||||
// NRF5_ESB
|
||||
#define MY_NRF5_ESB_ENABLE_ENCRYPTION
|
||||
#define MY_DEBUG_VERBOSE_NRF5_ESB
|
||||
#define MY_NRF5_ESB_REVERSE_ACK
|
||||
// RFM69
|
||||
#define MY_IS_RFM69HW
|
||||
#define MY_RFM69_NEW_DRIVER
|
||||
|
||||
Reference in New Issue
Block a user