TI-OpenThread  1.08.03.09
Macros | Functions | Variables
CC1352P_2_LAUNCHXL/thread/shade/platform/uart.c File Reference
#include <openthread/config.h>
#include <stddef.h>
#include <utils/code_utils.h>
#include <openthread/platform/uart.h>
#include <ti/drivers/UART.h>
#include <ti/drivers/uart/UARTCC26XX.h>
#include "ti_drivers_config.h"
#include "system.h"
+ Include dependency graph for CC1352P_2_LAUNCHXL/thread/shade/platform/uart.c:

Macros

#define PLATFORM_UART_EVENT_RX_DONE   (1U << 1)
 
#define PLATFORM_UART_EVENT_TX_DONE   (1U << 0)
 
#define PLATFORM_UART_RECV_BUF_LEN   32
 

Functions

otError otPlatUartDisable (void)
 
otError otPlatUartEnable (void)
 
otError otPlatUartFlush (void)
 
otError otPlatUartSend (const uint8_t *aBuf, uint16_t aBufLength)
 
void platformUartProcess (uintptr_t arg)
 
static void uartReadCallback (UART_Handle aHandle, void *aBuf, size_t aLen)
 
static void uartWriteCallback (UART_Handle aHandle, void *aBuf, size_t aLen)
 

Variables

static uint8_t PlatformUart_receiveBuffer [PLATFORM_UART_RECV_BUF_LEN]
 
static size_t PlatformUart_receiveLen
 
static uint8_t const * PlatformUart_sendBuffer = NULL
 
static UART_Handle PlatformUart_uartHandle
 

Macro Definition Documentation

§ PLATFORM_UART_EVENT_TX_DONE

#define PLATFORM_UART_EVENT_TX_DONE   (1U << 0)

Configure the UART core for 115200 baud 8-N-1, no HW flow control.

Note
Make sure that data being passed to otPlatUartSend is in persistent readable memory. Event identifiers passed back to the stack task callback.

Referenced by platformUartProcess(), and uartWriteCallback().

§ PLATFORM_UART_EVENT_RX_DONE

#define PLATFORM_UART_EVENT_RX_DONE   (1U << 1)

§ PLATFORM_UART_RECV_BUF_LEN

#define PLATFORM_UART_RECV_BUF_LEN   32

Size of the statically allocated buffer to pass data from the callback to the processing loop.

Function Documentation

§ uartReadCallback()

static void uartReadCallback ( UART_Handle  aHandle,
void *  aBuf,
size_t  aLen 
)
static

Callback for when the UART driver finishes reading.

This is triggered when the buffer is full, or when the UART hardware times out.

References PLATFORM_UART_EVENT_RX_DONE, PlatformUart_receiveLen, and platformUartSignal().

Referenced by otPlatUartEnable().

§ uartWriteCallback()

static void uartWriteCallback ( UART_Handle  aHandle,
void *  aBuf,
size_t  aLen 
)
static

Callback for when the UART driver finishes writing a buffer.

References PLATFORM_UART_EVENT_TX_DONE, PlatformUart_sendBuffer, and platformUartSignal().

Referenced by otPlatUartEnable().

§ otPlatUartEnable()

otError otPlatUartEnable ( void  )

Function documented in platform/uart.h

References PlatformUart_receiveBuffer, PlatformUart_uartHandle, uartReadCallback(), and uartWriteCallback().

§ otPlatUartDisable()

otError otPlatUartDisable ( void  )

Function documented in platform/uart.h

References PlatformUart_uartHandle.

§ otPlatUartSend()

otError otPlatUartSend ( const uint8_t *  aBuf,
uint16_t  aBufLength 
)

Function documented in platform/uart.h

References PlatformUart_sendBuffer, and PlatformUart_uartHandle.

§ platformUartProcess()

void platformUartProcess ( uintptr_t  arg)

§ otPlatUartFlush()

otError otPlatUartFlush ( void  )

Function documented in system.h

Referenced by platformUartProcess().

Variable Documentation

§ PlatformUart_receiveBuffer

uint8_t PlatformUart_receiveBuffer[PLATFORM_UART_RECV_BUF_LEN]
static

Statically allocated data buffer.

Referenced by otPlatUartEnable(), and platformUartProcess().

§ PlatformUart_receiveLen

size_t PlatformUart_receiveLen
static

Number of bytes in the receive buffer.

Referenced by platformUartProcess(), and uartReadCallback().

§ PlatformUart_sendBuffer

uint8_t const* PlatformUart_sendBuffer = NULL
static

The buffer to be sent.

Referenced by otPlatUartSend(), and uartWriteCallback().

§ PlatformUart_uartHandle

UART_Handle PlatformUart_uartHandle
static
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale