Mercurial > flash_v2
comparison packages/devs/flash/atmel/dataflash/current/include/dataflash.h @ 1768:ef75ad79dfe3
* include/dataflash.h: Allow the package to be compiled without
io/flash. Return correct value from cyg_dataflash_get_page_count()
| author | asl |
|---|---|
| date | Wed, 29 Jun 2005 20:12:42 +0000 |
| parents | 96ec7e534d98 |
| children |
comparison
equal
deleted
inserted
replaced
| 1767:2ca70385b0f4 | 1768:ef75ad79dfe3 |
|---|---|
| 95 int state; // Current state (IDLE, BUSY, ...) | 95 int state; // Current state (IDLE, BUSY, ...) |
| 96 cyg_uint8 busy_buf; // Current busy buffer number | 96 cyg_uint8 busy_buf; // Current busy buffer number |
| 97 } cyg_dataflash_device_t; | 97 } cyg_dataflash_device_t; |
| 98 | 98 |
| 99 //---------------------------------------------------------------------------- | 99 //---------------------------------------------------------------------------- |
| 100 | 100 #ifdef CYGPKG_IO_FLASH |
| 101 #include <cyg/io/flash.h> | 101 #include <cyg/io/flash.h> |
| 102 #include <cyg/io/flash_dev.h> | 102 #include <cyg/io/flash_dev.h> |
| 103 | 103 |
| 104 typedef struct cyg_dataflash_flash_dev_priv_s | 104 typedef struct cyg_dataflash_flash_dev_priv_s |
| 105 { | 105 { |
| 127 1, \ | 127 1, \ |
| 128 cyg_dataflash_priv_ ## name.block_info, \ | 128 cyg_dataflash_priv_ ## name.block_info, \ |
| 129 & cyg_dataflash_priv_ ## name \ | 129 & cyg_dataflash_priv_ ## name \ |
| 130 ) | 130 ) |
| 131 | 131 |
| 132 #endif | |
| 132 //---------------------------------------------------------------------------- | 133 //---------------------------------------------------------------------------- |
| 133 | 134 |
| 134 static inline cyg_uint8 | 135 static inline cyg_uint8 |
| 135 cyg_dataflash_get_device_id(cyg_dataflash_device_t *dev) | 136 cyg_dataflash_get_device_id(cyg_dataflash_device_t *dev) |
| 136 { | 137 { |
| 144 } | 145 } |
| 145 | 146 |
| 146 static inline cyg_uint16 | 147 static inline cyg_uint16 |
| 147 cyg_dataflash_get_page_count(cyg_dataflash_device_t *dev) | 148 cyg_dataflash_get_page_count(cyg_dataflash_device_t *dev) |
| 148 { | 149 { |
| 149 return dev->info->page_size; | 150 return dev->info->page_count; |
| 150 } | 151 } |
| 151 | 152 |
| 152 static inline cyg_uint16 | 153 static inline cyg_uint16 |
| 153 cyg_dataflash_get_block_size(cyg_dataflash_device_t *dev) | 154 cyg_dataflash_get_block_size(cyg_dataflash_device_t *dev) |
| 154 { | 155 { |
