36#ifndef LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
37#define LIBBSP_AARCH64_RASPBERRYPI_4_SPI_H
40#include <bsp/rpi-gpio.h>
45#define RPI_SPICS_LEN_LONG BSP_BIT32(25)
46#define RPI_SPICS_DMA_LEN BSP_BIT32(24)
47#define RPI_SPICS_CSPOL2 BSP_BIT32(23)
48#define RPI_SPICS_CSPOL1 BSP_BIT32(22)
49#define RPI_SPICS_CSPOL0 BSP_BIT32(21)
50#define RPI_SPICS_RXF BSP_BIT32(20)
51#define RPI_SPICS_RXR BSP_BIT32(19)
52#define RPI_SPICS_TXD BSP_BIT32(18)
53#define RPI_SPICS_RXD BSP_BIT32(17)
54#define RPI_SPICS_DONE BSP_BIT32(16)
55#define RPI_SPICS_LEN BSP_BIT32(13)
56#define RPI_SPICS_REN BSP_BIT32(12)
57#define RPI_SPICS_ADCS BSP_BIT32(11)
58#define RPI_SPICS_INTR BSP_BIT32(10)
59#define RPI_SPICS_INTD BSP_BIT32(9)
60#define RPI_SPICS_DMAEN BSP_BIT32(8)
61#define RPI_SPICS_TA BSP_BIT32(7)
62#define RPI_SPICS_CSPOL BSP_BIT32(6)
63#define RPI_SPICS_CLEAR_TX BSP_BIT32(5)
64#define RPI_SPICS_CLEAR_RX BSP_BIT32(4)
65#define RPI_SPICS_CPOL BSP_BIT32(3)
66#define RPI_SPICS_CPHA BSP_BIT32(2)
67#define RPI_SPICS_CS(val) BSP_FLD32(val, 0, 1)
68#define RPI_SPICS_CS_SET(reg,val) BSP_FLD32SET(reg, val, 0, 1)
70#define RPI_SPIFIFO_DATA(val) BSP_FLD32(val, 0, 31)
71#define RPI_SPIFIFO_DATA_GET(reg) BSP_FLD32GET(reg, 0, 31)
72#define RPI_SPIFIFO_DATA_SET(reg, val) BSP_FLD32SET(reg, val, 0, 31)
74#define RPI_SPICLK_CDIV(val) BSP_FLD32(val, 0, 15)
75#define RPI_SPICLK_CDIV_GET(reg) BSP_FLD32GET(reg, 0, 15)
76#define RPI_SPICLK_CDIV_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
78#define RPI_SPIDLEN_LEN(val) BSP_FLD32(val, 0, 15)
79#define RPI_SPIDLEN_LEN_GET(reg) BSP_FLD32GET(reg, 0, 15)
80#define RPI_SPIDLEN_LEN_SET(reg, val) BSP_FLD32SET(reg, val, 0, 15)
82#define RPI_SPILTOH_TOH(val) BSP_FLD32(val, 0, 3)
83#define RPI_SPILTOH_TOH_GET(reg) BSP_FLD32GET(reg, 0, 3)
84#define RPI_SPILTOH_TOH_SET(reg, val) BSP_FLD32SET(reg, val, 0, 3)
86#define RPI_SPIDC_RPANIC(val) BSP_FLD32(val, 24, 31)
87#define RPI_SPIDC_RPANIC_GET(reg) BSP_FLD32GET(reg, 24, 31)
88#define RPI_SPIDC_RPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 24, 31)
89#define RPI_SPIDC_RDREQ(val) BSP_FLD32(val, 16, 23)
90#define RPI_SPIDC_RDREQ_GET(reg) BSP_FLD32GET(reg, 16, 23)
91#define RPI_SPIDC_RDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 16, 23)
92#define RPI_SPIDC_TPANIC(val) BSP_FLD32(val, 8, 15)
93#define RPI_SPIDC_TPANIC_GET(reg) BSP_FLD32GET(reg, 8, 15)
94#define RPI_SPIDC_TPANIC_SET(reg, val) BSP_FLD32SET(reg, val, 8, 15)
95#define RPI_SPIDC_TDREQ(val) BSP_FLD32(val, 0, 7)
96#define RPI_SPIDC_TDREQ_GET(reg) BSP_FLD32GET(reg, 0, 7)
97#define RPI_SPIDC_TDREQ_SET(reg, val) BSP_FLD32SET(reg, val, 0, 7)
106} raspberrypi_spi_device;
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
This header file provides utility macros for BSPs.
rtems_status_code raspberrypi_spi_init(raspberrypi_spi_device device)
Register a spi device.
Definition: raspberrypi-spi.c:506
Definition: raspberrypi-spi.h:43