C:/EDK_Projects/SPI_Project_JWW/TestApp_ASAP_SPI/src/asap.c File Reference
#include "xparameters.h"
#include "xio.h"
#include "asap.h"
#include "asap_i.h"
Go to the source code of this file.
Detailed Description
The implementation of the Asap component's basic functionality. See
asap.h for more information about the component.
Definition in file asap.c.
Function Documentation
void Asap_ColdReset |
( |
Asap * |
InstancePtr |
) |
|
Perform cold reset on AsAP by toggling Reg4[1] HLH.
- Parameters:
-
| InstancePtr | is the pointer to an Asap instance to be worked on. |
- Returns:
- None.
Definition at line 39 of file asap.c.
XStatus Asap_Initialize |
( |
Asap * |
InstancePtr, |
|
|
u16 |
DeviceID | |
|
) |
| | |
Initialize the AsAP instance provided by the caller based on the given DeviceID.
- Parameters:
-
| InstancePtr | is a pointer to the AsAP instance. |
| DeviceID | is the unique ID of the device. |
- Returns:
- XST_SUCCESS Initialization was successfull.
- XST_DEVICE_NOT_FOUND Device configuration data was not found.
Definition at line 63 of file asap.c.
Asap_Config* Asap_LookupConfig |
( |
u16 |
DeviceID |
) |
|
Lookup the device configuration based on teh unique device ID. Asap_ConfigTable contains the configuration info for each device.
- Parameters:
-
| DeviceID | is the device ID to be looked up |
- Returns:
- Asap_Config pointer if device is found.
- NULL if device is not found
Definition at line 104 of file asap.c.
int Asap_miso_rdy |
( |
Asap * |
InstancePtr |
) |
|
Returns the value of miso_rdy
- Parameters:
-
| InstancePtr | is a pointer to the AsAP instance. |
- Returns:
- miso_rdy
Definition at line 130 of file asap.c.
u32 Asap_Read |
( |
Asap * |
InstancePtr, |
|
|
u32 |
RegNumber | |
|
) |
| | |
Read one of the registers of the device.
- Parameters:
-
| InstancePtr | is the pointer to an Asap instance to be worked on. |
| RegNumber | is the register number to be worked on. |
- Returns:
- Current state of register
- Note:
This function only returns the state of one 32-bit register. This function assumes that each registers are 4 bytes apart.
Definition at line 156 of file asap.c.
u32 Asap_ReadSpieMiso |
( |
Asap * |
InstancePtr |
) |
|
Reads the SPIE MISO Read data.
- Parameters:
-
| InstancePtr | is the pointer to an Asap instance to be worked on. |
- Returns:
- Current state of SPIE MISO Read register
Definition at line 179 of file asap.c.
void Asap_StartTransaction |
( |
Asap * |
InstancePtr |
) |
|
Start SPIE transaction by toggling Reg4[0] LHL.
- Parameters:
-
| InstancePtr | is the pointer to an Asap instance to be worked on. |
- Returns:
- None.
Definition at line 201 of file asap.c.
void Asap_Write |
( |
Asap * |
InstancePtr, |
|
|
u32 |
RegNumber, |
|
|
u32 |
Data | |
|
) |
| | |
32-bits are written to one of the registers of the device. For a Data value of lower width, the LSB's are written to.
- Parameters:
-
| InstancePtr | is the pointer to an Asap instance to be worked on. |
| RegNumber | is the register number to be worked on. |
| Data | is the data written to the register. |
- Returns:
- None.
- Note:
- This function assumes that each registers are 4 bytes apart.
Definition at line 226 of file asap.c.