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