EZR32 Wonder Gecko Software Documentation  ezr32wg-doc-5.1.2
norflash.h
Go to the documentation of this file.
1 /***************************************************************************/
17 #ifndef __NORFLASH_H
18 #define __NORFLASH_H
19 
20 #include <stdint.h>
21 #include <stdbool.h>
22 #include <stddef.h>
23 
24 /***************************************************************************/
29 /***************************************************************************/
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
39 typedef enum
40 {
49 
51 typedef struct
52 {
53  uint32_t baseAddress;
54  uint32_t deviceId;
55  uint32_t deviceSize;
56  uint32_t sectorCount;
57  uint32_t sectorSize;
58  uint16_t manufacturerId;
60 
61 bool NORFLASH_AddressValid(uint32_t addr);
63 int NORFLASH_EraseDevice(void);
64 int NORFLASH_EraseSector(uint32_t addr);
65 int NORFLASH_Init(void);
66 int NORFLASH_ProgramByte(uint32_t addr, uint8_t data);
67 int NORFLASH_ProgramWord16(uint32_t addr, uint16_t data);
68 int NORFLASH_ProgramWord32(uint32_t addr, uint32_t data);
69 int NORFLASH_Program(uint32_t addr, uint8_t *data, uint32_t count);
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
78 #endif /* __NORFLASH_H */
int NORFLASH_EraseDevice(void)
Erase entire flash device.
Definition: norflash.c:93
uint32_t sectorCount
Definition: norflash.h:56
int NORFLASH_ProgramWord16(uint32_t addr, uint16_t data)
Program a word (16bit) in the flash device.
Definition: norflash.c:319
bool NORFLASH_AddressValid(uint32_t addr)
Check if an address is valid for the flash device.
Definition: norflash.c:49
int NORFLASH_Init(void)
Initialize the NORFLASH module.
Definition: norflash.c:170
NORFLASH_Status_TypeDef
NORFLASH status enumerator.
Definition: norflash.h:39
uint32_t deviceSize
Definition: norflash.h:55
NORFLASH_Info_TypeDef * NORFLASH_DeviceInfo(void)
Return a pointer to a NORFLASH_Info_TypeDef, which contain vital flash device information.
Definition: norflash.c:74
int NORFLASH_ProgramByte(uint32_t addr, uint8_t data)
Program a single byte in the flash device.
Definition: norflash.c:285
uint32_t sectorSize
Definition: norflash.h:57
int NORFLASH_EraseSector(uint32_t addr)
Erase a sector in the flash device.
Definition: norflash.c:126
NORFLASH device information struct.
Definition: norflash.h:51
int NORFLASH_ProgramWord32(uint32_t addr, uint32_t data)
Program a word (32bit) in the flash device.
Definition: norflash.c:366
uint32_t baseAddress
Definition: norflash.h:53
uint16_t manufacturerId
Definition: norflash.h:58
int NORFLASH_Program(uint32_t addr, uint8_t *data, uint32_t count)
Program the flash device.
Definition: norflash.c:195