目標(biāo):驅(qū)動(dòng)CH382通過串口發(fā)送數(shù)據(jù)
問題:PCIe的RC訪問PCIe時(shí)要求4字節(jié)對(duì)齊訪問,目前串口可以發(fā)送數(shù)據(jù),但是波特率不對(duì),看上去就像是波特率分頻寄存器的值全是FF,程序如下:
初始化:
? /*
? *(uint32_t *)((char*)pcieIOBase + 0xC0 + LCR) = 0x80;
? *(uint32_t *)((char*)pcieIOBase + 0xC0 + DLL) = 0x0C;
? *(uint32_t *)((char*)pcieIOBase + 0xC0 + DLM) = 0x00;
? *(uint32_t *)((char*)pcieIOBase + 0xC0 + LCR) = 0x03;
? *(uint32_t *)((char*)pcieIOBase + 0xC0 + FCR) = 0x01;
*/
? *(uint32_t *)((char*)pcieIOBase + 0xC0) = 0x80000000;
? *(uint32_t *)((char*)pcieIOBase + 0xC0) = 0x8000000C;
? *(uint32_t *)((char*)pcieIOBase + 0xC0) = 0x0300000C;
? *(uint32_t *)((char*)pcieIOBase + 0xC0) = 0x03010000;
發(fā)送:
*(uint32_t *)((char*)pcieIOBase + 0xC0 + 0) = i + 0x03010000;
由于對(duì)CH382內(nèi)部PCIe處理情況不是很了解,上述代碼是否存在問題呢?