|
CANopen Bootloader Documentation
Version 4.10.00
|
The file defines functions to erase a flash memory and to write data to a flash memory.
Include dependency graph for mc_flash.h:Enumerations | |
| enum | FLASH_ERR_e { eFLASH_ERR_OK = 0x00 , eFLASH_ERR_INIT = 0x01 , eFLASH_ERR_ADDRESS = 0x02 , eFLASH_ERR_READ = 0x04 , eFLASH_ERR_WRITE = 0x08 , eFLASH_ERR_ERASE = 0x10 , eFLASH_ERR_CHECKSUM = 0x20 , eFLASH_ERR_COLLISION = 0x40 } |
Functions | |
| Status_tv | McFlashGetStatus (void) |
| Status_tv | McFlashErase (uint32_t ulFlashAddrV, uint32_t ulSizeV) |
| Status_tv | McFlashInit (void) |
| Status_tv | McFlashLock (void) |
| Status_tv | McFlashWrite (uint32_t ulAddressV, void *pvdDataV, uint32_t ulSizeV) |
| Status_tv | McFlashUnlock (void) |
| enum FLASH_ERR_e |
Error code for flash memory access.
The following error codes are used by the flash driver. The status can be checked via the function McFlashGetStatus().
| Status_tv McFlashErase | ( | uint32_t | ulFlashAddrV, |
| uint32_t | ulSizeV | ||
| ) |
Erase page of selected address.
| [in] | ulFlashAddrV | - Memory start address |
| [in] | ulSizeV | - Memory size to erase |
This function is used to erase ulSizeV bytes of data, starting from address ulFlashAddrV.
| Status_tv McFlashGetStatus | ( | void | ) |
The function returns the status of the last flash operation
| Status_tv McFlashInit | ( | void | ) |
Initialise flash of MCU.
| Status_tv McFlashLock | ( | void | ) |
| Status_tv McFlashUnlock | ( | void | ) |
| Status_tv McFlashWrite | ( | uint32_t | ulAddressV, |
| void * | pvdDataV, | ||
| uint32_t | ulSizeV | ||
| ) |
Write data.
| [in] | ulAddressV | - Flash memory address |
| [in] | pvdDataV | - Pointer to data |
| [in] | ulSizeV | - number of bytes to write |
This function is used to write data to a given flash memory location ulAddressV. The function checks the address range and the address alignment. In order to write to the flash memory, it has to be unlocked by calling McFlashUnlock() in advance.