These APIs try to communicate with whichever flash is connected the OSPI peripheral in 1-1-1 mode. This can be used in bringing up new flashes and mostly used for debug and diagnostic purposes
Functions | |
| int32_t | OSPI_lld_norFlashInit1s1s1s (OSPILLD_Handle handle) |
| This function initializes the NOR flash to work in 1-1-1 mode. More... | |
| void | OSPI_lld_norFlashSetCmds (uint8_t rdCmd, uint8_t wrCmd, uint8_t eraseCmd) |
| This function sets up internal bookkeeping variables for read, write and erase commands. This API has to be called immediately before OSPI_lld_norFlashInit1s1s1s. More... | |
| int32_t | OSPI_lld_norFlashReadId (OSPILLD_Handle handle, uint32_t *manufacturerId, uint32_t *deviceId) |
| This function tries to read the JEDEC ID from the NOR flash connected to the OSPI peripheral. More... | |
| int32_t | OSPI_lld_norFlashWrite (OSPILLD_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
| This function writes data to the flash at a specified offset. More... | |
| int32_t | OSPI_lld_norFlashRead (OSPILLD_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
| This function reads data from the flash from a specified offset in DAC mode. More... | |
| int32_t | OSPI_lld_norFlashReadIndirect (OSPILLD_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
| This function reads data from the flash from a specified offset in INDAC mode. More... | |
| int32_t | OSPI_lld_norFlashReadSfdp (OSPILLD_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
| This function reads SFDP table from the flash from a specified offset. More... | |
| int32_t | OSPI_lld_norFlashErase (OSPILLD_Handle handle, uint32_t address) |
| This function erases 1 block of data starting from a provided address. More... | |
| int32_t | OSPI_lld_configResetPin (OSPILLD_Handle handle, uint32_t config) |
| This function configures reset functionality. More... | |
| int32_t | OSPI_lld_configBaudrate (OSPILLD_Handle handle, uint32_t baud) |
| Configures baud divider. More... | |
| int32_t | OSPI_lld_readBaudRateDivFromReg (OSPILLD_Handle handle, uint32_t *baudDiv) |
| Return value of baudrate that is programmed in IP register. More... | |
| int32_t | OSPI_lld_getBaudRateDivFromObj (OSPILLD_Handle handle, uint32_t *baudDiv) |
| Return value of baudrate that is saved in OSPI Object. More... | |
| int32_t | OSPI_lld_setResetPinStatus (OSPILLD_Handle hOspi, uint32_t pinStatus) |
| This function activates the RESET pin feature. More... | |
| int32_t OSPI_lld_norFlashInit1s1s1s | ( | OSPILLD_Handle | handle | ) |
This function initializes the NOR flash to work in 1-1-1 mode.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| void OSPI_lld_norFlashSetCmds | ( | uint8_t | rdCmd, |
| uint8_t | wrCmd, | ||
| uint8_t | eraseCmd | ||
| ) |
This function sets up internal bookkeeping variables for read, write and erase commands. This API has to be called immediately before OSPI_lld_norFlashInit1s1s1s.
| rdCmd | Command to be used in single mode read |
| wrCmd | Command to be used in single mode write/page program |
| eraseCmd | Command to be used to erase (block or sector) |
| int32_t OSPI_lld_norFlashReadId | ( | OSPILLD_Handle | handle, |
| uint32_t * | manufacturerId, | ||
| uint32_t * | deviceId | ||
| ) |
This function tries to read the JEDEC ID from the NOR flash connected to the OSPI peripheral.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| manufacturerId | Pointer to a uint32_t variable. This will be filled with the manufacturer ID on success |
| deviceId | Pointer to a uint32_t variable. This will be filled with the device ID on success |
| int32_t OSPI_lld_norFlashWrite | ( | OSPILLD_Handle | handle, |
| uint32_t | offset, | ||
| uint8_t * | buf, | ||
| uint32_t | len | ||
| ) |
This function writes data to the flash at a specified offset.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| offset | Offset at which the data is to be written |
| buf | Buffer which has the data to be written to the flash |
| len | Number of bytes to be written to the flash |
| int32_t OSPI_lld_norFlashRead | ( | OSPILLD_Handle | handle, |
| uint32_t | offset, | ||
| uint8_t * | buf, | ||
| uint32_t | len | ||
| ) |
This function reads data from the flash from a specified offset in DAC mode.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| offset | Offset at which the data is to be read from |
| buf | Buffer to which data will be written into |
| len | Number of bytes to be read from the flash |
| int32_t OSPI_lld_norFlashReadIndirect | ( | OSPILLD_Handle | handle, |
| uint32_t | offset, | ||
| uint8_t * | buf, | ||
| uint32_t | len | ||
| ) |
This function reads data from the flash from a specified offset in INDAC mode.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| offset | Offset at which the data is to be read from |
| buf | Buffer to which data will be written into |
| len | Number of bytes to be read from the flash |
| int32_t OSPI_lld_norFlashReadSfdp | ( | OSPILLD_Handle | handle, |
| uint32_t | offset, | ||
| uint8_t * | buf, | ||
| uint32_t | len | ||
| ) |
This function reads SFDP table from the flash from a specified offset.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| offset | Offset at which the data is to be read from |
| buf | Buffer to which data will be written into |
| len | Number of bytes to be read from the flash |
| int32_t OSPI_lld_norFlashErase | ( | OSPILLD_Handle | handle, |
| uint32_t | address | ||
| ) |
This function erases 1 block of data starting from a provided address.
| handle | An OSPILLD_Handle returned from an OSPI_open() |
| address | Address of the data block to be erased. This address should be block aligned. |
| int32_t OSPI_lld_configResetPin | ( | OSPILLD_Handle | handle, |
| uint32_t | config | ||
| ) |
This function configures reset functionality.
| handle | An OSPI_Handle returned from an OSPI_open() |
| config | reset config |
| int32_t OSPI_lld_configBaudrate | ( | OSPILLD_Handle | handle, |
| uint32_t | baud | ||
| ) |
Configures baud divider.
| handle | An OSPI_Handle returned from an OSPI_open() |
| baud | baudrate from 2 to 32 and divisible by 2 |
| int32_t OSPI_lld_readBaudRateDivFromReg | ( | OSPILLD_Handle | handle, |
| uint32_t * | baudDiv | ||
| ) |
Return value of baudrate that is programmed in IP register.
| handle | An OSPI_Handle returned from an OSPI_open() |
| baudDiv | pointer to memory into which baudrate will be written |
| int32_t OSPI_lld_getBaudRateDivFromObj | ( | OSPILLD_Handle | handle, |
| uint32_t * | baudDiv | ||
| ) |
Return value of baudrate that is saved in OSPI Object.
| handle | An OSPILLD_Handle returned from an OSPI_init() |
| baudDiv | pointer to memory into which baudrate will be written |
| int32_t OSPI_lld_setResetPinStatus | ( | OSPILLD_Handle | hOspi, |
| uint32_t | pinStatus | ||
| ) |
This function activates the RESET pin feature.
| hOspi | An OSPILLD_Handle returned from an OSPI_open() |
| pinStatus | pinStatus - HIGH/LOW |