This library provides support functionality for building a complete Cyphal application in combination with 107-Arduino-Cyphal.
This library works for
- arduino-pico:
Raspberry Pi Pico
,Adafruit Feather RP2040
, ... ✔️ - ArduinoCore-renesas:
Portenta C33
,Uno R4 WiFi
,Uno R4 Minima
, ... ✔️
Features:
- API for obtaining a unique 64-bit ID.
auto /* std::array<uint8_t, 16> */ const UNIQUE_ID = cyphal::support::UniqueId::instance().value();
- API for persistent register storage and retrieval.
/* Declaration of key/value storage. */
cyphal::support::platform::storage::littlefs::KeyValueStorage kv_storage(filesystem);
/* Load persistently stored registers from a non-volatile memory (EEPROM, flash, etc.). */
if (auto const opt_err = cyphal::support::load(kv_storage, *node_registry); opt_err.has_value())
{
Serial.print("load failed with error code ");
Serial.println(static_cast<int>(opt_err.value()));
}
/* Store persistent registers to a non-volatile memory (EEPROM, flash, etc.). */
if (auto const opt_err = cyphal::support::save(kv_storage, *node_registry); opt_err.has_value())
{
Serial.print("save failed with error code ");
Serial.println(static_cast<int>(opt_err.value()));
}
- API for performing synchronous and asynchronous resets.
/* Synchronous reset: */
cyphal::support::platform::reset_sync(std::chrono::milliseconds(5000));
/* Asynchronous reset: */
cyphal::support::platform::reset_async(std::chrono::milliseconds(5000));