flash_avr.h
Go to the documentation of this file.00001 00041 #ifndef FLASH_AT91_H 00042 #define FLASH_AT91_H 00043 00044 #include <cpu/types.h> 00045 00046 #include <cfg/compiler.h> 00047 00048 #include <kern/kfile.h> 00049 00050 #include <avr/io.h> 00051 00052 00053 #define FLASH_PAGE_SIZE SPM_PAGESIZE 00054 00058 typedef uint16_t page_t; 00059 00060 /* Forward declaration */ 00061 struct Flash; 00062 00070 typedef struct FlashAvr 00071 { 00075 KFile fd; 00076 00080 bool page_dirty; 00081 00085 page_t curr_page; 00086 00091 uint8_t page_buf[SPM_PAGESIZE]; 00092 } FlashAvr; 00093 /* \} */ 00094 00095 void flash_hw_init(struct Flash *fd); 00096 00102 INLINE void flash_avr_init(struct FlashAvr *fd) 00103 { 00104 flash_hw_init((struct Flash *)fd); 00105 } 00106 00107 #endif /* DRV_FLASH_AVR_H */
