Device Tables (DT) for IP spi_host and top englishbreakfast. More...
Go to the source code of this file.
Macros | |
#define | OPENTITAN_SPI_HOST_HAS_USECASE_SERIALNORFLASH 1 |
List of supported hardware features. | |
#define | OPENTITAN_SPI_HOST_HAS_USECASE_PASSTHROUGH 1 |
#define | OPENTITAN_SPI_HOST_HAS_RATE_STANDARD 1 |
#define | OPENTITAN_SPI_HOST_HAS_RATE_DUAL 1 |
#define | OPENTITAN_SPI_HOST_HAS_RATE_QUAD 1 |
#define | OPENTITAN_SPI_HOST_HAS_CONFIG_CPOL 1 |
#define | OPENTITAN_SPI_HOST_HAS_CONFIG_CLOCKDIV 1 |
#define | OPENTITAN_SPI_HOST_HAS_EVENT_WATERMARK 1 |
#define | OPENTITAN_SPI_HOST_HAS_EVENT_FULL 1 |
#define | OPENTITAN_SPI_HOST_HAS_EVENT_EMPTY 1 |
Typedefs | |
typedef enum dt_spi_host | dt_spi_host_t |
List of instances. | |
typedef enum dt_spi_host_reg_block | dt_spi_host_reg_block_t |
List of register blocks. | |
typedef enum dt_spi_host_irq | dt_spi_host_irq_t |
List of IRQs. | |
typedef enum dt_spi_host_clock | dt_spi_host_clock_t |
List of clock ports. | |
typedef enum dt_spi_host_reset | dt_spi_host_reset_t |
List of reset ports. | |
typedef enum dt_spi_host_periph_io | dt_spi_host_periph_io_t |
List of peripheral I/O. | |
Enumerations | |
enum | dt_spi_host { kDtSpiHost0 = 0 , kDtSpiHostFirst = 0 , kDtSpiHostCount = 1 } |
List of instances. More... | |
enum | dt_spi_host_reg_block { kDtSpiHostRegBlockCore = 0 , kDtSpiHostRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_spi_host_irq { kDtSpiHostIrqError = 0 , kDtSpiHostIrqSpiEvent = 1 , kDtSpiHostIrqCount = 2 } |
List of IRQs. More... | |
enum | dt_spi_host_clock { kDtSpiHostClockClk = 0 , kDtSpiHostClockCount = 1 } |
List of clock ports. More... | |
enum | dt_spi_host_reset { kDtSpiHostResetRst = 0 , kDtSpiHostResetCount = 1 } |
List of reset ports. More... | |
enum | dt_spi_host_periph_io { kDtSpiHostPeriphIoSck = 0 , kDtSpiHostPeriphIoCsb = 1 , kDtSpiHostPeriphIoSd0 = 2 , kDtSpiHostPeriphIoSd1 = 3 , kDtSpiHostPeriphIoSd2 = 4 , kDtSpiHostPeriphIoSd3 = 5 , kDtSpiHostPeriphIoCount = 6 } |
List of peripheral I/O. More... | |
Functions | |
dt_spi_host_t | dt_spi_host_from_instance_id (dt_instance_id_t inst_id) |
Get the spi_host instance from an instance ID. | |
dt_instance_id_t | dt_spi_host_instance_id (dt_spi_host_t dt) |
Get the instance ID of an instance. | |
uint32_t | dt_spi_host_reg_block (dt_spi_host_t dt, dt_spi_host_reg_block_t reg_block) |
Get the register base address of an instance. | |
dt_plic_irq_id_t | dt_spi_host_irq_to_plic_id (dt_spi_host_t dt, dt_spi_host_irq_t irq) |
Get the PLIC ID of a spi_host IRQ for a given instance. | |
dt_spi_host_irq_t | dt_spi_host_irq_from_plic_id (dt_spi_host_t dt, dt_plic_irq_id_t irq) |
Convert a global IRQ ID to a local spi_host IRQ type. | |
dt_periph_io_t | dt_spi_host_periph_io (dt_spi_host_t dt, dt_spi_host_periph_io_t sig) |
Get the peripheral I/O description of an instance. | |
dt_clock_t | dt_spi_host_clock (dt_spi_host_t dt, dt_spi_host_clock_t clk) |
Get the clock signal connected to a clock port of an instance. | |
dt_reset_t | dt_spi_host_reset (dt_spi_host_t dt, dt_spi_host_reset_t rst) |
Get the reset signal connected to a reset port of an instance. | |
Device Tables (DT) for IP spi_host and top englishbreakfast.
This file contains the type definitions and global functions of the spi_host.
Definition in file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_CONFIG_CLOCKDIV 1 |
Definition at line 99 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_CONFIG_CPOL 1 |
Definition at line 98 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_EVENT_EMPTY 1 |
Definition at line 102 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_EVENT_FULL 1 |
Definition at line 101 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_EVENT_WATERMARK 1 |
Definition at line 100 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_RATE_DUAL 1 |
Definition at line 96 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_RATE_QUAD 1 |
Definition at line 97 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_RATE_STANDARD 1 |
Definition at line 95 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_USECASE_PASSTHROUGH 1 |
Definition at line 94 of file dt_spi_host.h.
#define OPENTITAN_SPI_HOST_HAS_USECASE_SERIALNORFLASH 1 |
List of supported hardware features.
Definition at line 93 of file dt_spi_host.h.
typedef enum dt_spi_host_clock dt_spi_host_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_host_irq dt_spi_host_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_host_periph_io dt_spi_host_periph_io_t |
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_host_reg_block dt_spi_host_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef enum dt_spi_host_reset dt_spi_host_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_spi_host |
enum dt_spi_host_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtSpiHostClockClk | Clock port clk_i. |
Definition at line 60 of file dt_spi_host.h.
enum dt_spi_host_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 47 of file dt_spi_host.h.
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
Definition at line 80 of file dt_spi_host.h.
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 34 of file dt_spi_host.h.
enum dt_spi_host_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtSpiHostResetRst | Reset port rst_ni. |
Definition at line 70 of file dt_spi_host.h.
dt_clock_t dt_spi_host_clock | ( | dt_spi_host_t | dt, |
dt_spi_host_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
dt | Instance of spi_host. |
clk | Clock port. |
Definition at line 248 of file dt_spi_host.c.
dt_spi_host_t dt_spi_host_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the spi_host instance from an instance ID.
For example, dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3
.
inst_id | Instance ID. |
Note: This function only makes sense if the instance ID has device type spi_host, otherwise the returned value is unspecified.
Definition at line 180 of file dt_spi_host.c.
dt_instance_id_t dt_spi_host_instance_id | ( | dt_spi_host_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of spi_host. |
Definition at line 187 of file dt_spi_host.c.
dt_spi_host_irq_t dt_spi_host_irq_from_plic_id | ( | dt_spi_host_t | dt, |
dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local spi_host IRQ type.
dt | Instance of spi_host. |
irq | A PLIC ID that belongs to this instance. |
kDtSpiHostIrqCount
.Note: This function assumes that the PLIC ID belongs to the instance of spi_host passed in parameter. In other words, it must be the case that dt_spi_host_instance_id(dt) == dt_plic_id_to_instance_id(irq)
. Otherwise, this function will return kDtSpiHostIrqCount
.
Definition at line 209 of file dt_spi_host.c.
dt_plic_irq_id_t dt_spi_host_irq_to_plic_id | ( | dt_spi_host_t | dt, |
dt_spi_host_irq_t | irq ) |
Get the PLIC ID of a spi_host IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone
.
dt | Instance of spi_host. |
irq | A spi_host IRQ. |
Definition at line 199 of file dt_spi_host.c.
Get the peripheral I/O description of an instance.
dt | Instance of spi_host. |
sig | Requested peripheral I/O. |
Definition at line 241 of file dt_spi_host.c.
uint32_t dt_spi_host_reg_block | ( | dt_spi_host_t | dt, |
dt_spi_host_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of spi_host. |
reg_block | The register block requested. |
Definition at line 192 of file dt_spi_host.c.
dt_reset_t dt_spi_host_reset | ( | dt_spi_host_t | dt, |
dt_spi_host_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
dt | Instance of spi_host. |
rst | Reset port. |
Definition at line 255 of file dt_spi_host.c.