APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ChibiOS::Storage Class Reference

#include <Storage.h>

Inheritance diagram for ChibiOS::Storage:
[legend]
Collaboration diagram for ChibiOS::Storage:
[legend]

Public Member Functions

void init ()
 
void read_block (void *dst, uint16_t src, size_t n)
 
void write_block (uint16_t dst, const void *src, size_t n)
 
void _timer_tick (void) override
 

Private Member Functions

void _storage_create (void)
 
void _storage_open (void)
 
void _mark_dirty (uint16_t loc, uint16_t length)
 
uint8_t _buffer [CH_STORAGE_SIZE__attribute__ ((aligned(4)))
 
bool _flash_write_data (uint8_t sector, uint32_t offset, const uint8_t *data, uint16_t length)
 
bool _flash_read_data (uint8_t sector, uint32_t offset, uint8_t *data, uint16_t length)
 
bool _flash_erase_sector (uint8_t sector)
 
bool _flash_erase_ok (void)
 
void _flash_load (void)
 
void _flash_write (uint16_t line)
 

Private Attributes

volatile bool _initialised
 
Bitmask _dirty_mask {CH_STORAGE_NUM_LINES}
 
uint8_t _flash_page
 
bool _flash_failed
 
uint32_t _last_re_init_ms
 
AP_FlashStorage _flash
 

Detailed Description

Definition at line 37 of file Storage.h.

Member Function Documentation

◆ __attribute__()

uint8_t _buffer [CH_STORAGE_SIZE] ChibiOS::Storage::__attribute__ ( (aligned(4))  )
private

◆ _flash_erase_ok()

bool Storage::_flash_erase_ok ( void  )
private

Definition at line 194 of file Storage.cpp.

Referenced by _flash_write_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _flash_erase_sector()

bool Storage::_flash_erase_sector ( uint8_t  sector)
private

Definition at line 186 of file Storage.cpp.

Here is the call graph for this function:

◆ _flash_load()

void Storage::_flash_load ( void  )
private

Definition at line 129 of file Storage.cpp.

Referenced by _storage_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _flash_read_data()

bool Storage::_flash_read_data ( uint8_t  sector,
uint32_t  offset,
uint8_t *  data,
uint16_t  length 
)
private

Definition at line 175 of file Storage.cpp.

Here is the call graph for this function:

◆ _flash_write()

void Storage::_flash_write ( uint16_t  line)
private

Definition at line 143 of file Storage.cpp.

Referenced by _timer_tick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _flash_write_data()

bool Storage::_flash_write_data ( uint8_t  sector,
uint32_t  offset,
const uint8_t *  data,
uint16_t  length 
)
private

Definition at line 154 of file Storage.cpp.

Here is the call graph for this function:

◆ _mark_dirty()

void Storage::_mark_dirty ( uint16_t  loc,
uint16_t  length 
)
private

Definition at line 62 of file Storage.cpp.

Referenced by write_block().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _storage_create()

void ChibiOS::Storage::_storage_create ( void  )
private

◆ _storage_open()

void Storage::_storage_open ( void  )
private

Definition at line 29 of file Storage.cpp.

Referenced by read_block(), and write_block().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _timer_tick()

void Storage::_timer_tick ( void  )
overridevirtual

Reimplemented from AP_HAL::Storage.

Definition at line 93 of file Storage.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void ChibiOS::Storage::init ( void  )
inlinevirtual

Implements AP_HAL::Storage.

Definition at line 39 of file Storage.h.

Here is the call graph for this function:

◆ read_block()

void Storage::read_block ( void *  dst,
uint16_t  src,
size_t  n 
)
virtual

Implements AP_HAL::Storage.

Definition at line 72 of file Storage.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_block()

void Storage::write_block ( uint16_t  dst,
const void *  src,
size_t  n 
)
virtual

Implements AP_HAL::Storage.

Definition at line 81 of file Storage.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _dirty_mask

Bitmask ChibiOS::Storage::_dirty_mask {CH_STORAGE_NUM_LINES}
private

Definition at line 51 of file Storage.h.

Referenced by _flash_write(), _mark_dirty(), _storage_open(), and _timer_tick().

◆ _flash

AP_FlashStorage ChibiOS::Storage::_flash
private
Initial value:
{_buffer,
stm32_flash_getpagesize(STORAGE_FLASH_PAGE),
FUNCTOR_BIND_MEMBER(&Storage::_flash_write_data, bool, uint8_t, uint32_t, const uint8_t *, uint16_t),
FUNCTOR_BIND_MEMBER(&Storage::_flash_read_data, bool, uint8_t, uint32_t, uint8_t *, uint16_t),

Definition at line 61 of file Storage.h.

Referenced by _flash_load(), _flash_write(), and _flash_write_data().

◆ _flash_failed

bool ChibiOS::Storage::_flash_failed
private

Definition at line 58 of file Storage.h.

◆ _flash_page

uint8_t ChibiOS::Storage::_flash_page
private

Definition at line 57 of file Storage.h.

Referenced by _flash_erase_sector(), _flash_load(), _flash_read_data(), and _flash_write_data().

◆ _initialised

volatile bool ChibiOS::Storage::_initialised
private

Definition at line 46 of file Storage.h.

Referenced by _storage_open(), and _timer_tick().

◆ _last_re_init_ms

uint32_t ChibiOS::Storage::_last_re_init_ms
private

Definition at line 59 of file Storage.h.

Referenced by _flash_write_data().


The documentation for this class was generated from the following files: