Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_xFlash.h
Go to the documentation of this file.
1 
51 #ifndef __XFLASH_H
52 #define __XFLASH_H
53 
54 #include "HardwareProfile.h"
55 
56 #if !defined(SPIFLASH_CS_TRIS)
57 #error "SPIFLASH_CS_TRIS is not defined!"
58 #endif
59 
60 #if !defined(SPI_FLASH_SECTOR_SIZE)
61  #error "SPI_FLASH_SECTOR_SIZE not defined!"
62 #endif
63 #if !defined(SPI_FLASH_PAGE_SIZE)
64  #error "SPI_FLASH_PAGE_SIZE not defined!"
65 #endif
66 
67 #define SPI_FLASH_SECTOR_MASK (SPI_FLASH_SECTOR_SIZE - 1)
68 #define SPI_FLASH_PAGE_MASK (SPI_FLASH_PAGE_SIZE - 1)
69 
70 
72 //Alternative function names, use by Microchip Stack
73 #define SPIFlashInit xflashInit
74 #define SPIFlashReadArray xflashReadArray
75 #define SPIFlashBeginWrite xflashBeginWrite
76 #define SPIFlashWrite xflashWrite
77 #define SPIFlashWriteArray xflashWriteArray
78 #define SPIFlashEraseSector xflashEraseSector
79 
80 
88 void xflashInit(void);
89 
90 
100 void xflashReadArray(DWORD dwAddress, BYTE *vData, WORD wLen);
101 
102 
125 void xflashBeginWrite(DWORD dwAddr);
126 
127 
147 void xflashWrite(BYTE vData);
148 
149 
174 void xflashWriteArray(BYTE *vData, WORD wLen, BOOL bEraseSector);
175 
176 
188 void xflashEraseSector(DWORD dwAddr);
189 
190 
191 #endif