RZT Flexible Software Package Documentation  Release v2.2.0

 
NOR Flash Interface

Detailed Description

Interface for external nor flash communication.

Summary

The NOR Flash interface provides APIs and definitions for NOR Flash communication.

Data Structures

struct  nor_flash_cfg_t
 
struct  nor_flash_status_t
 
struct  nor_flash_api_t
 

Typedefs

typedef void nor_flash_ctrl_t
 

Enumerations

enum  nor_flash_chip_select_t
 
enum  nor_flash_data_bus_width_t
 

Data Structure Documentation

◆ nor_flash_cfg_t

struct nor_flash_cfg_t

NOR Flash configuration

Data Fields
nor_flash_chip_select_t chip_select Select which device to use.
nor_flash_data_bus_width_t data_width Select data bus width.
void const * p_extend NOR Flash hardware dependent configuration.

◆ nor_flash_status_t

struct nor_flash_status_t

Status.

Data Fields
bool write_in_progress

Whether or not a write is in progress.

◆ nor_flash_api_t

struct nor_flash_api_t

NOR Flash implementations follow this API.

Data Fields

fsp_err_t(* open )(nor_flash_ctrl_t *p_ctrl, nor_flash_cfg_t const *const p_cfg)
 
fsp_err_t(* write )(nor_flash_ctrl_t *p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint32_t byte_count)
 
fsp_err_t(* erase )(nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, uint32_t byte_count)
 
fsp_err_t(* statusGet )(nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, nor_flash_status_t *const p_status)
 
fsp_err_t(* close )(nor_flash_ctrl_t *p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* nor_flash_api_t::open) (nor_flash_ctrl_t *p_ctrl, nor_flash_cfg_t const *const p_cfg)

Open the NOR Flash driver module.

Parameters
[in]p_ctrlPointer to a driver handle
[in]p_cfgPointer to a configuration structure

◆ write

fsp_err_t(* nor_flash_api_t::write) (nor_flash_ctrl_t *p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint32_t byte_count)

Program data to the flash.

Parameters
[in]p_ctrlPointer to a driver handle
[in]p_srcThe memory address of the data to write to the flash device
[in]p_destThe location in the flash device address space to write the data to
[in]byte_countThe number of bytes to write

◆ erase

fsp_err_t(* nor_flash_api_t::erase) (nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, uint32_t byte_count)

Erase a certain number of bytes of the flash.

Parameters
[in]p_ctrlPointer to a driver handle
[in]p_device_addressThe location in the flash device address space to start the erase from
[in]byte_countThe number of bytes to erase. Set to NOR_FLASH_ERASE_SIZE_CHIP_ERASE to erase entire chip.

◆ statusGet

fsp_err_t(* nor_flash_api_t::statusGet) (nor_flash_ctrl_t *p_ctrl, uint8_t *const p_device_address, nor_flash_status_t *const p_status)

Get the write or erase status of the flash.

Parameters
[in]p_ctrlPointer to a driver handle
[in]p_device_addressThe location in the flash device address space to get status
[out]p_statusCurrent status of the flash device stored here.

◆ close

fsp_err_t(* nor_flash_api_t::close) (nor_flash_ctrl_t *p_ctrl)

Close the NOR Flash driver module.

Parameters
[in]p_ctrlPointer to a driver handle

Typedef Documentation

◆ nor_flash_ctrl_t

typedef void nor_flash_ctrl_t

NOR Flash control block. Allocate an instance specific control block to pass into the NOR Flash API calls.

Enumeration Type Documentation

◆ nor_flash_chip_select_t

NOR Flash chip select.

Enumerator
NOR_FLASH_CHIP_SELECT_0 

Device connected to Chip-Select 0.

NOR_FLASH_CHIP_SELECT_1 

Device connected to Chip-Select 1.

NOR_FLASH_CHIP_SELECT_2 

Device connected to Chip-Select 2.

NOR_FLASH_CHIP_SELECT_3 

Device connected to Chip-Select 3.

NOR_FLASH_CHIP_SELECT_4 

Device connected to Chip-Select 4.

NOR_FLASH_CHIP_SELECT_5 

Device connected to Chip-Select 5.

NOR_FLASH_CHIP_SELECT_6 

Device connected to Chip-Select 6.

NOR_FLASH_CHIP_SELECT_7 

Device connected to Chip-Select 7.

◆ nor_flash_data_bus_width_t

NOR Flash data bus width.

Enumerator
NOR_FLASH_DATA_BUS_WIDTH_8BIT 

Data bus width 8bit.

NOR_FLASH_DATA_BUS_WIDTH_16BIT 

Data bus width 16bit.

NOR_FLASH_DATA_BUS_WIDTH_32BIT 

Data bus width 32bit.