Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ FlashInfo

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

◆ FCHK

#define FCHK   4

Definition at line 64 of file settings_arch.c.

◆ FLASH_BEGIN

#define FLASH_BEGIN   0x08000000

Definition at line 62 of file settings_arch.c.

◆ FSIZ

#define FSIZ   8

Definition at line 63 of file settings_arch.c.

Function Documentation

◆ flash_detect()

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:

◆ persistent_clear()

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:

◆ persistent_read()

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:

◆ persistent_write()

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:

◆ pflash_checksum()

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:

◆ pflash_erase()

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:

◆ pflash_program_bytes()

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: