1 |
6 |
dkoethe |
#include "xparameters.h"
|
2 |
|
|
|
3 |
|
|
#define XSS_CR (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x00))
|
4 |
|
|
#define XSS_SR (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x01))
|
5 |
|
|
#define XSS_TD (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x02))
|
6 |
|
|
#define XSS_RD (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x03))
|
7 |
|
|
#define XSS_TX_THRESH (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x04))
|
8 |
|
|
#define XSS_RX_THRESH (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x05))
|
9 |
|
|
#define XSS_TX_DMA_CTL (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x06))
|
10 |
|
|
#define XSS_TX_DMA_ADR (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x07))
|
11 |
|
|
#define XSS_TX_DMA_NUM (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x08))
|
12 |
|
|
#define XSS_RX_DMA_CTL (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x09))
|
13 |
|
|
#define XSS_RX_DMA_ADR (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x0A))
|
14 |
|
|
#define XSS_RX_DMA_NUM (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x0B))
|
15 |
|
|
|
16 |
|
|
#define XSS_DGIE (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x10))
|
17 |
|
|
#define XSS_IPISR (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x11))
|
18 |
|
|
#define XSS_IPIER (XPAR_OPB_SPI_SLAVE_0_BASEADDR + (4* 0x12))
|
19 |
|
|
|
20 |
|
|
//XSS_SPI_CR
|
21 |
|
|
#define XSS_CR_SPE_MASK (0x01)
|
22 |
|
|
#define XSS_CR_TX_EN_MASK (0x02)
|
23 |
|
|
#define XSS_CR_RX_EN_MASK (0x04)
|
24 |
|
|
#define XSS_CR_RESET_MASK (0x08)
|
25 |
|
|
|
26 |
|
|
//XSS_SPI
|
27 |
|
|
// Transmit
|
28 |
|
|
#define XSS_SR_TX_PROG_FULL_MASK 0x0001
|
29 |
|
|
#define XSS_SR_TX_FULL_MASK 0x0002
|
30 |
|
|
#define XSS_SR_TX_OVERFLOW_MASK 0x0004
|
31 |
|
|
#define XSS_SR_TX_PROG_EMPTY_MASK 0x0008
|
32 |
|
|
#define XSS_SR_TX_EMPTY_MASK 0x0010
|
33 |
|
|
#define XSS_SR_TX_UNDERFLOW_MASK 0x0020
|
34 |
|
|
// Receive
|
35 |
|
|
#define XSS_SR_RX_PROG_FULL_MASK 0x0040
|
36 |
|
|
#define XSS_SR_RX_FULL_MASK 0x0080
|
37 |
|
|
#define XSS_SR_RX_OVERFLOW_MASK 0x0100
|
38 |
|
|
#define XSS_SR_RX_PROG_EMPTY_MASK 0x0200
|
39 |
|
|
#define XSS_SR_RX_EMPTY_MASK 0x0400
|
40 |
|
|
#define XSS_SR_RX_UNDERFLOW_MASK 0x0800
|
41 |
|
|
// Chip Select
|
42 |
|
|
#define XSS_SR_CHIP_SELECT_MASK 0x1000
|
43 |
|
|
// DMA
|
44 |
|
|
#define XSS_SR_TX_DMA_done 0x2000
|
45 |
|
|
#define XSS_SR_RX_DMA_done 0x4000
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
// Device Global Interrupt Enable
|
49 |
|
|
#define XSS_DGIE_Bit_Enable 0x0001
|
50 |
|
|
|
51 |
|
|
// Interrupt /Enable Status Register
|
52 |
|
|
#define XSS_ISR_Bit_TX_Prog_Empty 0x0001
|
53 |
|
|
#define XSS_ISR_Bit_TX_Empty 0x0002
|
54 |
|
|
#define XSS_ISR_Bit_TX_Underflow 0x0004
|
55 |
|
|
#define XSS_ISR_Bit_RX_Prog_Full 0x0008
|
56 |
|
|
#define XSS_ISR_Bit_RX_Full 0x0010
|
57 |
|
|
#define XSS_ISR_Bit_RX_Overflow 0x0020
|
58 |
|
|
#define XSS_ISR_Bit_SS_Fall 0x0040
|
59 |
|
|
#define XSS_ISR_Bit_SS_Rise 0x0080
|
60 |
|
|
#define XSS_ISR_Bit_TX_DMA_done 0x0100
|
61 |
|
|
#define XSS_ISR_Bit_RX_DMA_done 0x0200
|
62 |
|
|
|
63 |
|
|
// TX DMA Control Register
|
64 |
|
|
#define XSS_TX_DMA_CTL_EN 0x0001
|
65 |
|
|
|
66 |
|
|
// RX DMA Control Register
|
67 |
|
|
#define XSS_RX_DMA_CTL_EN 0x0001
|