00001
00002
00003
00004
00005
00006
00007
00008
00016
00017
00018 #ifndef ASAP_H
00019 #define ASAP_H
00020
00021
00022 #include "xbasic_types.h"
00023 #include "xstatus.h"
00024 #include "asap_config.h"
00025
00026
00027
00028
00029 typedef struct {
00030 u16 DeviceID;
00031 u32 BaseAddress;
00032 } Asap_Config;
00033
00034
00035 typedef struct {
00036 u32 BaseAddress;
00037 u32 IsReady;
00038 } Asap;
00039
00040
00041 typedef struct {
00042 Xuint32 LConfig : 32;
00043 Xuint32 : 24,
00044 UConfig : 8;
00045 Xuint32 LAddress : 32;
00046 Xuint32 : 24,
00047 UAddress : 8;
00048 Xuint32 : 29,
00049 reset_spi : 1,
00050 reset_cold : 1,
00051 start_spi : 1;
00052 Xuint32 slv_reg5 : 32;
00053 Xuint32 : 29,
00054 hold : 1,
00055 send : 1,
00056 miso_rdy : 1;
00057 Xuint32 : 12,
00058 miso_read : 20;
00059 } Asap_Bitfield;
00060
00061
00062
00063 void Asap_ColdReset(Asap *InstancePtr);
00064 XStatus Asap_Initialize(Asap *InstancePtr, u16 DeviceID);
00065 Asap_Config* Asap_LookupConfig(u16 DeviceID);
00066 int Asap_miso_rdy(Asap *InstancePtr);
00067 u32 Asap_Read(Asap *InstancePtr, u32 RegNumber);
00068 u32 Asap_ReadSpieMiso(Asap *InstancePtr);
00069 void Asap_StartTransaction(Asap *InstancePtr);
00070 void Asap_Write(Asap *InstancePtr, u32 RegNumber, u32 Data);
00071
00072
00073 #endif