Hi Dialog:
Can you support a Demo about DA14585 IIC DMA ?
My email islucien.kuang@skynoon.com。
My debug code As follows(can't not send data):
static void hw_dma_transfer_callback(void *user_data, uint16_t len)
{
arch_printf("hw_dma_transfer_callback\n");
}
static DMA_setup DMA_Setup_for_PDM_to_buffer;
uint8_t p_arr[20] = {'1','2','3','4','5','6','7',0x55,0x56,0x57,0x58,0x59,0x60,0x61,0x62,0x63,0x64,0x65,};
static void DMA_init(void)
{
DMA_Setup_for_PDM_to_buffer。channel_number = DMA_CHANNEL_0;
DMA_Setup_for_PDM_to_buffer。src_address = (uint32_t)p_arr;
DMA_Setup_for_PDM_to_buffer。a_inc = DMA_AINC_FALSE;
DMA_Setup_for_PDM_to_buffer。b_inc = DMA_BINC_TRUE;
DMA_Setup_for_PDM_to_buffer。bus_width = DMA_BW_BYTE;
DMA_Setup_for_PDM_to_buffer。callback = hw_dma_transfer_callback;
DMA_Setup_for_PDM_to_buffer。dma_idle = DMA_IDLE_INTERRUPTING_MODE;
DMA_Setup_for_PDM_to_buffer。dma_init = DMA_INIT_AX_BX_AY_BY;
DMA_Setup_for_PDM_to_buffer。dma_prio = DMA_PRIO_3;
DMA_Setup_for_PDM_to_buffer。dma_req_mux = DMA_TRIG_I2C_RXTX;
DMA_Setup_for_PDM_to_buffer。dreq_mode = DMA_DREQ_TRIGGERED;
DMA_Setup_for_PDM_to_buffer。irq_enable = DMA_IRQ_STATE_ENABLED;
DMA_Setup_for_PDM_to_buffer。user_data = NULL;
DMA_Setup_for_PDM_to_buffer。dma_sense = DMA_SENSE_LEVEL_SENSITIVE;
DMA_Setup_for_PDM_to_buffer。circular = DMA_MODE_NORMAL;
DMA_Setup_for_PDM_to_buffer。dest_address = I2C_DATA_CMD_REG;//(uint32_t)input_buffer;
DMA_Setup_for_PDM_to_buffer。length = 20;//PDM_INPUT_BUFFER_LENGTH;
DMA_Setup_for_PDM_to_buffer。irq_nr_of_trans = 0;
dma_channel_initialization(&DMA_Setup_for_PDM_to_buffer);
}
void dma_start(void)
{
//DMA_init(NULL, 20);
dma_channel_enable(DMA_Setup_for_PDM_to_buffer.channel_number, DMA_STATE_ENABLED);
}
void dma_stop(void)
{
//assumption is that pdm_mic_stop is called after DMA_init thus
//DMA_Setup_for_PDM_to_buffer.channel_number is valid
dma_channel_stop(DMA_Setup_for_PDM_to_buffer.channel_number);
}
void test_DMA_function(void)
{
i2c_eeprom_init(KX022_ADDR,I2C_STANDARD,I2C_7BIT_ADDR,I2C_1BYTE_ADDR);
DMA_init();
dma_start();
}
Hi lucienkuang,
A local dialog FAE will be in touch in order to provide support on this.
Thanks MT_dialog