X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fflash25.h;h=ed89384d7ce23bfd7f3784d7fd9c7d9ee7c06866;hb=0e9db20f6fb7f4ec21edaae6c9270317ee5dcfd9;hp=af9408522a51728113079b7447573dad4341ad02;hpb=f48615ef4781f256708e3e7300088a6e985d8d18;p=bertos.git diff --git a/bertos/drv/flash25.h b/bertos/drv/flash25.h index af940852..ed89384d 100644 --- a/bertos/drv/flash25.h +++ b/bertos/drv/flash25.h @@ -41,11 +41,10 @@ #ifndef DRV_FLASH25_H #define DRV_FLASH25_H -#include #include +#include "cfg/cfg_flash25.h" - -#include +#include /** * Type definition for serial flash memory. @@ -57,11 +56,11 @@ typedef uint8_t flash25Offset_t; /** * Flash25 KFile context structure. */ -typedef struct KFileFlash25 +typedef struct Flash25KFile { KFile fd; ///< File descriptor. KFile *channel; ///< Dataflash comm channel (usually SPI). -} KFileFlash25; +} Flash25KFile; /** * ID for dataflash. @@ -70,12 +69,12 @@ typedef struct KFileFlash25 /** - * Convert + ASSERT from generic KFile to KFileFlash25. + * Convert + ASSERT from generic KFile to Flash25KFile. */ -INLINE KFileFlash25 * KFILEFLASH25(KFile *fd) +INLINE Flash25KFile * FLASH25KFILE(KFile *fd) { ASSERT(fd->_type == KFT_FLASH25); - return (KFileFlash25 *)fd; + return (Flash25KFile *)fd; } /** @@ -132,9 +131,9 @@ typedef enum { FLASH25_SECT4 = 0x30000, ///< Sector 4 (0x30000 -0x3FFFF) } Flash25Sector; -void flash25_init(KFileFlash25 *fd, KFile *ch); -void flash25_chipErase(KFileFlash25 *fd); -void flash25_sectorErase(KFileFlash25 *fd, Flash25Sector sector); +void flash25_init(Flash25KFile *fd, KFile *ch); +void flash25_chipErase(Flash25KFile *fd); +void flash25_sectorErase(Flash25KFile *fd, Flash25Sector sector); bool flash25_test(KFile *channel); #endif /* DRV_FLASH25_H */