This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LAUNCHXL-CC2640R2: UART write raw bytes using Display driver?

Part Number: LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

I would like to keep the menu capability of simple_central, but upon entering discovery mode, I would like to access to something like UART_write() so I can stream advertising data to the serial port. What is the best way to accomplish this without disabling the Display driver?

  • I guess the best of both worlds is having access to both UART and Display. For anyone else, here's how I'm juggling them. In SimpleCentral_init()

    dispHandle = Display_open(Display_Type_ANY, NULL);
    UART_init();
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.baudRate = 115200;

    In SimpleCentral_processAppMsg()

    case SC_EVT_SCAN_ENABLED:
    ...
    Display_printf(dispHandle, SC_ROW_NON_CONN, 0, "Discovering...");
    Display_close(dispHandle);
    uart = UART_open(Board_UART0, &uartParams);
    
    case SC_EVT_ADV_REPORT:
    // use UART_Write() here
    // remove instances of Display_printf() here
    
    case SC_EVT_SCAN_DISABLED:
    UART_close(uart);
    dispHandle = Display_open(Display_Type_ANY, NULL);
    Display_printf(dispHandle, SC_ROW_NON_CONN, 0, "%d devices discovered",numReport);
    

    I found that any tricks trying to use the Display module resulted in an error, likely because I was passing too much data too quickly.