Tool/software: TI-RTOS
In example PRU_Hardware_UART(AM437x, PRU Software Support Package release 3.0) , we can acccess the pro_uart0 registers like this:
* 192MHz / 104 / 16 = ~115200 */
CT_UART.DLL = 104;
CT_UART.DLH = 0;
CT_UART.MDR = 0x0;
* Receive Data Available and Transmit Holding Register Empty */
CT_UART.IER = 0x7;
* FIFOs by writing to FCR. FIFOEN bit in FCR must be set first before
* other bits are configured */
/* Enable FIFOs for now at 1-byte, and flush them */
CT_UART.FCR = (0x8) | (0x4) | (0x2) | (0x1);
//CT_UART.FCR = (0x80) | (0x4) | (0x2) | (0x01); // 8-byte RX FIFO trigger
/* 8-bit word, 1 stop bit, no parity, no break control and no divisor latch */
CT_UART.LCR = 3;
/* Load character, ensure it is not string termination */
if ((tx = hostBuffer.data[cnt]) == '\0')
break;
CT_UART.THR = tx;
* indicating there is data in the RX FIFO */
while ((CT_UART.LSR & 0x1) == 0x0);
buffer[cnt] = CT_UART.RBR;
while (!((CT_UART.FCR & 0x2) == 0x2));
}