Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
settings_arch.c File Reference
#include "subsystems/settings.h"
#include <libopencm3/stm32/flash.h>
#include <libopencm3/stm32/crc.h>
#include <libopencm3/stm32/dbgmcu.h>
+ Include dependency graph for settings_arch.c:

Go to the source code of this file.

Data Structures

struct  FlashInfo
 

Macros

#define FLASH_BEGIN   0x08000000
 
#define FSIZ   8
 
#define FCHK   4
 

Functions

static uint32_t pflash_checksum (uint32_t ptr, uint32_t size)
 
static int32_t flash_detect (struct FlashInfo *flash)
 
static int32_t pflash_program_bytes (struct FlashInfo *flash, uint32_t src, uint32_t size, uint32_t chksum)
 
static int32_t pflash_erase (struct FlashInfo *flash)
 
int32_t persistent_write (void *ptr, uint32_t size)
 
int32_t persistent_read (void *ptr, uint32_t size)
 
int32_t persistent_clear (void)
 

Data Structure Documentation

struct FlashInfo

Definition at line 65 of file settings_arch.c.

Data Fields
uint32_t addr
uint32_t page_nr
uint32_t page_size
uint32_t total_size

Macro Definition Documentation

#define FCHK   4

Definition at line 64 of file settings_arch.c.

Referenced by persistent_read(), and pflash_program_bytes().

#define FLASH_BEGIN   0x08000000

Definition at line 62 of file settings_arch.c.

Referenced by flash_detect().

#define FSIZ   8

Definition at line 63 of file settings_arch.c.

Referenced by persistent_read(), persistent_write(), and pflash_program_bytes().

Function Documentation

static int32_t flash_detect ( struct FlashInfo flash)
static

Definition at line 110 of file settings_arch.c.

References FlashInfo::addr, FLASH_BEGIN, FlashInfo::page_nr, FlashInfo::page_size, and FlashInfo::total_size.

Referenced by persistent_clear(), persistent_read(), and persistent_write().

+ Here is the caller graph for this function:

int32_t persistent_clear ( void  )

Definition at line 314 of file settings_arch.c.

References flash_detect(), PERSISTENT_SETTINGS_FILE, and pflash_erase().

+ Here is the call graph for this function:

int32_t persistent_read ( void *  ptr,
uint32_t  size 
)

Definition at line 290 of file settings_arch.c.

References FlashInfo::addr, FCHK, flash_detect(), FSIZ, FlashInfo::page_size, and pflash_checksum().

+ Here is the call graph for this function:

int32_t persistent_write ( void *  ptr,
uint32_t  size 
)

Definition at line 278 of file settings_arch.c.

References flash_detect(), FSIZ, FlashInfo::page_size, pflash_checksum(), and pflash_program_bytes().

+ Here is the call graph for this function:

static uint32_t pflash_checksum ( uint32_t  ptr,
uint32_t  size 
)
static

Definition at line 67 of file settings_arch.c.

Referenced by persistent_read(), and persistent_write().

+ Here is the caller graph for this function:

static int32_t pflash_erase ( struct FlashInfo flash)
static

Definition at line 213 of file settings_arch.c.

References FlashInfo::addr, FlashInfo::page_nr, and FlashInfo::page_size.

Referenced by persistent_clear(), and pflash_program_bytes().

+ Here is the caller graph for this function:

static int32_t pflash_program_bytes ( struct FlashInfo flash,
uint32_t  src,
uint32_t  size,
uint32_t  chksum 
)
static

Definition at line 236 of file settings_arch.c.

References FlashInfo::addr, FCHK, FSIZ, FlashInfo::page_size, and pflash_erase().

Referenced by persistent_write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: