Skip to content

Support library for 107-Arduino-Cyphal providing permanent register storage, unique IDs, etc.

License

Notifications You must be signed in to change notification settings

107-systems/107-Arduino-Cyphal-Support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Support library for 107-Arduino-Cyphal providing permanent register storage, unique IDs, etc.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published