|
| enum | hal_spi_dma_control_t {
HAL_SPI_DMA_CONTROL_DISABLE = 0
, HAL_SPI_DMA_CONTROL_RX_ENABLE = 1
, HAL_SPI_DMA_CONTROL_TX_ENABLE = 2
, HAL_SPI_DMA_CONTROL_TXRX_ENABLE = 3
,
HAL_SPI_DMA_CONTROL_MAX_NUM
, HAL_SPI_DMA_CONTROL_NONE = HAL_SPI_DMA_CONTROL_MAX_NUM
} |
| | Spi dma control register. 更多...
|
| |
| enum | spi_mode { SPI_MODE_SLAVE
, SPI_MODE_MASTER
, SPI_MODE_MAX_NUM
, SPI_MODE_NONE = SPI_MODE_MAX_NUM
} |
| | SPI mode. 更多...
|
| |
| enum | spi_slave { SPI_SLAVE0 = 0
, SPI_SLAVE1
, SPI_SLAVE_MAX_NUM
, SPI_SLAVE_NONE = SPI_SLAVE_MAX_NUM
} |
| | SPI slave select. 更多...
|
| |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2023. All rights reserved.
Description: Provides spi porting template
History:
2022-08-18, Create file.
◆ CONFIG_SPI_MAX_TIMEOUT
| #define CONFIG_SPI_MAX_TIMEOUT 0xFFFFFFFF |
◆ CONFIG_SPI_SUPPORT_CRC
| #define CONFIG_SPI_SUPPORT_CRC 1 |
◆ CONFIG_SPI_SUPPORT_INTERRUPT
| #define CONFIG_SPI_SUPPORT_INTERRUPT 1 |
◆ CONFIG_SPI_SUPPORT_LOOPBACK
| #define CONFIG_SPI_SUPPORT_LOOPBACK 1 |
◆ CONFIG_SPI_SUPPORT_MASTER
| #define CONFIG_SPI_SUPPORT_MASTER 1 |
◆ CONFIG_SPI_SUPPORT_SLAVE
| #define CONFIG_SPI_SUPPORT_SLAVE 1 |
◆ DMA_HANDSHAKE_SPI_BUS_0_RX
◆ DMA_HANDSHAKE_SPI_BUS_0_TX
◆ DMA_HANDSHAKE_SPI_BUS_1_RX
◆ DMA_HANDSHAKE_SPI_BUS_1_TX
◆ SPI_BUS_MAX_NUM
◆ SPI_CLK_FREQ
| #define SPI_CLK_FREQ 32000000 |
◆ spi_mode_t
◆ spi_slave_t
◆ hal_spi_dma_control_t
Spi dma control register.
| 枚举值 |
|---|
| HAL_SPI_DMA_CONTROL_DISABLE | Disables the transmit fifo and the receive fifo dma channel.
|
| HAL_SPI_DMA_CONTROL_RX_ENABLE | Enables the receive fifo dma channel.
|
| HAL_SPI_DMA_CONTROL_TX_ENABLE | Enables the transmit fifo dma channel.
|
| HAL_SPI_DMA_CONTROL_TXRX_ENABLE | Enables the transmit fifo and the receive fifo dma channel.
|
| HAL_SPI_DMA_CONTROL_MAX_NUM | |
| HAL_SPI_DMA_CONTROL_NONE | |
◆ spi_mode
SPI mode.
| 枚举值 |
|---|
| SPI_MODE_SLAVE | SPI Slave mode.
|
| SPI_MODE_MASTER | SPI Master mode.
|
| SPI_MODE_MAX_NUM | |
| SPI_MODE_NONE | |
◆ spi_slave
SPI slave select.
| 枚举值 |
|---|
| SPI_SLAVE0 | SPI Slave index 0.
|
| SPI_SLAVE1 | SPI Slave index 1.
|
| SPI_SLAVE_MAX_NUM | |
| SPI_SLAVE_NONE | |
◆ spi_port_get_dma_trans_dest_handshaking()
| uint8_t spi_port_get_dma_trans_dest_handshaking |
( |
spi_bus_t |
bus | ) |
|
Get the DMA destination handshaking select of SPI transfer.
- 参数
-
- 返回
- The DMA destination handshaking select of spi transfer.
◆ spi_port_get_dma_trans_src_handshaking()
| uint8_t spi_port_get_dma_trans_src_handshaking |
( |
spi_bus_t |
bus | ) |
|
Get the DMA source handshaking select of SPI transfer.
- 参数
-
- 返回
- The DMA source handshaking select of SPI transfer.
◆ spi_port_register_irq()
Register the interrupt of spis.
- 参数
-
| [in] | bus | The bus index of SPI. |
◆ spi_port_rx_data_level_get()
| uint8_t spi_port_rx_data_level_get |
( |
spi_bus_t |
bus | ) |
|
Get the SPI DMA RX level of SPI transfer.
- 参数
-
- 返回
- The SPI DMA RX level.
◆ spi_port_tx_data_level_get()
| uint8_t spi_port_tx_data_level_get |
( |
spi_bus_t |
bus | ) |
|
Get the SPI DMA TX level.
- 参数
-
- 返回
- The SPI DMA TX level.
◆ spi_port_unregister_irq()
| void spi_port_unregister_irq |
( |
spi_bus_t |
bus | ) |
|
unRegister the interrupt of spis.
- 参数
-
| [in] | bus | The bus index of SPI. |
◆ spi_porting_base_addr_get()
Get the base address of specified spi.
- 参数
-
| [in] | bus | The bus index of SPI. |
- 返回
- The base address of specified spi.
◆ spi_porting_clock_init()
| void spi_porting_clock_init |
( |
uint32_t |
bus_clk | ) |
|
SPI clock int.
- 参数
-
| [in] | bus_clk | The SPI bus clock. |
◆ spi_porting_get_device_mode()
Get the spi work mode.
- 参数
-
| [in] | bus | The bus index of SPI. |
- 返回
- The mode of SPI.
◆ spi_porting_lock()
SPI lock.
- 参数
-
| [in] | bus | The bus index of SPI. |
- 返回
- The irq lock number of SPI.
◆ spi_porting_max_slave_select_get()
| uint32_t spi_porting_max_slave_select_get |
( |
spi_bus_t |
bus | ) |
|
Get the max slave number can be selected.
- 参数
-
| [in] | bus | The bus index of SPI. |
- 返回
- The max slave number can be selected.
◆ spi_porting_set_device_mode()
Set the spi work mode.
- 参数
-
| [in] | bus | The bus index of SPI. |
| [in] | mode | The mode of SPI. |
◆ spi_porting_unlock()
| void spi_porting_unlock |
( |
spi_bus_t |
bus, |
|
|
uint32_t |
irq_sts |
|
) |
| |
SPI unlock.
- 参数
-
| [in] | bus | The bus index of SPI. |
| [in] | irq_sts | The irq lock number of SPI. |
◆ g_spi_base_addrs
Base address list for all of the IPs.