IDF版本5.0
SPI配置如下
- #define SPI_PORT SPI2_HOST
- #define SPI_MISO GPIO_NUM_13
- #define SPI_MOSI GPIO_NUM_11
- #define SPI_CLK GPIO_NUM_12
- #define SPI_CS GPIO_NUM_10
- #define SPI_WP GPIO_NUM_14
- #define SPI_HD GPIO_NUM_9
- #define QPI_BUFFER_LEN 1024
- static esp_err_t ret;
- static spi_device_handle_t spi;
- static spi_transaction_t trans;
- void QPI_Init(void)
- {
- int32_t i=0;
- spi_dma_chan_t dma = SPI_DMA_CH_AUTO;
- spi_bus_config_t buscfg={
- .miso_io_num = SPI_MISO,
- .mosi_io_num = SPI_MOSI,
- .sclk_io_num = SPI_CLK,
- .quadwp_io_num = SPI_WP,
- .quadhd_io_num = SPI_HD,
- //.max_transfer_sz = 64,
- .flags = SPICOMMON_BUSFLAG_MASTER|SPICOMMON_BUSFLAG_QUAD
- };
- ret = spi_bus_initialize(SPI_PORT, &buscfg, dma);
- spi_device_interface_config_t dev_config={
- .command_bits = 0,
- .address_bits = 0,
- .clock_speed_hz = SPI_MASTER_FREQ_80M,
- .mode = 0,
- .flags=SPI_DEVICE_HALFDUPLEX,
- .spics_io_num = SPI_CS,
- .duty_cycle_pos = 0,
- .queue_size = 6,
- //.post_cb=post_setup_cb
- };
- ret = spi_bus_add_device(SPI_PORT,&dev_config,&spi);
- memset(&trans, 0, sizeof(trans));
- memset(&qpi_rec, 0, sizeof(qpi_rec));
- trans.flags=SPI_TRANS_MODE_QIO;
- trans.tx_buffer =NULL;
- trans.rx_buffer = qpi_rec;
- trans.length = 0;
- trans.rxlength = QPI_BUFFER_LEN * 8;
- }
修改时钟频率到40M时SCLK的波形
修改时钟频率到20M时SCLK的波形
请问这个地方应该如何调整,能使用80M时钟?