123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef _DATAFLASH_MANAGER_H_
- #define _DATAFLASH_MANAGER_H_
-
- #include <avr/io.h>
- #include "../Descriptors.h"
- #include <LUFA/Common/Common.h>
- #include <LUFA/Drivers/USB/USB.h>
- #include <LUFA/Drivers/Board/Dataflash.h>
-
- #if (DATAFLASH_PAGE_SIZE % 16)
- #error Dataflash page size must be a multiple of 16 bytes.
- #endif
-
-
- #define VIRTUAL_MEMORY_BYTES ((uint32_t)DATAFLASH_PAGES * DATAFLASH_PAGE_SIZE * DATAFLASH_TOTALCHIPS)
-
- #define VIRTUAL_MEMORY_BLOCK_SIZE 512
-
- #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
-
- #define DISK_READ_ONLY false
-
- void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
- const uint32_t BlockAddress,
- uint16_t TotalBlocks);
- void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
- const uint32_t BlockAddress,
- uint16_t TotalBlocks);
- void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
- uint16_t TotalBlocks,
- const uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
- void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
- uint16_t TotalBlocks,
- uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
- void DataflashManager_ResetDataflashProtections(void);
- bool DataflashManager_CheckDataflashOperation(void);
- #endif
|