* 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.
101 lines
2.5 KiB
C
101 lines
2.5 KiB
C
/*
|
|
* The MySensors Arduino library handles the wireless radio link and protocol
|
|
* between your home built sensors/actuators and HA controller of choice.
|
|
* The sensors forms a self healing radio network with optional repeaters. Each
|
|
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
|
* network topology allowing messages to be routed to nodes.
|
|
*
|
|
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
|
* Copyright (C) 2013-2017 Sensnology AB
|
|
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
|
|
*
|
|
* Documentation: http://www.mysensors.org
|
|
* Support Forum: http://forum.mysensors.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* version 2 as published by the Free Software Foundation.
|
|
*/
|
|
|
|
|
|
#ifndef MyCapabilities_h
|
|
#define MyCapabilities_h
|
|
|
|
#if defined(MY_DISABLE_REMOTE_RESET)
|
|
#define MY_CAP_RESET "N"
|
|
#else
|
|
#define MY_CAP_RESET "R"
|
|
#endif
|
|
|
|
#if defined(MY_OTA_FIRMWARE_FEATURE)
|
|
#define MY_CAP_OTA_FW "O"
|
|
#else
|
|
#define MY_CAP_OTA_FW "N"
|
|
#endif
|
|
|
|
|
|
#if defined(MY_RADIO_NRF24) || defined(MY_RADIO_NRF5_ESB)
|
|
#define MY_CAP_RADIO "N"
|
|
#elif defined(MY_RADIO_RFM69)
|
|
#if !defined(MY_RFM69_NEW_DRIVER)
|
|
// old RFM69 driver
|
|
#define MY_CAP_RADIO "R"
|
|
#else
|
|
// new RFM69 driver
|
|
#define MY_CAP_RADIO "P"
|
|
#endif
|
|
#elif defined(MY_RADIO_RFM95)
|
|
#define MY_CAP_RADIO "L"
|
|
#elif defined(MY_RS485)
|
|
#define MY_CAP_RADIO "S"
|
|
#else
|
|
#define MY_CAP_RADIO "-"
|
|
#endif
|
|
|
|
#if defined(MY_GATEWAY_FEATURE)
|
|
#define MY_CAP_TYPE "G"
|
|
#elif defined(MY_REPEATER_FEATURE)
|
|
#define MY_CAP_TYPE "R"
|
|
#elif defined(MY_PASSIVE_NODE)
|
|
#define MY_CAP_TYPE "P"
|
|
#else
|
|
#define MY_CAP_TYPE "N"
|
|
#endif
|
|
|
|
#if defined(ARDUINO_ARCH_SAMD)
|
|
#define MY_CAP_ARCH "S"
|
|
#elif defined(ARDUINO_ARCH_NRF5)
|
|
#define MY_CAP_ARCH "N"
|
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
|
#define MY_CAP_ARCH "E"
|
|
#elif defined(ARDUINO_ARCH_AVR)
|
|
#define MY_CAP_ARCH "A"
|
|
#else
|
|
#define MY_CAP_ARCH "-"
|
|
#endif
|
|
|
|
#if defined(MY_SIGNING_ATSHA204)
|
|
#define MY_CAP_SIGN "A"
|
|
#elif defined(MY_SIGNING_SOFT)
|
|
#define MY_CAP_SIGN "S"
|
|
#else
|
|
#define MY_CAP_SIGN "-"
|
|
#endif
|
|
|
|
#if defined(MY_RX_MESSAGE_BUFFER_FEATURE)
|
|
#define MY_CAP_RXBUF "Q"
|
|
#else
|
|
#define MY_CAP_RXBUF "-"
|
|
#endif
|
|
|
|
#if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION)
|
|
#define MY_CAP_ENCR "X"
|
|
#else
|
|
#define MY_CAP_ENCR "-"
|
|
#endif
|
|
|
|
|
|
#define MY_CAPABILITIES MY_CAP_RESET MY_CAP_RADIO MY_CAP_OTA_FW MY_CAP_TYPE MY_CAP_ARCH MY_CAP_SIGN MY_CAP_RXBUF MY_CAP_ENCR
|
|
|
|
#endif /* MyCapabilities_h */
|