5.12. FLS
5.12.1. Types
Base type |
Type Name |
Brief |
---|---|---|
enum |
ENUM for erase type names. |
|
enum |
||
typedef uint32 |
FLS Address type. |
|
typedef uint32 |
FLS Length type. |
5.12.1.1. enum Fls_EraseType
Enumerator |
Value |
Description |
---|---|---|
FLS_SECTOR_ERASE |
Sector Erase. |
|
FLS_BLOCK_ERASE |
Block Erase. |
|
FLS_CHIP_ERASE |
Chip Erase. |
Brief: ENUM for erase type names.
5.12.1.2. enum Fls_OSPI_Modes
Enumerator |
Value |
Description |
---|---|---|
FLS_OSPI_RX_1S_1S_1S |
1 |
|
FLS_OSPI_RX_1S_1S_2S |
2 |
|
FLS_OSPI_RX_1S_1S_4S |
3 |
|
FLS_OSPI_RX_1S_1S_8S |
4 |
|
FLS_OSPI_RX_4S_4S_4S |
5 |
|
FLS_OSPI_RX_4S_4D_4D |
6 |
|
FLS_OSPI_RX_8S_8S_8S |
7 |
|
FLS_OSPI_RX_8D_8D_8D |
8 |
5.12.1.3. typedef Fls_AddressType
typedef uint32 Fls_AddressType;
Brief: FLS Address type.
5.12.1.4. typedef Fls_LengthType
typedef uint32 Fls_LengthType;
Brief: FLS Length type.
5.12.2. Structures
Name |
Brief |
---|---|
FLS Module Flashable Sectors and pages. |
|
FLS Module Configuration Structure. |
|
Register readback type. |
5.12.3. Defines
Name |
Brief |
---|---|
FLS_ISR_VOID |
void ISR type |
FLS_ISR_CAT1 |
Category 1 ISR type. |
FLS_ISR_CAT2 |
Category 2 ISR type. |
FLS_SW_MAJOR_VERSION |
Driver Implementation Major Version. |
FLS_SW_MINOR_VERSION |
Driver Implementation Minor Version. |
FLS_SW_PATCH_VERSION |
Driver Implementation Patch Version. |
FLS_AR_RELEASE_MAJOR_VERSION |
AUTOSAR Major version specification implemented by FLS Driver. |
FLS_AR_RELEASE_MINOR_VERSION |
AUTOSAR Minor version specification implemented by FLS Driver. |
FLS_AR_RELEASE_REVISION_VERSION |
AUTOSAR Patch version specification implemented by FLS Driver. |
FLS_VENDOR_ID |
Texas Instruments Vendor ID. |
FLS_MODULE_ID |
FLS Driver Module ID. |
FLS_INSTANCE_ID |
FLS Driver Instance ID. |
FLS_E_PARAM_CONFIG |
API service called with wrong parameter. |
FLS_E_PARAM_ADDRESS |
API service called with wrong parameter. |
FLS_E_PARAM_LENGTH |
API service called with wrong parameter. |
FLS_E_PARAM_DATA |
API service called with wrong parameter. |
FLS_E_UNINIT |
API service used without module initiali-zation. |
FLS_E_BUSY |
APIs called when module is busy. |
FLS_E_PARAM_POINTER |
APIs called with a Null Pointer. |
FLS_E_VERIFY_ERASE_FAILED |
APIs service Erase Verification (BlankCheck) failed. |
FLS_E_VERIFY_WRITE_FAILED |
APIs serice Write Verification (Compare) failed. |
FLS_E_TIMEOUT |
APIs Timeout Exceeded. |
FLS_E_MEMAP_INTERRUPT_OFF_DMA_ON |
APIs MEMMAP/INTERRUPT OFF but DMA ON. |
FLS_E_ERASE_FAILED |
Flash Erase Failed in HW. |
FLS_E_WRITE_FAILED |
Flash Write Failed in HW. |
FLS_E_READ_FAILED |
Flash Read Failed in HW. |
FLS_E_COMPARE_FAILED |
Flash Compare Failediin HW. |
FLS_E_UNEXPECTED_FLASH_ID |
Expected HW ID not matched. |
FLS_SID_INIT |
FLS_Init() API Service ID. |
FLS_SID_ERASE |
FLS_Erase() API Service ID. |
FLS_SID_WRITE |
FLS_Write() API Service ID. |
FLS_SID_CANCEL |
FLS_Cancel() API Service ID. |
FLS_SID_GET_STATUS |
FLS_GetStatus() API Service ID. |
FLS_SID_GET_JOB_RESULT |
Fls_GetJobResult() API Service ID. |
FLS_SID_READ |
FLS_Read() API Service ID. |
FLS_SID_COMPARE |
FLS_Compare() API Service ID. |
FLS_SID_SET_MODE |
FLS_SetMode() API Service ID. |
FLS_SID_GET_VERSION_INFO |
Fls_GetVersionInfo() API Service ID. |
FLS_SID_BLANK_CHECK |
FLS_BlankCheck() API Service ID. |
FLS_SID_MAIN_FUNCTION |
FLS_MainFunction() API Service ID. |
FLS_SID_REGISTERREADBACK |
Fls_RegisterReadback() API Service ID. |
FLS_SID_SET_ERASE_TYPE |
Fls_SetEraseType() API Service ID. |
FLS_BASE_ADDRESS_REQ |
FLS Address type. |
5.12.4. Functions
Return type |
Function Name |
Brief |
---|---|---|
void |
Fls_Init(const Fls_ConfigType * ConfigPtr) |
Initializes the Flash Driver. |
Std_ReturnType |
Fls_Erase(Fls_AddressType TargetAddress, Fls_LengthType Length) |
Erases flash sector(s). |
Std_ReturnType |
Fls_Write(Fls_AddressType TargetAddress, const uint8 * SourceAddressPtr, Fls_LengthType Length) |
Writes one or more complete flash pages. |
Std_ReturnType |
Fls_Read(Fls_AddressType SourceAddress, uint8 * TargetAddressPtr, Fls_LengthType Length) |
Reads from flash memory. |
Std_ReturnType |
Fls_Compare(Fls_AddressType SourceAddress, const uint8 * TargetAddressPtr, Fls_LengthType Length) |
Compares the contents of an area of flash memory with that of an application data buffer. |
Std_ReturnType |
Fls_BlankCheck(Fls_AddressType Address, Fls_LengthType Length) |
The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed. |
MemIf_StatusType |
Fls_GetStatus(void ) |
Returns the driver state. |
Std_ReturnType |
Fls_GetVersionInfo(Std_VersionInfoType * versioninfo) |
This service returns the version information of this module. |
MemIf_JobResultType |
Fls_GetJobResult(void ) |
Returns the result of the last job. |
void |
Fls_MainFunction(void ) |
Performs the processing of jobs. |
void |
Fls_Cancel(void ) |
Cancels an ongoing job. |
void |
Fls_SetMode(MemIf_ModeType Mode) |
Sets the flash driver’s operation mode This is a dummy API which is not supported and Added for integration purposes. |
uint32 |
Fls_SetEraseType(Fls_EraseType erasetype) |
Sets the parameters for required erase type. Sets the parameters required in application, based on the erase type parameter passed to this function while calling from Application. |
Std_ReturnType |
Fls_RegisterReadback(Fls_RegisterReadbackType * RegRbPtr) |
Register readback function. |
Std_ReturnType |
Fls_Set3ByteAddressMode(void ) |
Sets the Flash Addressing Mode to 3 byte. |
5.12.4.1. function Fls_Init
void Fls_Init(
const Fls_ConfigType * ConfigPtr
)
Brief: Initializes the Flash Driver.
Mode : Supervisor Mode (Privileged Mode)
Service ID[hex] : 0x00
Sync/Async : Synchronous
Reentrancy : Non-Reentrant
Parameters:
ConfigPtr - Pointer to flash driver configuration set
Returns:
None
Return: None
5.12.4.2. function Fls_Erase
Std_ReturnType Fls_Erase(
Fls_AddressType TargetAddress,
Fls_LengthType Length
)
Brief: Erases flash sector(s).
Mode : Supervisor Mode (Privileged Mode)
Service ID[hex] : 0x01
Sync/Async : Asynchronous
Reentrancy : Non-Reentrant
Parameters:
TargetAddress - Target address in flash memory. This address offset will be added to the flash memory base address.
Length - Number of bytes to erase
Returns:
E_OK erase command has been accepted
E_NOT_OK erase command has not been accepted
Return: Std_ReturnType
5.12.4.3. function Fls_Write
Std_ReturnType Fls_Write(
Fls_AddressType TargetAddress,
const uint8 * SourceAddressPtr,
Fls_LengthType Length
)
Brief: Writes one or more complete flash pages.
Mode : Supervisor Mode (Privileged Mode)
Service ID[hex] : 0x02
Sync/Async : Asynchronous
Reentrancy : Non-Reentrant
Parameters:
TargetAddress - Target address in flash memory. This address offset will be added to the flash memory base address.
SourceAddressPtr - Pointer to source data buffer
Length - Number of bytes to write
Returns:
E_OK write command has been accepted
E_NOT_OK write command has not been accepted
Return: Std_ReturnType
5.12.4.4. function Fls_Read
Std_ReturnType Fls_Read(
Fls_AddressType SourceAddress,
uint8 * TargetAddressPtr,
Fls_LengthType Length
)
Brief: Reads from flash memory.
Mode : Supervisor Mode (Privileged Mode)
Service ID[hex] : 0x07
Sync/Async : Asynchronous
Reentrancy : Non-Reentrant
Parameters:
SourceAddress - Source address in flash memory. This address offset will be added to the flash memory base address.
TargetAddressPtr - Pointer to target data buffer
Length - Number of bytes to read
Returns:
E_OK read command has been accepted
E_NOT_OK read command has not been accepted
Return: Std_ReturnType
5.12.4.5. function Fls_Compare
Std_ReturnType Fls_Compare(
Fls_AddressType SourceAddress,
const uint8 * TargetAddressPtr,
Fls_LengthType Length
)
Brief: Compares the contents of an area of flash memory with that of an application data buffer.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x08
Sync/Async : Asynchronous
Reentrancy : Non-Reentrant
Parameters:
SourceAddress - Source address in flash memory. This address offset will be added to the flash memory base address.
TargetAddressPtr - Pointer to target data buffer
Length - Number of bytes to compare
Returns:
E_OK compare command has been accepted
E_NOT_OK compare command has not been accepted
Return: Std_ReturnType
5.12.4.6. function Fls_BlankCheck
Std_ReturnType Fls_BlankCheck(
Fls_AddressType Address,
Fls_LengthType Length
)
Brief: The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x0a
Sync/Async : Asynchronous
Reentrancy : Non-Reentrant
Parameters:
Address - Source address in flash memory. This address offset will be added to the flash memory base address.
Length - Number of bytes to compare
Returns:
E_OK BlankCheck command has been accepted
E_NOT_OK BlankCheck command has not been accepted
Return: Std_ReturnType
5.12.4.7. function Fls_GetStatus
MemIf_StatusType Fls_GetStatus(
void
)
Brief: Returns the driver state.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x04
Sync/Async : Synchronous
Reentrancy : Reentrant
Parameters:
None
Returns:
Returns the state
Return: MemIf_StatusType
5.12.4.8. function Fls_GetVersionInfo
Std_ReturnType Fls_GetVersionInfo(
Std_VersionInfoType * versioninfo
)
Brief: This service returns the version information of this module.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x10
Sync/Async : Synchronous
Reentrancy : Reentrant
Parameters:
versioninfo - Pointer to where to store the version information of this module
Returns:
E_OK command has been accepted
E_NOT_OK command has not been accepted
Return: Std_ReturnType
5.12.4.9. function Fls_GetJobResult
MemIf_JobResultType Fls_GetJobResult(
void
)
Brief: Returns the result of the last job.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x05
Sync/Async : Synchronous
Reentrancy : Reentrant
Parameters:
None
Returns:
Returns the MemIf Job result type. Refer enum MemIf_JobResultType for the values
Return: MemIf_JobResultType
5.12.4.10. function Fls_MainFunction
void Fls_MainFunction(
void
)
Brief: Performs the processing of jobs.
Mode : Supervisor Mode (Privileged Mode)
Service ID[hex] : 0x06
Parameters:
None
Returns:
None
Return: None
5.12.4.11. function Fls_Cancel
void Fls_Cancel(
void
)
Brief: Cancels an ongoing job.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x03
Parameters:
None
Returns:
None
Return: None
5.12.4.12. function Fls_SetMode
void Fls_SetMode(
MemIf_ModeType Mode
)
Brief: Sets the flash driver’s operation mode This is a dummy API which is not supported and Added for integration purposes.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : 0x09
Sync/Async : Synchronous
Reentrancy : Non Reentrant
Parameters:
Mode - MEMIF_MODE_SLOW: Slow read access / normal SPI access, MEMIF_MODE_FAST: Fast read access / SPI burst access.
Returns:
None
Return: None
5.12.4.13. function Fls_SetEraseType
uint32 Fls_SetEraseType(
Fls_EraseType erasetype
)
Brief: Sets the parameters for required erase type. Sets the parameters required in application, based on the erase type parameter passed to this function while calling from Application.
Mode : User Mode (Non-Privileged Mode)
Service ID[hex] : NA
Parameters:
erasetype - Type of erase
Returns:
Returns sector or block size
Return: uint32
5.12.4.14. function Fls_RegisterReadback
Std_ReturnType Fls_RegisterReadback(
Fls_RegisterReadbackType * RegRbPtr
)
Brief: Register readback function.
Service ID[hex] : NA
Parameters:
RegRbPtr - Register readback pointer
Returns:
E_OK success
E_NOT_OK failure
Return: Std_ReturnType
5.12.4.15. function Fls_Set3ByteAddressMode
Std_ReturnType Fls_Set3ByteAddressMode(
void
)
Brief: Sets the Flash Addressing Mode to 3 byte.
Service ID[hex] : NA
Returns:
E_OK success
E_NOT_OK failure
Return: Std_ReturnType