This commit is contained in:
刘可亮
2024-01-27 08:47:24 +08:00
parent d3bd993b5f
commit 9f7ba67007
2345 changed files with 74421 additions and 76616 deletions

View File

@@ -17,6 +17,8 @@
#define ASYNC_DATA_SIZE 64
#define DMA_SLAVE_MAXBURST_DEFAULT 0
struct aic_qspi {
struct rt_spi_bus dev;
char *name;
@@ -189,11 +191,11 @@ static rt_uint32_t drv_qspi_send(struct aic_qspi *qspi,
RT_ASSERT(message != RT_NULL);
qspi_master_handle *h;
struct qspi_bm_transfer bm_t = {0};
struct qspi_bm_transfer bm_t = { 0 };
h = &qspi->handle;
if (h->bit_mode) {
bm_t.tx_data = (uint8_t *)tx;
bm_t.tx_len = size;
bm_t.tx_bits_len = size;
ret = hal_qspi_master_transfer_bit_mode(h, &bm_t);
return ret;
}
@@ -241,11 +243,11 @@ static rt_uint32_t drv_qspi_receive(struct aic_qspi *qspi,
RT_ASSERT(size != 0);
qspi_master_handle *h;
struct qspi_bm_transfer bm_t = {0};
struct qspi_bm_transfer bm_t = { 0 };
h = &qspi->handle;
if (h->bit_mode) {
bm_t.rx_data = rx;
bm_t.rx_len = size;
bm_t.rx_bits_len = size;
ret = hal_qspi_master_transfer_bit_mode(h, &bm_t);
return ret;
}
@@ -392,14 +394,12 @@ static rt_err_t qspi_configure(struct rt_spi_device *device,
struct qspi_master_dma_config dmacfg;
rt_memset(&dmacfg, 0, sizeof(dmacfg));
dmacfg.port_id = qspi->dma_port_id;
dmacfg.tx_bus_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
dmacfg.rx_bus_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
dmacfg.tx_max_burst = 1;
#ifdef AIC_DMA_DRV_V10
dmacfg.rx_max_burst = 1;
#else
dmacfg.rx_max_burst = 8;
#endif
dmacfg.tx_bus_width = DMA_SLAVE_BUSWIDTH_UNDEFINED;
dmacfg.rx_bus_width = DMA_SLAVE_BUSWIDTH_UNDEFINED;
dmacfg.tx_max_burst = DMA_SLAVE_MAXBURST_DEFAULT;
dmacfg.rx_max_burst = DMA_SLAVE_MAXBURST_DEFAULT;
ret = hal_qspi_master_dma_config(&qspi->handle, &dmacfg);
if (ret) {
pr_err("qspi dma config failed.\n");