OpenOCD
faux.c File Reference
Include dependency graph for faux.c:

Go to the source code of this file.

Data Structures

struct  faux_flash_bank
 

Functions

static int faux_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int faux_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static int faux_probe (struct flash_bank *bank)
 
static int faux_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
 FLASH_BANK_COMMAND_HANDLER (faux_flash_bank_command)
 

Variables

static const struct command_registration faux_command_handlers []
 
const struct flash_driver faux_flash
 
static const int sector_size = 0x10000
 

Function Documentation

◆ faux_erase()

static int faux_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)
static

Definition at line 69 of file faux.c.

References bank, ERROR_OK, info, and sector_size.

◆ faux_info()

static int faux_info ( struct flash_bank bank,
struct command_invocation cmd 
)
static

Definition at line 84 of file faux.c.

References cmd, command_print_sameline(), and ERROR_OK.

◆ faux_probe()

static int faux_probe ( struct flash_bank bank)
static

Definition at line 90 of file faux.c.

◆ faux_write()

static int faux_write ( struct flash_bank bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  count 
)
static

Definition at line 77 of file faux.c.

References bank, buffer, count, ERROR_OK, info, and offset.

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( faux_flash_bank_command  )

Variable Documentation

◆ faux_command_handlers

const struct command_registration faux_command_handlers[]
static
Initial value:
= {
{
.name = "faux",
.mode = COMMAND_ANY,
.help = "faux flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const struct command_registration hello_command_handlers[]
Export the registration for the hello command group, so it can be embedded in example drivers.
Definition: hello.c:85
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 90 of file faux.c.

◆ faux_flash

const struct flash_driver faux_flash
Initial value:
= {
.name = "faux",
.commands = faux_command_handlers,
.flash_bank_command = faux_flash_bank_command,
.erase = faux_erase,
.write = faux_write,
.probe = faux_probe,
.auto_probe = faux_probe,
.erase_check = default_flash_blank_check,
.info = faux_info,
.free_driver_priv = default_flash_free_driver_priv,
}
static int faux_probe(struct flash_bank *bank)
Definition: faux.c:90
static int faux_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: faux.c:84
static int faux_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: faux.c:77
static const struct command_registration faux_command_handlers[]
Definition: faux.c:95
static int faux_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: faux.c:69
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.

Definition at line 90 of file faux.c.

◆ sector_size

const int sector_size = 0x10000
static

Definition at line 22 of file faux.c.

Referenced by faux_erase(), FLASH_BANK_COMMAND_HANDLER(), gdb_memory_map(), and psoc6_erase().