Change the comment style for the modules and the list, and use the newParser to parse...
[bertos.git] / bertos / drv / dataflash.h
index 0b12d9d188b1d173b7c0d764e3d45eedd87f4939..5f8263f8b095a2133bf8ecd4b2917e253aeee95d 100644 (file)
  *
  * -->
  *
- * \brief Function library for dataflash AT45DB family (interface).
+ * \brief Function library for dataflash AT45DB family.
  *
  * \version $Id: dataflash.h 21658 2008-06-05 16:42:54Z asterix $
  *
  * \author Daniele Basile <asterix@develer.com>
+ *
+ * $WIZ$ module_name = "dataflash"
+ * $WIZ$ module_depends = "kfile"
+ * $WIZ$ module_configuration = "bertos/cfg/cfg_dataflash.h"
+ * }
  */
 
 
@@ -44,6 +49,7 @@
 #include <cfg/compiler.h>
 
 #include <kern/kfile.h>
+#include <fs/battfs.h>
 
 /**
  * Type definitions for dflash memory.
@@ -81,7 +87,7 @@ typedef enum DataflashType
 /**
  * Dataflash KFile context structure.
  */
-typedef struct DataFlashKFile
+typedef struct DataFlash
 {
        KFile fd;                       ///< File descriptor.
        KFile *channel;                 ///< Dataflash comm channel (usually SPI).
@@ -90,7 +96,7 @@ typedef struct DataFlashKFile
        bool page_dirty;                ///< True if current_page is dirty (needs to be flushed).
        dataflash_setReset_t *setReset; ///< Callback used to set reset pin of dataflash.
        dataflash_setCS_t *setCS;       ///< Callback used to set CS pin of dataflash.
-} DataFlashKFile;
+} DataFlash;
 
 /**
  * ID for dataflash.
@@ -98,12 +104,12 @@ typedef struct DataFlashKFile
 #define KFT_DATAFLASH MAKE_ID('D', 'F', 'L', 'H')
 
 /**
- * Convert + ASSERT from generic KFile to DataFlashKFile.
+ * Convert + ASSERT from generic KFile to DataFlash.
  */
-INLINE DataFlashKFile * DATAFLASHKFILE(KFile *fd)
+INLINE DataFlash * DATAFLASH_CAST(KFile *fd)
 {
        ASSERT(fd->_type == KFT_DATAFLASH);
-       return (DataFlashKFile *)fd;
+       return (DataFlash *)fd;
 }
 
 #define RESET_PULSE_WIDTH     10 ///< Width of reset pulse in usec.
@@ -181,7 +187,8 @@ typedef struct DataflashInfo
 } DataflashInfo;
 
 
-bool dataflash_init(DataFlashKFile *fd, KFile *ch, DataflashType type, dataflash_setCS_t *setCS, dataflash_setReset_t *setReset);
+bool dataflash_init(DataFlash *fd, KFile *ch, DataflashType type, dataflash_setCS_t *setCS, dataflash_setReset_t *setReset);
+bool dataflash_diskInit(struct BattFsSuper *d, DataFlash *fd, pgcnt_t *page_array);
 
 /**
  * To test data falsh drive you could use