X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fflash25.h;h=53ca9197ef63d45ef3a285874a33f8412689efd6;hb=5bd2e00f5d77f8354649b1a8c434de9cf44b7d25;hp=ed89384d7ce23bfd7f3784d7fd9c7d9ee7c06866;hpb=4128f7132429072564952d3244d41e92bd3cfd46;p=bertos.git diff --git a/bertos/drv/flash25.h b/bertos/drv/flash25.h index ed89384d..53ca9197 100644 --- a/bertos/drv/flash25.h +++ b/bertos/drv/flash25.h @@ -35,14 +35,18 @@ * * \version $Id$ * \author Daniele Basile + * + * $WIZ$ module_name = "flash25" + * $WIZ$ module_depends = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_flash25.h" */ #ifndef DRV_FLASH25_H #define DRV_FLASH25_H -#include #include "cfg/cfg_flash25.h" +#include #include @@ -56,11 +60,11 @@ typedef uint8_t flash25Offset_t; /** * Flash25 KFile context structure. */ -typedef struct Flash25KFile +typedef struct Flash25 { KFile fd; ///< File descriptor. KFile *channel; ///< Dataflash comm channel (usually SPI). -} Flash25KFile; +} Flash25; /** * ID for dataflash. @@ -69,12 +73,12 @@ typedef struct Flash25KFile /** - * Convert + ASSERT from generic KFile to Flash25KFile. + * Convert + ASSERT from generic KFile to Flash25. */ -INLINE Flash25KFile * FLASH25KFILE(KFile *fd) +INLINE Flash25 * FLASH25_CAST(KFile *fd) { ASSERT(fd->_type == KFT_FLASH25); - return (Flash25KFile *)fd; + return (Flash25 *)fd; } /** @@ -83,7 +87,8 @@ INLINE Flash25KFile * FLASH25KFILE(KFile *fd) * \note Below are defined valid serial flash memory support to * this drive. Every time we call flash25_init() function we check * if memory defined are right (see flash25.c form more detail). - * \{ + * + * $WIZ$ flash25_list = "FLASH25_AT25F2048" */ #define FLASH25_AT25F2048 1 @@ -100,7 +105,6 @@ INLINE Flash25KFile * FLASH25KFILE(KFile *fd) #endif #define RDY_BIT 0x1 // Statuts of write cycle -/* \} */ /** * Serial flash opcode commands. @@ -131,9 +135,9 @@ typedef enum { FLASH25_SECT4 = 0x30000, ///< Sector 4 (0x30000 -0x3FFFF) } Flash25Sector; -void flash25_init(Flash25KFile *fd, KFile *ch); -void flash25_chipErase(Flash25KFile *fd); -void flash25_sectorErase(Flash25KFile *fd, Flash25Sector sector); +void flash25_init(Flash25 *fd, KFile *ch); +void flash25_chipErase(Flash25 *fd); +void flash25_sectorErase(Flash25 *fd, Flash25Sector sector); bool flash25_test(KFile *channel); #endif /* DRV_FLASH25_H */