14 #include "spi_host_regs.h"
19 if (spi_host == NULL) {
30 if (spi_host == NULL) {
37 alert_idx = SPI_HOST_ALERT_TEST_FATAL_FAULT_BIT;
45 (ptrdiff_t)SPI_HOST_ALERT_TEST_REG_OFFSET,
58 *index_out = SPI_HOST_INTR_COMMON_ERROR_BIT;
61 *index_out = SPI_HOST_INTR_COMMON_SPI_EVENT_BIT;
83 *type = irq_types[irq];
92 if (spi_host == NULL || snapshot == NULL) {
96 *snapshot = mmio_region_read32(spi_host->
base_addr,
97 (ptrdiff_t)SPI_HOST_INTR_STATE_REG_OFFSET);
106 if (spi_host == NULL) {
111 (ptrdiff_t)SPI_HOST_INTR_STATE_REG_OFFSET, snapshot);
120 if (spi_host == NULL || is_pending == NULL) {
125 if (!spi_host_get_irq_bit_index(irq, &index)) {
129 uint32_t intr_state_reg = mmio_region_read32(
130 spi_host->
base_addr, (ptrdiff_t)SPI_HOST_INTR_STATE_REG_OFFSET);
139 if (spi_host == NULL) {
145 (ptrdiff_t)SPI_HOST_INTR_STATE_REG_OFFSET, UINT32_MAX);
153 if (spi_host == NULL) {
158 if (!spi_host_get_irq_bit_index(irq, &index)) {
165 (ptrdiff_t)SPI_HOST_INTR_STATE_REG_OFFSET,
174 if (spi_host == NULL) {
179 if (!spi_host_get_irq_bit_index(irq, &index)) {
185 (ptrdiff_t)SPI_HOST_INTR_TEST_REG_OFFSET, intr_test_reg);
194 if (spi_host == NULL || state == NULL) {
199 if (!spi_host_get_irq_bit_index(irq, &index)) {
203 uint32_t intr_enable_reg = mmio_region_read32(
204 spi_host->
base_addr, (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET);
216 if (spi_host == NULL) {
221 if (!spi_host_get_irq_bit_index(irq, &index)) {
225 uint32_t intr_enable_reg = mmio_region_read32(
226 spi_host->
base_addr, (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET);
231 (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET,
241 if (spi_host == NULL) {
246 if (snapshot != NULL) {
247 *snapshot = mmio_region_read32(spi_host->
base_addr,
248 (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET);
253 (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET, 0u);
262 if (spi_host == NULL || snapshot == NULL) {
267 (ptrdiff_t)SPI_HOST_INTR_ENABLE_REG_OFFSET, *snapshot);