Code Monkey home page Code Monkey logo

pico-persistence's Introduction

pico-persistence

Framework to use the RP2040 flash as persistent storage. Stores data starting at offset 1.5MB (Pico has 2MB).

These function templates manipulate 4K pages of memory identified by their index (an enum defined in page_indexes.hpp) that are mapped to memory [1.5MB+index*4K, 1.5MB+(index+1)*4K[.

  • read lets you read data member with no copy
  • clone gives you a local copy of the page
  • commit will write the flash page
  • set lets you set an individual member of the page in one call (behind the scenes, it clones, modifies the local page, then commits it)

Call set if you only have one field to write. If you have several, manually clone, alter your copy then commit it, don't repeatedly call set.

The templates in functions.hpp expect an index field to be defined with the index in the page struct.

Leaving the runtime_remapping page from pico-rectangle as an example. For an example of usage in context, check pico-rectangle.

pico-persistence's People

Contributors

julienbernard3383279 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.