dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_flash_posix.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdbool.h>
#include "pios_heap.h"
#include "pios_flash_posix_priv.h"
#include <pios_semaphore.h>
#include "pios_flash_priv.h"

Go to the source code of this file.

Data Structures

struct  flash_posix_dev
 

Enumerations

enum  flash_posix_magic { FLASH_POSIX_MAGIC = 0x321dabc1 }
 

Functions

static struct flash_posix_devPIOS_Flash_Posix_Alloc (void)
 
static const char * PIOS_Flash_Posix_GetFName ()
 
void PIOS_Flash_Posix_SetFName (const char *name)
 
int32_t PIOS_Flash_Posix_Init (uintptr_t *chip_id, const struct pios_flash_posix_cfg *cfg, bool force_recreate)
 
void PIOS_Flash_Posix_Destroy (uintptr_t chip_id)
 
static int32_t PIOS_Flash_Posix_StartTransaction (uintptr_t chip_id)
 
static int32_t PIOS_Flash_Posix_EndTransaction (uintptr_t chip_id)
 
static int32_t PIOS_Flash_Posix_EraseSector (uintptr_t chip_id, uint32_t chip_sector, uint32_t chip_offset)
 
static int32_t PIOS_Flash_Posix_WriteData (uintptr_t chip_id, uint32_t chip_offset, const uint8_t *data, uint16_t len)
 
static int32_t PIOS_Flash_Posix_ReadData (uintptr_t chip_id, uint32_t chip_offset, uint8_t *data, uint16_t len)
 

Variables

static const char * pios_flash_file_name = "theflash.bin"
 
const struct pios_flash_driver pios_posix_flash_driver
 

Enumeration Type Documentation

Enumerator
FLASH_POSIX_MAGIC 

Definition at line 12 of file pios_flash_posix.c.

Function Documentation

static struct flash_posix_dev* PIOS_Flash_Posix_Alloc ( void  )
static

Definition at line 24 of file pios_flash_posix.c.

void PIOS_Flash_Posix_Destroy ( uintptr_t  chip_id)

Definition at line 96 of file pios_flash_posix.c.

static int32_t PIOS_Flash_Posix_EndTransaction ( uintptr_t  chip_id)
static

Definition at line 124 of file pios_flash_posix.c.

static int32_t PIOS_Flash_Posix_EraseSector ( uintptr_t  chip_id,
uint32_t  chip_sector,
uint32_t  chip_offset 
)
static

Definition at line 135 of file pios_flash_posix.c.

static const char* PIOS_Flash_Posix_GetFName ( )
static

Definition at line 35 of file pios_flash_posix.c.

int32_t PIOS_Flash_Posix_Init ( uintptr_t *  chip_id,
const struct pios_flash_posix_cfg cfg,
bool  force_recreate 
)

Definition at line 45 of file pios_flash_posix.c.

static int32_t PIOS_Flash_Posix_ReadData ( uintptr_t  chip_id,
uint32_t  chip_offset,
uint8_t *  data,
uint16_t  len 
)
static

Definition at line 182 of file pios_flash_posix.c.

void PIOS_Flash_Posix_SetFName ( const char *  name)

Definition at line 40 of file pios_flash_posix.c.

static int32_t PIOS_Flash_Posix_StartTransaction ( uintptr_t  chip_id)
static

Definition at line 112 of file pios_flash_posix.c.

static int32_t PIOS_Flash_Posix_WriteData ( uintptr_t  chip_id,
uint32_t  chip_offset,
const uint8_t *  data,
uint16_t  len 
)
static

Definition at line 159 of file pios_flash_posix.c.

Variable Documentation

const char* pios_flash_file_name = "theflash.bin"
static

Definition at line 33 of file pios_flash_posix.c.

const struct pios_flash_driver pios_posix_flash_driver
Initial value:
= {
.start_transaction = PIOS_Flash_Posix_StartTransaction,
.end_transaction = PIOS_Flash_Posix_EndTransaction,
}
static int32_t PIOS_Flash_Posix_EndTransaction(uintptr_t chip_id)
static int32_t PIOS_Flash_Posix_EraseSector(uintptr_t chip_id, uint32_t chip_sector, uint32_t chip_offset)
static int32_t PIOS_Flash_Posix_WriteData(uintptr_t chip_id, uint32_t chip_offset, const uint8_t *data, uint16_t len)
static int32_t PIOS_Flash_Posix_StartTransaction(uintptr_t chip_id)
static int32_t PIOS_Flash_Posix_ReadData(uintptr_t chip_id, uint32_t chip_offset, uint8_t *data, uint16_t len)

Definition at line 204 of file pios_flash_posix.c.