NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
system_calls_eeprom Struct Reference

#include <system_calls.h>

Data Fields

int(* read )(const struct system_calls_eeprom *self, void *dst, uint16_t addr, size_t size)
 
int(* write )(const struct system_calls_eeprom *self, uint16_t addr, const void *src, size_t size)
 
int(* erase_page )(const struct system_calls_eeprom *self, uint16_t addr)
 
void(* get_info )(const struct system_calls_eeprom *self, struct system_eeprom_info *info)
 

Detailed Description

Interface to onboard config storage eeprom. Assumption is made that there is only one config storage per aircraft instance. If a more advanced config storage interface is desired, this system interface can be changed. An eeprom is typically a paged device and for sake of being compatible with wide variety of different paged devices (including flash) the interface below is used to access the eeprom.

Field Documentation

int(* system_calls_eeprom::erase_page)(const struct system_calls_eeprom *self, uint16_t addr)

Erases a page of the eeprom. Address should be first address of the page.

void(* system_calls_eeprom::get_info)(const struct system_calls_eeprom *self, struct system_eeprom_info *info)

Returns information about the onboard eeprom such as page size and number of pages.

int(* system_calls_eeprom::read)(const struct system_calls_eeprom *self, void *dst, uint16_t addr, size_t size)

Reads a block of memory up to a page boundary. Returns number of bytes read upon success and negative number upon error.

int(* system_calls_eeprom::write)(const struct system_calls_eeprom *self, uint16_t addr, const void *src, size_t size)

Writes data to the eeprom up to a page boundary. Returns number of bytes written or a negative number upon error.


The documentation for this struct was generated from the following file: