PMSIS BSP
|
Content | |
Hyperflash | |
Data Structures | |
struct | pi_flash_conf |
Flash configuration structure. More... | |
struct | pi_flash_info |
Parameter for FLASH_IOCTL_INFO command. More... | |
Enumerations | |
enum | pi_flash_ioctl_e |
Command ID for pi_flash_ioctl. More... | |
Functions | |
int | pi_flash_open (struct pi_device *device) |
Open a flash device. More... | |
static void | pi_flash_close (struct pi_device *device) |
Close an opened flash device. More... | |
static int32_t | pi_flash_ioctl (struct pi_device *device, uint32_t cmd, void *arg) |
Control device. More... | |
static void | pi_flash_reg_set (struct pi_device *device, uint32_t reg_addr, uint8_t *value) |
Set flash register. More... | |
static void | pi_flash_reg_get (struct pi_device *device, uint32_t reg_addr, uint8_t *value) |
Get flash register. More... | |
static void | pi_flash_reg_set_async (struct pi_device *device, uint32_t reg_addr, uint8_t *value, pi_task_t *task) |
Set flash register asynchronously. More... | |
static void | pi_flash_reg_get_async (struct pi_device *device, uint32_t reg_addr, uint8_t *value, pi_task_t *task) |
Get flash register asynchronously. More... | |
static void | pi_flash_read (struct pi_device *device, uint32_t pi_flash_addr, void *data, uint32_t size) |
Enqueue a read copy to the flash (from flash to processor). More... | |
static void | pi_flash_program (struct pi_device *device, uint32_t pi_flash_addr, const void *data, uint32_t size) |
Enqueue a write copy to the flash (from processor to flash). More... | |
static void | pi_flash_erase_chip (struct pi_device *device) |
Erase the whole flash. More... | |
static void | pi_flash_erase_sector (struct pi_device *device, uint32_t pi_flash_addr) |
Erase a sector. More... | |
static void | pi_flash_erase (struct pi_device *device, uint32_t pi_flash_addr, int size) |
Erase an area in the flash. More... | |
static void | pi_flash_read_async (struct pi_device *device, uint32_t pi_flash_addr, void *data, uint32_t size, pi_task_t *task) |
Enqueue an asynchronous read copy to the flash (from flash to processor). More... | |
static void | pi_flash_program_async (struct pi_device *device, uint32_t pi_flash_addr, const void *data, uint32_t size, pi_task_t *task) |
Enqueue an asynchronous write copy to the flash (from processor to flash). More... | |
static void | pi_flash_erase_chip_async (struct pi_device *device, pi_task_t *task) |
Erase the whole flash asynchronously. More... | |
static void | pi_flash_erase_sector_async (struct pi_device *device, uint32_t pi_flash_addr, pi_task_t *task) |
Erase a sector asynchronously. More... | |
static void | pi_flash_erase_async (struct pi_device *device, uint32_t pi_flash_addr, int size, pi_task_t *task) |
Erase an area in the flash asynchronously. More... | |
The flash driver provides support for transferring data between an external flash chip (e.g. Hyperflash or SPI flash) and the processor running this driver.
enum pi_flash_ioctl_e |
Enumerator | |
---|---|
PI_FLASH_IOCTL_INFO |
Command for getting flash information. The argument must be a pointer to a variable of type struct pi_flash_info so that the call is returning information there. |
|
inlinestatic |
This function can be called to close an opened flash device once it is not needed anymore, in order to free all allocated resources. Once this function is called, the device is not accessible anymore and must be opened again before being used.
device | The device structure of the device to close. |
|
inlinestatic |
This will erase the specified area. The duration of this operation may be long and may be retrieved from the datasheet. If the flash only supports sector erasing, all the sectors partially or entirely covered by this aread will be erased. The caller is blocked until the operation is finished.
device | The device descriptor of the flash chip on which to do the operation. |
pi_flash_addr | The address of the area to be erased. |
size | The size of the area to be erased. |
|
inlinestatic |
This will erase the specified area. The duration of this operation may be long and may be retrieved from the datasheet. If the flash only supports sector erasing, all the sectors partially or entirely covered by this aread will be erased. A task must be specified in order to specify how the caller should be notified when the transfer is finished.
device | The device descriptor of the flash chip on which to do the operation. |
pi_flash_addr | The address of the area to be erased. |
size | The size of the area to be erased. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
This will erase the entire flash. The duration of this operation may be long and may be retrieved from the datasheet. The caller is blocked until the operation is finished.
device | The device descriptor of the flash chip on which to do the operation. |
|
inlinestatic |
This will erase the entire flash. The duration of this operation may be long and may be retrieved from the datasheet. A task must be specified in order to specify how the caller should be notified when the transfer is finished.
device | The device descriptor of the flash chip on which to do the operation. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
This will erase one sector. The duration of this operation may be long and may be retrieved from the datasheet. The caller is blocked until the operation is finished.
device | The device descriptor of the flash chip on which to do the operation. |
pi_flash_addr | The address of the sector to be erased. |
|
inlinestatic |
This will erase one sector. The duration of this operation may be long and may be retrieved from the datasheet. A task must be specified in order to specify how the caller should be notified when the transfer is finished.
device | The device descriptor of the flash chip on which to do the operation. |
pi_flash_addr | The address of the sector to be erased. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
This can be called to configure and control the device after it has been opened.
device | The device structure of the device to control. |
cmd | The command to execute on the device. |
arg | The argument to the command. The size and meaning of this parameter depends on the command which is passed. |
int pi_flash_open | ( | struct pi_device * | device | ) |
This function must be called before the flash device can be used. It will do all the needed configuration to make it usable and initialize the handle used to refer to this opened device when calling other functions. The configuration associated to the device must specify the exact model of flash which must be opened.
device | A pointer to the device structure of the device to open. This structure is allocated by the called and must be kept alive until the device is closed. |
|
inlinestatic |
The copy will make a write transfer from one of the processor memory areas to the flash. The locations in the flash being written should have first been erased. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
device | The device descriptor of the flash chip on which to do the copy. |
pi_flash_addr | The address of the copy in the flash. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy |
|
inlinestatic |
The copy will make a write transfer from one of the processor memory areas to the flash. The locations in the flash being written should have first been erased. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
device | The device descriptor of the flash chip on which to do the copy. |
pi_flash_addr | The address of the copy in the flash. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
The copy will make a transfer between the flash and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
device | The device descriptor of the flash chip on which to do the copy. |
pi_flash_addr | The address of the copy in the flash. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy |
|
inlinestatic |
The copy will make a transfer between the flash and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
device | The device descriptor of the flash chip on which to do the copy. |
pi_flash_addr | The address of the copy in the flash. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
This can be called to get a flash register. The list of registers is specific to each flash, see the documentation of the flash for more information.
device | The device structure of the flash. |
reg_addr | The register address. |
value | A pointer to the value where the read value will be stored. The size of this variable depends on the register being accessed. |
|
inlinestatic |
This can be called to get a flash register. The list of registers is specific to each flash, see the documentation of the flash for more information. A task must be specified in order to specify how the caller should be notified when the operation is finished.
device | The device structure of the flash. |
reg_addr | The register address. |
value | A pointer to the value where the read value will be stored. The size of this variable depends on the register being accessed. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
|
inlinestatic |
This can be called to set a flash register. This must be used carefully as this can disturb the behavior of the other calls. The list of registers is specific to each flash, see the documentation of the flash for more information.
device | The device structure of the flash. |
reg_addr | The register address. |
value | A pointer to the value to be set. The size of this variable depends on the register being accessed. |
|
inlinestatic |
This can be called to set a flash register. This must be used carefully as this can disturb the behavior of the other calls. The list of registers is specific to each flash, see the documentation of the flash for more information. A task must be specified in order to specify how the caller should be notified when the operation is finished.
device | The device structure of the flash. |
reg_addr | The register address. |
value | A pointer to the value to be set. The size of this variable depends on the register being accessed. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |