STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Flash Architecture Driver More...
Go to the source code of this file.
Functions | |
void | Fls_Arch_Init (Fls_HwUnit *HwUnit, const Fls_ConfigType *ConfigPtr) |
FLS_Init Low Level Initialization | |
Std_ReturnType | Fls_Arch_Erase (Fls_HwUnit *HwUnit, Fls_AddressType TargetAddress, Fls_LengthType Length) |
Fls_Erase Low Level Initialization | |
Std_ReturnType | Fls_Arch_Write (Fls_HwUnit *HwUnit, Fls_AddressType TargetAddress, const uint8 *SourceAddressPtr, Fls_LengthType Length) |
Fls_Write Low Level Initialization | |
void | Fls_Arch_Cancel (Fls_HwUnit *HwUnit) |
Fls_Cancel Low Level Initialization | |
MemIf_StatusType | Fls_Arch_GetStatus (Fls_HwUnit *HwUnit) |
Fls_GetStatus Low Level Initialization | |
MemIf_JobResultType | Fls_Arch_GetJobResult (Fls_HwUnit *HwUnit) |
Fls_GetJobResult Low Level Initialization | |
Std_ReturnType | Fls_Arch_Read (Fls_HwUnit *HwUnit, Fls_AddressType SourceAddress, uint8 *TargetAddressPtr, Fls_LengthType Length) |
Fls_Read Low Level Initialization | |
Std_ReturnType | Fls_Arch_Compare (Fls_HwUnit *HwUnit, Fls_AddressType SourceAddress, const uint8 *TargetAddressPtr, Fls_LengthType Length) |
Fls_Compare Low Level Initialization | |
void | Fls_Arch_SetMode (Fls_HwUnit *HwUnit, MemIf_ModeType Mode) |
Fls_SetMode Low Level Initialization | |
Std_ReturnType | Fls_Arch_BlankCheck (Fls_HwUnit *HwUnit, Fls_AddressType TargetAddress, Fls_LengthType Length) |
Fls_BlankCheck Low Level Initialization | |
Flash Architecture Driver
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_Arch_BlankCheck | ( | Fls_HwUnit * | HwUnit, |
Fls_AddressType | TargetAddress, | ||
Fls_LengthType | Length ) |
Fls_BlankCheck Low Level Initialization
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.
HwUnit | Pointer to the hardware unit configuration. |
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_Arch_Cancel | ( | Fls_HwUnit * | HwUnit | ) |
Fls_Cancel Low Level Initialization
Cancels an ongoing job.
HwUnit | Pointer to the hardware unit configuration. |
Std_ReturnType Fls_Arch_Compare | ( | Fls_HwUnit * | HwUnit, |
Fls_AddressType | SourceAddress, | ||
const uint8 * | TargetAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Compare Low Level Initialization
Compares the contents of an area of flash memory with that of an application data buffer.
HwUnit | Pointer to the hardware unit configuration. |
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_Arch_Erase | ( | Fls_HwUnit * | HwUnit, |
Fls_AddressType | TargetAddress, | ||
Fls_LengthType | Length ) |
Fls_Erase Low Level Initialization
Erases flash sector(s).
HwUnit | Pointer to the hardware unit configuration. |
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_Arch_GetJobResult | ( | Fls_HwUnit * | HwUnit | ) |
Fls_GetJobResult Low Level Initialization
Returns the result of the last job.
HwUnit | Pointer to the hardware unit configuration. |
MemIf_JobResultType |
< dummy element for the moment
MemIf_StatusType Fls_Arch_GetStatus | ( | Fls_HwUnit * | HwUnit | ) |
Fls_GetStatus Low Level Initialization
Returns the driver state.
HwUnit | Pointer to the hardware unit configuration. |
MemIf_StatusType |
< dummy element for the moment
void Fls_Arch_Init | ( | Fls_HwUnit * | HwUnit, |
const Fls_ConfigType * | ConfigPtr ) |
FLS_Init Low Level Initialization
Initializes the Flash Driver.
HwUnit | Pointer to the hardware unit configuration. |
ConfigPtr | Pointer to flash driver configuration set. |
Std_ReturnType Fls_Arch_Read | ( | Fls_HwUnit * | HwUnit, |
Fls_AddressType | SourceAddress, | ||
uint8 * | TargetAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Read Low Level Initialization
Reads from flash memory.
HwUnit | Pointer to the hardware unit configuration. |
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_Arch_SetMode | ( | Fls_HwUnit * | HwUnit, |
MemIf_ModeType | Mode ) |
Fls_SetMode Low Level Initialization
Sets the flash driver’s operation mode.
HwUnit | Pointer to the hardware unit configuration. |
Mode | MEMIF_MODE_SLOW: Slow read access / normal SPI access. MEMIF_MODE_FAST: Fast read access / SPI burst access. |
Std_ReturnType Fls_Arch_Write | ( | Fls_HwUnit * | HwUnit, |
Fls_AddressType | TargetAddress, | ||
const uint8 * | SourceAddressPtr, | ||
Fls_LengthType | Length ) |
Fls_Write Low Level Initialization
Writes one or more complete flash pages.
HwUnit | Pointer to the hardware unit configuration. |
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. |