X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Fflash_at91.h;h=0b6c8d663676d7a3be29c69550bed5709fe7cee0;hb=b708b0cbae2dc58ef30943ade3d56c464b49a59c;hp=1dcd9829131d6a0b00c20ce5b9bdb687cb199fdd;hpb=507e95236d43b2aa6d6b6e46bde5cb92345ab034;p=bertos.git diff --git a/bertos/cpu/arm/drv/flash_at91.h b/bertos/cpu/arm/drv/flash_at91.h index 1dcd9829..0b6c8d66 100644 --- a/bertos/cpu/arm/drv/flash_at91.h +++ b/bertos/cpu/arm/drv/flash_at91.h @@ -47,14 +47,23 @@ #include +#define FLASH_PAGE_SIZE FLASH_PAGE_SIZE_BYTES + /** * Define data type to manage page and memory address. */ -typedef uint32_t arm_page_t; -typedef uint32_t arm_page_addr_t; +typedef uint32_t page_t; +typedef uint32_t page_addr_t; + +struct Flash; /** * FlashAt91 KFile context structure. + * + * DEPREACTED STRUCTURE! + * Use EmbFlash instead + * + * \{ */ typedef struct FlashAt91 { @@ -71,32 +80,26 @@ typedef struct FlashAt91 /** * Current buffered page. */ - arm_page_t curr_page; + page_t curr_page; /** * Temporary buffer cointaing data block to * write on flash. */ uint8_t page_buf[FLASH_PAGE_SIZE_BYTES]; - - } FlashAt91; +/* \} */ -/** - * ID for FlashAt91 - */ -#define KFT_FLASHAT91 MAKE_ID('F', 'A', '9', '1') +void flash_hw_init(struct Flash *fd); /** - * Convert + ASSERT from generic KFile to FlashAt91. + * WARNING! + * This function is DEPRECADED! + * use the emb_flash module instead. */ -INLINE FlashAt91 * FLASHAT91_CAST(KFile *fd) +INLINE void flash_at91_init(struct FlashAt91 *fd) { - ASSERT(fd->_type == KFT_FLASHAT91); - return (FlashAt91 *)fd; + flash_hw_init((struct Flash *)fd); } - -void flash_at91_init(FlashAt91 *fd); - -#endif +#endif /* DRV_FLASH_ARM_H */