RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
dev
spi
cadence-spi-regs.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
* Copyright (C) 2021 Jan Sommer, German Aerospace Center (DLR)
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
8
* are met:
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution.
14
*
15
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
* POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#ifndef LIBBSP_ARM_XILINX_ZYNQ_CADENCE_SPI_REGS_H
29
#define LIBBSP_ARM_XILINX_ZYNQ_CADENCE_SPI_REGS_H
30
31
#include <
bsp/utility.h
>
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
37
typedef
struct
{
38
uint32_t config;
39
#define CADENCE_SPI_CONFIG_MODEFAIL_EN BSP_BIT32(17)
40
#define CADENCE_SPI_CONFIG_MANSTRT BSP_BIT32(16)
41
#define CADENCE_SPI_CONFIG_MANSTRT_EN BSP_BIT32(15)
42
#define CADENCE_SPI_CONFIG_MANUAL_CS BSP_BIT32(14)
43
#define CADENCE_SPI_CONFIG_CS(val) BSP_FLD32(val, 10, 13)
44
#define CADENCE_SPI_CONFIG_CS_GET(reg) BSP_FLD32GET(reg, 10, 13)
45
#define CADENCE_SPI_CONFIG_CS_SET(reg, val) BSP_FLD32SET(reg, val, 10, 13)
46
#define CADENCE_SPI_CONFIG_PERI_SEL BSP_BIT32(9)
47
#define CADENCE_SPI_CONFIG_REF_CLK BSP_BIT32(8)
48
#define CADENCE_SPI_CONFIG_BAUD_DIV(val) BSP_FLD32(val, 3, 5)
49
#define CADENCE_SPI_CONFIG_BAUD_DIV_GET(reg) BSP_FLD32GET(reg, 3, 5)
50
#define CADENCE_SPI_CONFIG_BAUD_DIV_SET(reg, val) BSP_FLD32SET(reg, val, 3, 5)
51
#define CADENCE_SPI_CONFIG_CLK_PH BSP_BIT32(2)
52
#define CADENCE_SPI_CONFIG_CLK_POL BSP_BIT32(1)
53
#define CADENCE_SPI_CONFIG_MSTREN BSP_BIT32(0)
54
uint32_t irqstatus;
55
uint32_t irqenable;
56
uint32_t irqdisable;
57
uint32_t irqmask;
58
#define CADENCE_SPI_IXR_TXUF BSP_BIT32(6)
59
#define CADENCE_SPI_IXR_RXFULL BSP_BIT32(5)
60
#define CADENCE_SPI_IXR_RXNEMPTY BSP_BIT32(4)
61
#define CADENCE_SPI_IXR_TXFULL BSP_BIT32(3)
62
#define CADENCE_SPI_IXR_TXOW BSP_BIT32(2)
63
#define CADENCE_SPI_IXR_MODF BSP_BIT32(1)
64
#define CADENCE_SPI_IXR_RXOVR BSP_BIT32(0)
65
uint32_t spienable;
66
#define CADENCE_SPI_EN BSP_BIT32(0)
67
uint32_t delay;
68
#define CADENCE_SPI_DELAY_DNSS(val) BSP_FLD32(val, 24, 31)
69
#define CADENCE_SPI_DELAY_DNSS_GET(reg) BSP_FLD32GET(reg, 24, 31)
70
#define CADENCE_SPI_DELAY_DNSS_SET(reg, val) BSP_FLD32SET(reg, val, 24, 31)
71
#define CADENCE_SPI_DELAY_DBTWN(val) BSP_FLD32(val, 16, 23)
72
#define CADENCE_SPI_DELAY_DBTWN_GET(reg) BSP_FLD32GET(reg, 16, 23)
73
#define CADENCE_SPI_DELAY_DBTWN_SET(reg, val) BSP_FLD32SET(reg, val, 16, 23)
74
#define CADENCE_SPI_DELAY_DAFTER(val) BSP_FLD32(val, 8, 15)
75
#define CADENCE_SPI_DELAY_DAFTER_GET(reg) BSP_FLD32GET(reg, 8, 15)
76
#define CADENCE_SPI_DELAY_DAFTER_SET(reg, val) BSP_FLD32SET(reg, val, 8, 15)
77
#define CADENCE_SPI_DELAY_DINT(val) BSP_FLD32(val, 0, 7)
78
#define CADENCE_SPI_DELAY_DINT_GET(reg) BSP_FLD32GET(reg, 0, 7)
79
#define CADENCE_SPI_DELAY_DINT_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
80
uint32_t txdata;
81
uint32_t rxdata;
82
uint32_t slave_idle_count;
83
uint32_t txthreshold;
84
uint32_t rxthreshold;
85
uint32_t unused[51];
86
uint32_t moduleid;
87
}
cadence_spi
;
88
89
#ifdef __cplusplus
90
}
91
#endif
92
93
#endif
/* LIBBSP_ARM_XILINX_ZYNQ_CADENCE_SPI_REGS_H */
utility.h
This header file provides utility macros for BSPs.
cadence_spi
Definition
cadence-spi-regs.h:37
Generated by
1.18.0