BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Hardware presentation/abstraction for flash memory peripheral (FLASH). More...
#include <bsp430/periph.h>
Go to the source code of this file.
Macros | |
#define | BSP430_MODULE_FLASH (defined(__MSP430_HAS_FLASH__) || defined(__MSP430_HAS_FLASH2__)) |
Functions | |
int | iBSP430flashEraseSegment_ni (const void *addr) |
int | iBSP430flashWriteData_ni (void *dest, const void *src, size_t len) |
Hardware presentation/abstraction for flash memory peripheral (FLASH).
A flash memory peripherals is available on almost every MSP430 MCU, and may be identified as either FLASH or FLASH2. Different MCUs in the same family are one or the other. The differences between these peripherals are visible in the interface provided by this module.
None supported.
As there can be only one instance of the flash memory peripheral on any MCU, there is no structure supporting a FLASH HPL. Manipulate the peripheral through its registers directly.
As there can be only one instance of FLASH on any MCU, there is no structure supporting a FLASH HAL.
#define BSP430_MODULE_FLASH (defined(__MSP430_HAS_FLASH__) || defined(__MSP430_HAS_FLASH2__)) |
Defined on inclusion of <bsp430/periph/flash.h>. The value evaluates to true if the target MCU supports the Flash Memory module, and false if it does not.
int iBSP430flashEraseSegment_ni | ( | const void * | addr | ) |
Erase the flash segment holding the given address
The MSP430 flash segment erase function is invoked.
addr | an address within the segment to be erased |
int iBSP430flashWriteData_ni | ( | void * | dest, |
const void * | src, | ||
size_t | len | ||
) |
Copy data into flash memory
Rather like memcpy()
, but the destination is assumed to be in a flash memory segment. The write must not cross a segment boundary.
dest | an address in a flash segment. The region into which the data will be written must have already been erased. |
src | the address of the data to be copied into flash |
len | the number of bytes to be copied |