flash_at91.h

Go to the documentation of this file.
00001 
00040 #ifndef FLASH_AT91_H
00041 #define FLASH_AT91_H
00042 
00043 #include <cpu/types.h>
00044 
00045 #include <kern/kfile.h>
00046 
00047 #include <io/arm.h>
00048 
00049 
00050 #define FLASH_PAGE_SIZE FLASH_PAGE_SIZE_BYTES
00051 
00055 typedef uint32_t page_t;
00056 typedef uint32_t page_addr_t;
00057 
00058 struct Flash;
00059 
00068 typedef struct FlashAt91
00069 {
00073     KFile fd;
00074 
00078     bool page_dirty;
00079 
00083     page_t curr_page;
00084 
00089     uint8_t page_buf[FLASH_PAGE_SIZE_BYTES];
00090 } FlashAt91;
00091 /* \} */
00092 
00093 void flash_hw_init(struct Flash *fd);
00094 
00100 INLINE void flash_at91_init(struct FlashAt91 *fd)
00101 {
00102     flash_hw_init((struct Flash *)fd);
00103 }
00104 
00105 #endif /* DRV_FLASH_ARM_H */