Skip to content

Latest commit

 

History

History
53 lines (47 loc) · 3.81 KB

README.md

File metadata and controls

53 lines (47 loc) · 3.81 KB

💾 107-Arduino-Cyphal-Support

Arduino Library Badge Compile Examples Arduino Lint keywords.txt Checks General Formatting Checks Spell Check

This library provides support functionality for building a complete Cyphal application in combination with 107-Arduino-Cyphal.

This library works for

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));