libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
SWM050 Flash API. More...
Macros | |
#define | IAP_WR (void *)(0x1000AB) |
#define | IAP_E (void *)(0x100127) |
Functions | |
uint32_t | flash_write (uint32_t *dest, uint32_t *src, uint8_t cnt) |
Write to the user flash. More... | |
uint32_t | flash_read (uint32_t *src, uint32_t *dest, uint8_t cnt) |
Read from the user flash. More... | |
uint32_t | flash_erase (void) |
Erase the user flash. More... | |
Variables | |
uint32_t(* | iap_write_read )(uint32_t *, uint32_t *, uint8_t, uint8_t) = IAP_WR |
uint32_t(* | iap_erase )(void) = IAP_E |
SWM050 Flash API.
LGPL License Terms libopencm3 License
uint32_t flash_erase | ( | void | ) |
uint32_t flash_read | ( | uint32_t * | src, |
uint32_t * | dest, | ||
uint8_t | cnt | ||
) |
Read from the user flash.
Reads words from the 0.5k user flash area. Must be performed only when the system clock is 18Mhz.
[in] | src | Source address The memory area to copy from. From 0x00 - 0x1FC, as long as it is word-aligned |
[out] | dest | Destination address The memory area to copy to. |
[in] | cnt | Number of words to read From 1 - 128 as long as (src + (cnt * 4)) < 0x200 |
Definition at line 79 of file flash.c.
References iap_write_read.
uint32_t flash_write | ( | uint32_t * | dest, |
uint32_t * | src, | ||
uint8_t | cnt | ||
) |
Write to the user flash.
Writes words to the 0.5k user flash area. Must be performed only when the system clock is 18Mhz.
[in] | dest | Destination address The memory area to copy to. From 0x00 - 0x1FC, as long as it is word-aligned |
[in] | src | Source address The memory area to copy from. |
[in] | cnt | Number of words to write From 1-128 as long as (dest + (cnt * 4)) < 0x200 |
Definition at line 55 of file flash.c.
References iap_write_read.
uint32_t(* iap_erase) (void) | ( | void | ) | = IAP_E |
Definition at line 34 of file flash.c.
Referenced by flash_erase().
uint32_t(* iap_write_read) (uint32_t *, uint32_t *, uint8_t, uint8_t) | ( | uint32_t * | , |
uint32_t * | , | ||
uint8_t | , | ||
uint8_t | |||
) | = IAP_WR |
Definition at line 33 of file flash.c.
Referenced by flash_read(), and flash_write().