STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Flash Driver header More...
Go to the source code of this file.
Functions | |
void | Fls_Init (const Fls_ConfigType *ConfigPtr) |
Fls_Init | |
Std_ReturnType | Fls_Erase (Fls_AddressType TargetAddress, Fls_LengthType Length) |
Fls_Erase | |
Std_ReturnType | Fls_Write (Fls_AddressType TargetAddress, const uint8 *SourceAddressPtr, Fls_LengthType Length) |
Fls_Write | |
void | Fls_Cancel (void) |
Fls_Cancel | |
MemIf_StatusType | Fls_GetStatus (void) |
Fls_GetStatus | |
MemIf_JobResultType | Fls_GetJobResult (void) |
Fls_GetJobResult | |
Std_ReturnType | Fls_Read (Fls_AddressType SourceAddress, uint8 *TargetAddressPtr, Fls_LengthType Length) |
Fls_Read | |
Std_ReturnType | Fls_Compare (Fls_AddressType SourceAddress, const uint8 *TargetAddressPtr, Fls_LengthType Length) |
Fls_Compare | |
void | Fls_SetMode (MemIf_ModeType Mode) |
Fls_SetMode | |
void | Fls_GetVersionInfo (Std_VersionInfoType *VersioninfoPtr) |
Fls_GetVersionInfo | |
Std_ReturnType | Fls_BlankCheck (Fls_AddressType TargetAddress, Fls_LengthType Length) |
Fls_BlankCheck | |
Flash Driver header
The flash driver provides services for reading, writing and erasing flash memory and a configuration interface for setting / resetting the write / erase protection if supported by the underlying hardware. In application mode of the ECU, the flash driver is only to be used by the Flash EEPROM emulation module for writing data. It is not intended to write program code to flash memory in application mode.
Std_ReturnType Fls_BlankCheck | ( | Fls_AddressType | TargetAddress, |
Fls_LengthType | Length ) |
Fls_BlankCheck
The function Fls_BlankCheck shall verify, whether a given memory area has been erased but not (yet) programmed. The function shall limit the maximum number of checked flash cells per main function cycle to the configured value FlsMaxReadNormalMode or FlsMaxReadFastMode respectively.
TargetAddress | Address in flash memory from which the blank check should be started. Min.: 0 Max.: FLS_SIZE - 1. |
Length | Number of bytes to be checked for erase pattern. Min.: 1 Max.: FLS_SIZE - TargetAddress. |
Std_ReturnType | E_OK: request for blank checking has been accepted by the module E_NOT_OK: request for blank checking has not been accepted by the module. |
void Fls_Cancel | ( | void | ) |
Std_ReturnType Fls_Compare | ( | Fls_AddressType | SourceAddress, |
const uint8 * | TargetAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Compare
Compares the contents of an area of flash memory with that of an application data buffer.
SourceAddress | Source address in flash memory. This address offset will be added to the flash memory base address. Min.: 0 Max.: FLS_ SIZE - 1. |
TargetAddressPtr | Pointer to target data buffer. |
Length | Number of bytes to compare Min.: 1 Max.: FLS_SIZE - Source Address. |
Std_ReturnType | E_OK: read command has been accepted E_NOT_OK: read command has not been accepted. |
Std_ReturnType Fls_Erase | ( | Fls_AddressType | TargetAddress, |
Fls_LengthType | Length ) |
Fls_Erase
Erases flash sector(s).
TargetAddress | Target address in flash memory. This address offset will be added to the flash memory base address. Min.: 0 Max.: FLS_SIZE - 1. |
Length | Number of bytes to erase Min.: 1 Max.: FLS_SIZE - Target Address. |
Std_ReturnType | E_OK: erase command has been accepted E_NOT_OK: erase command has not been accepted. |
MemIf_JobResultType Fls_GetJobResult | ( | void | ) |
Fls_GetJobResult
Returns the result of the last job.
MemIf_JobResultType |
MemIf_StatusType Fls_GetStatus | ( | void | ) |
Fls_GetStatus
Returns the driver state.
MemIf_StatusType |
void Fls_GetVersionInfo | ( | Std_VersionInfoType * | VersioninfoPtr | ) |
Fls_GetVersionInfo
Returns the version information of this module.
VersioninfoPtr | Pointer to where to store the version information of this module. |
void Fls_Init | ( | const Fls_ConfigType * | ConfigPtr | ) |
Fls_Init
Initializes the Flash Driver.
ConfigPtr | Pointer to flash driver configuration set. |
Std_ReturnType Fls_Read | ( | Fls_AddressType | SourceAddress, |
uint8 * | TargetAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Read
Reads from flash memory.
SourceAddress | Source address in flash memory. This address offset will be added to the flash memory base address. Min.: 0 Max.: FLS_ SIZE - 1. |
Length | Number of bytes to read Min.: 1 Max.: FLS_SIZE - Source Address. |
TargetAddressPtr | Pointer to target data buffer. |
Std_ReturnType | E_OK: read command has been accepted E_NOT_OK: read command has not been accepted. |
void Fls_SetMode | ( | MemIf_ModeType | Mode | ) |
Fls_SetMode
Sets the flash driver’s operation mode.
Mode | MEMIF_MODE_SLOW: Slow read access / normal SPI access. MEMIF_MODE_FAST: Fast read access / SPI burst access. |
Std_ReturnType Fls_Write | ( | Fls_AddressType | TargetAddress, |
const uint8 * | SourceAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Write
Writes one or more complete flash pages.
TargetAddress | Target address in flash memory. This address offset will be added to the flash memory base address. Min.: 0 Max.: FLS_SIZE - 1. |
SourceAddressPtr | Pointer to source data buffer. |
Length | Number of bytes to write Min.: 1 Max.: FLS_SIZE - TargetAddress. |
Std_ReturnType | E_OK: write command has been accepted E_NOT_OK: write command has not been accepted. |