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