Peter Pearse | 051c257 | 2007-08-14 10:14:05 +0100 | [diff] [blame] | 1 | |
| 2 | #ifndef _AT45_H_ |
| 3 | #define _AT45_H_ |
| 4 | #ifdef DATAFLASH_MMC_SELECT |
| 5 | extern void AT91F_SelectMMC(void); |
| 6 | extern void AT91F_SelectSPI(void); |
| 7 | extern int AT91F_GetMuxStatus(void); |
| 8 | #endif |
| 9 | extern void AT91F_SpiInit(void); |
| 10 | extern void AT91F_SpiEnable(int cs); |
| 11 | extern unsigned int AT91F_SpiWrite ( AT91PS_DataflashDesc pDesc ); |
| 12 | extern AT91S_DataFlashStatus AT91F_DataFlashSendCommand( |
| 13 | AT91PS_DataFlash pDataFlash, |
| 14 | unsigned char OpCode, |
| 15 | unsigned int CmdSize, |
| 16 | unsigned int DataflashAddress); |
| 17 | extern AT91S_DataFlashStatus AT91F_DataFlashGetStatus ( |
| 18 | AT91PS_DataflashDesc pDesc); |
| 19 | extern AT91S_DataFlashStatus AT91F_DataFlashWaitReady ( |
Wolfgang Denk | 0611c49 | 2007-08-14 18:42:36 +0200 | [diff] [blame] | 20 | AT91PS_DataflashDesc pDataFlashDesc, |
Peter Pearse | 051c257 | 2007-08-14 10:14:05 +0100 | [diff] [blame] | 21 | unsigned int timeout); |
| 22 | extern AT91S_DataFlashStatus AT91F_DataFlashContinuousRead ( |
| 23 | AT91PS_DataFlash pDataFlash, |
| 24 | int src, |
| 25 | unsigned char *dataBuffer, |
| 26 | int sizeToRead ); |
| 27 | extern AT91S_DataFlashStatus AT91F_DataFlashPagePgmBuf( |
| 28 | AT91PS_DataFlash pDataFlash, |
| 29 | unsigned char *src, |
| 30 | unsigned int dest, |
| 31 | unsigned int SizeToWrite); |
| 32 | extern AT91S_DataFlashStatus AT91F_MainMemoryToBufferTransfert( |
| 33 | AT91PS_DataFlash pDataFlash, |
| 34 | unsigned char BufferCommand, |
| 35 | unsigned int page); |
| 36 | extern AT91S_DataFlashStatus AT91F_DataFlashWriteBuffer ( |
| 37 | AT91PS_DataFlash pDataFlash, |
| 38 | unsigned char BufferCommand, |
| 39 | unsigned char *dataBuffer, |
| 40 | unsigned int bufferAddress, |
| 41 | int SizeToWrite ); |
| 42 | extern AT91S_DataFlashStatus AT91F_PageErase( |
| 43 | AT91PS_DataFlash pDataFlash, |
| 44 | unsigned int page); |
| 45 | extern AT91S_DataFlashStatus AT91F_BlockErase( |
| 46 | AT91PS_DataFlash pDataFlash, |
| 47 | unsigned int block); |
| 48 | extern AT91S_DataFlashStatus AT91F_WriteBufferToMain ( |
| 49 | AT91PS_DataFlash pDataFlash, |
| 50 | unsigned char BufferCommand, |
| 51 | unsigned int dest ); |
| 52 | extern AT91S_DataFlashStatus AT91F_PartialPageWrite ( |
| 53 | AT91PS_DataFlash pDataFlash, |
| 54 | unsigned char *src, |
| 55 | unsigned int dest, |
| 56 | unsigned int size); |
| 57 | extern AT91S_DataFlashStatus AT91F_DataFlashWrite( |
| 58 | AT91PS_DataFlash pDataFlash, |
| 59 | unsigned char *src, |
| 60 | int dest, |
| 61 | int size ); |
| 62 | extern int AT91F_DataFlashRead( |
| 63 | AT91PS_DataFlash pDataFlash, |
| 64 | unsigned long addr, |
| 65 | unsigned long size, |
| 66 | char *buffer); |
| 67 | extern int AT91F_DataflashProbe(int cs, AT91PS_DataflashDesc pDesc); |
| 68 | |
| 69 | #endif |