I want to set up UART to send pixel data with UART. My device is CC1352. In arduino, this is made like this:
//enable serial
UBRR0H = 0;
UBRR0L = 1;//0 = 2M baud rate. 1 = 1M baud. 3 = 0.5M. 7 = 250k 207 is 9600 baud rate.
UCSR0A |= 2;//double speed aysnc
UCSR0B = (1 << RXEN0) | (1 << TXEN0);//Enable receiver and transmitter
UCSR0C = 6;//async 1 stop bit 8bit char no parity bits
I wrote it like this:
// UART Setup
UART2_Handle uartHandle;
UART2_Params uartParams;
UART2_Params_init(&uartParams);
uartParams.baudRate = 1000000; // 1M baud rate
uartHandle = UART2_open(CONFIG_UART0, &uartParams); // Replace CC1352_UART_INSTANCE with actual UART instance
What should I write to CONFIG_UART0? It is written in its documentation in the same way.https://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.20.00.35/exports/docs/tidrivers/doxygen/html/_u_a_r_t2_8h.html
Also, I want to send pixel data to my PC to show the image. In arduino:
UDR0 = (PINC & 15) | (PIND & 240);
How can I send "uint8_t pixelData" to my PC with UART, or are there any other way?
Your help would be appreciated.