flash 2.0.0.0
|
Functions | |
void | flash_cfg_setup (flash_cfg_t *cfg) |
Config Object Setup function. | |
flash_err_t | flash_init (flash_t *ctx, flash_cfg_t *cfg) |
Click Initialization function. | |
void | flash_default_cfg (flash_t *ctx) |
Click Default Configuration function. | |
void | flash_reset (flash_t *ctx) |
Reset function. | |
void | flash_write_enable (flash_t *ctx) |
Write Enable function. | |
void | flash_write_disable (flash_t *ctx) |
Write Disable function. | |
void | flash_write_status (flash_t *ctx, uint8_t data_tx) |
Status Write function. | |
uint8_t | flash_read_status (flash_t *ctx) |
Status Read function. | |
void | flash_read_id (flash_t *ctx, uint8_t *manufact_id, uint16_t *dev_id) |
ID Read function. | |
flash_err_t | flash_write_byte (flash_t *ctx, uint32_t mem_addr, uint8_t data_tx) |
Byte Write function. | |
flash_err_t | flash_read_byte (flash_t *ctx, uint32_t mem_addr, uint8_t *data_rx) |
Byte Read function. | |
flash_err_t | flash_write_page (flash_t *ctx, uint32_t mem_addr, uint8_t *data_tx, uint16_t n_data) |
Page Write function. | |
flash_err_t | flash_read_page (flash_t *ctx, uint32_t mem_addr, uint8_t *data_rx, uint16_t n_data) |
Page Read function. | |
void | flash_erase_chip (flash_t *ctx) |
Chip Erase function. | |
flash_err_t | flash_erase_block (flash_t *ctx, uint32_t mem_addr) |
Block Erase function. | |
flash_err_t | flash_erase_half_block (flash_t *ctx, uint32_t mem_addr) |
Half Block Erase function. | |
flash_err_t | flash_erase_sector (flash_t *ctx, uint32_t mem_addr) |
Sector Erase function. | |
void | flash_set_write_protect_pin (flash_t *ctx, flash_pin_state_t state) |
WP Pin Set function. | |
void | flash_set_hold_pin (flash_t *ctx, flash_pin_state_t state) |
HLD Pin Set function. | |
void flash_cfg_setup | ( | flash_cfg_t * | cfg | ) |
Config Object Setup function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to initial state.
void flash_default_cfg | ( | flash_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Flash click.
flash_err_t flash_erase_block | ( | flash_t * | ctx, |
uint32_t | mem_addr ) |
Block Erase function.
ctx | Click object. |
mem_addr | Memory address. |
@description This function sets to 1 (FFh) all bits inside the chosen block.
void flash_erase_chip | ( | flash_t * | ctx | ) |
Chip Erase function.
ctx | Click object. |
@description This function sets all bits to 1 (FFh).
flash_err_t flash_erase_half_block | ( | flash_t * | ctx, |
uint32_t | mem_addr ) |
Half Block Erase function.
ctx | Click object. |
mem_addr | Memory address. |
@description This function sets to 1 (FFh) all bits inside the chosen block of memory.
flash_err_t flash_erase_sector | ( | flash_t * | ctx, |
uint32_t | mem_addr ) |
Sector Erase function.
ctx | Click object. |
mem_addr | Memory address. |
@description This function sets to 1 (FFh) all bits inside the chosen sector.
flash_err_t flash_init | ( | flash_t * | ctx, |
flash_cfg_t * | cfg ) |
Click Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
flash_err_t flash_read_byte | ( | flash_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_rx ) |
Byte Read function.
ctx | Click object. |
mem_addr | Memory address. |
data_rx | Data which was read. |
@description This function reads one byte data from the selected memory address.
void flash_read_id | ( | flash_t * | ctx, |
uint8_t * | manufact_id, | ||
uint16_t * | dev_id ) |
ID Read function.
ctx | Click object. |
manufact_id | Manufacturer identification. |
dev_id | Device identification. |
@description This function reads one byte of manufacturer identification and two bytes of device identification.
flash_err_t flash_read_page | ( | flash_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_rx, | ||
uint16_t | n_data ) |
Page Read function.
ctx | Click object. |
mem_addr | Memory address. |
data_rx | Data which was read. |
n_data | Number of bytes to be read. |
@description This function allows memory to be read up to 256 bytes, starting from the selected memory address.
uint8_t flash_read_status | ( | flash_t * | ctx | ) |
Status Read function.
ctx | Click object. |
@description This function reads Status register.
void flash_reset | ( | flash_t * | ctx | ) |
Reset function.
ctx | Click object. |
@description This function is used as a system (software) reset that puts the device in normal operating Ready mode.
void flash_set_hold_pin | ( | flash_t * | ctx, |
flash_pin_state_t | state ) |
HLD Pin Set function.
ctx | Click object. |
state | The desired pin state to be set. (active low) |
@description This function sets the HLD pin to the desired state.
void flash_set_write_protect_pin | ( | flash_t * | ctx, |
flash_pin_state_t | state ) |
WP Pin Set function.
ctx | Click object. |
state | The desired pin state to be set. (active low) |
@description This function sets the WP pin to the desired state.
flash_err_t flash_write_byte | ( | flash_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t | data_tx ) |
Byte Write function.
ctx | Click object. |
mem_addr | Memory address. |
data_tx | Data to be written. |
@description This function writes one byte data to the selected memory address.
void flash_write_disable | ( | flash_t * | ctx | ) |
Write Disable function.
ctx | Click object. |
@description This function will reset the Write Enable Latch to protect the memory programming, status register writing and chip/sector erasing.
void flash_write_enable | ( | flash_t * | ctx | ) |
Write Enable function.
ctx | Click object. |
@description This function sets the Write Enable Latch to allow user to execute memory programming, status register writing and chip/sector erasing.
flash_err_t flash_write_page | ( | flash_t * | ctx, |
uint32_t | mem_addr, | ||
uint8_t * | data_tx, | ||
uint16_t | n_data ) |
Page Write function.
ctx | Click object. |
mem_addr | Memory address. |
data_tx | Data to be written. |
n_data | Number of bytes to be written. |
@description This function allows memory to be programmed up to 256 bytes, starting from the selected memory address.
void flash_write_status | ( | flash_t * | ctx, |
uint8_t | data_tx ) |
Status Write function.
ctx | Click object. |
data_tx | Data to be written. |
@description This function writes one byte to Status register.