ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
log_flash_ram.c File Reference

RAM log flash (see log_flash_ram.h). More...

#include "log_flash_ram.h"
#include <string.h>
Include dependency graph for log_flash_ram.c:

Go to the source code of this file.

Data Structures

struct  ram_t
 

Functions

static int rd (void *c, uint32_t a, void *buf, uint32_t n)
 
static int pg (void *c, uint32_t a, const void *buf, uint32_t n)
 
static int er (void *c, uint32_t a)
 
void log_flash_ram_init (log_flash_t *f, uint8_t *buf, uint32_t size)
 buf: size bytes (rounded down to whole sectors)
 

Variables

static ram_t s_ram
 

Detailed Description

RAM log flash (see log_flash_ram.h).

Definition in file log_flash_ram.c.

Function Documentation

◆ rd()

static int rd ( void *  c,
uint32_t  a,
void *  buf,
uint32_t  n 
)
static

Definition at line 11 of file log_flash_ram.c.

References ram_t::b, n, and ram_t::size.

Referenced by log_flash_ram_init().

Here is the caller graph for this function:

◆ pg()

static int pg ( void *  c,
uint32_t  a,
const void *  buf,
uint32_t  n 
)
static

Definition at line 19 of file log_flash_ram.c.

References ram_t::b, LOG_PAGE, n, and ram_t::size.

Referenced by cfg_load(), and log_flash_ram_init().

Here is the caller graph for this function:

◆ er()

static int er ( void *  c,
uint32_t  a 
)
static

Definition at line 28 of file log_flash_ram.c.

References ram_t::b, LOG_SECTOR, and ram_t::size.

Referenced by log_flash_ram_init().

Here is the caller graph for this function:

◆ log_flash_ram_init()

void log_flash_ram_init ( log_flash_t *  f,
uint8_t *  buf,
uint32_t  size 
)

buf: size bytes (rounded down to whole sectors)

Definition at line 36 of file log_flash_ram.c.

References ram_t::b, log_flash_t::ctx, er(), log_flash_t::erase, LOG_SECTOR, pg(), log_flash_t::prog, rd(), log_flash_t::read, s_ram, ram_t::size, and log_flash_t::size.

Referenced by log_flash().

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

Variable Documentation

◆ s_ram

ram_t s_ram
static

Definition at line 9 of file log_flash_ram.c.

Referenced by log_flash_ram_init().