36 LOG_ERROR(
"no memory for flash bank info");
42 LOG_ERROR(
"no memory for flash bank info");
51 for (
unsigned int i = 0; i <
bank->num_sectors; i++) {
55 bank->sectors[i].is_erased = -1;
56 bank->sectors[i].is_protected = 0;
99 .help =
"faux flash command group",
109 .flash_bank_command = faux_flash_bank_command,
void command_print_sameline(struct command_invocation *cmd, const char *format,...)
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static const int sector_size
static int faux_probe(struct flash_bank *bank)
static int faux_info(struct flash_bank *bank, struct command_invocation *cmd)
static int faux_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
const struct flash_driver faux_flash
static const struct command_registration faux_command_handlers[]
static int faux_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command)
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.
const struct command_registration hello_command_handlers[]
Export the registration for the hello command group, so it can be embedded in example drivers.
#define LOG_ERROR(expr ...)
When run_command is called, a new instance will be created on the stack, filled with the proper value...
const char * usage
a string listing the options and arguments, required or optional
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
Describes the geometry and status of a single flash sector within a flash bank.
struct target * get_target(const char *id)
static struct ublast_lowlevel_priv info