Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
Data Structures | Typedefs | Functions
Collaboration diagram for UART:

Data Structures

struct  ptxHal_UartInitParam
 Input parameters to Open Uart Port. More...
 

Typedefs

typedef struct ptxHal_UARTptxHal_UART_t
 UART specific data Wrapper Structure - Forward Declaration.
 
typedef struct ptxHal_UartInitParam ptxHal_UartInitParam_t
 Input parameters to Open Uart Port.
 

Functions

ptxStatus_t ptxHal_UartOpen (ptxHal_UART_t *halUart, ptxHal_UartInitParam_t *initPars)
 Open the UART device.
 
ptxStatus_t ptxHal_UartClose (ptxHal_UART_t *halUart)
 Close the UART device.
 
ptxStatus_t ptxHal_UartDiscardData (ptxHal_UART_t halUart)
 Discard data currently in the buffers of the UART device.
 
ptxStatus_t ptxHal_UartSetTimeout (ptxHal_UART_t halUart, uint32_t msTimeout)
 Set the timeout attribute for the interface device.
 
ptxStatus_t ptxHal_UartSetSpeed (ptxHal_UART_t halUart, uint32_t bdSpeed)
 Set the speed attribute for the interface device.
 
ptxStatus_t ptxHal_UartHandshakeManual (ptxHal_UART_t halUart, uint8_t enableHS)
 Set the state of the handshake lines RTS and DTR.
 
ptxStatus_t ptxHal_UartAddSof (ptxHal_UART_t halUart, uint8_t addSof)
 Select whether to add SOF to the frame, if NSC format requires that.
 
ptxStatus_t ptxHal_UartSetFc (ptxHal_UART_t halUart, uint8_t enableFc)
 (Re-) Initialize settings and modify Flow Control for the device.
 
ptxStatus_t ptxHal_UartCancel (ptxHal_UART_t halUart)
 Cancel a UART operation.
 
ptxStatus_t ptxHal_UartClearCancel (ptxHal_UART_t halUart)
 Clear Cancel cancel flag for UART operation.
 
ptxStatus_t ptxHal_UartTRx (ptxHal_UART_t halUart, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen)
 Exchange content of multiple buffers via the UART Interface, adding SOF if required.
 
ptxStatus_t ptxHal_UartDTRManual (ptxHal_UART_t halUart, uint8_t enableDTR)
 Set the state of the DTR line.
 

Detailed Description

Function Documentation

◆ ptxHal_UartAddSof()

ptxStatus_t ptxHal_UartAddSof ( ptxHal_UART_t halUart,
uint8_t addSof )

Select whether to add SOF to the frame, if NSC format requires that.

Parameters
[in]halUartPointer to an allocated and initialized structure.
[in]addSofWhether to add SOF.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartCancel()

ptxStatus_t ptxHal_UartCancel ( ptxHal_UART_t halUart)

Cancel a UART operation.

Parameters
[in]halUartPointer to a UART-specific structure.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartClearCancel()

ptxStatus_t ptxHal_UartClearCancel ( ptxHal_UART_t halUart)

Clear Cancel cancel flag for UART operation.

Parameters
[in]halUartPointer to a UART-specific structure.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartClose()

ptxStatus_t ptxHal_UartClose ( ptxHal_UART_t * halUart)

Close the UART device.

Parameters
[in]halUartPointer to a UART-specific structure.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartDiscardData()

ptxStatus_t ptxHal_UartDiscardData ( ptxHal_UART_t halUart)

Discard data currently in the buffers of the UART device.

Parameters
[in]halUartPointer to a UART-specific structure.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartDTRManual()

ptxStatus_t ptxHal_UartDTRManual ( ptxHal_UART_t halUart,
uint8_t enableDTR )

Set the state of the DTR line.

Parameters
[in]halUartPointer to a UART-specific structure.
[in]enableDTRWith 0 the line is pull down; set to 1 to set it to high.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartHandshakeManual()

ptxStatus_t ptxHal_UartHandshakeManual ( ptxHal_UART_t halUart,
uint8_t enableHS )

Set the state of the handshake lines RTS and DTR.

Set the state of the handshake lines RTS and DTR. Caution: This is only possible when auto control-flow is OFF (ptxHal_UartSetFc).

Parameters
[in]halUartPointer to a UART-specific structure.
[in]enableHSWith 0 the lines is set to inactive; set to 1 in order to set control lines to active state.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartOpen()

ptxStatus_t ptxHal_UartOpen ( ptxHal_UART_t * halUart,
ptxHal_UartInitParam_t * initPars )

Open the UART device.

Parameters
[in]halUartPointer to a UART-specific structure.
[in]initParsPointer to a UART-specific structure containing initialization parameters.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartSetFc()

ptxStatus_t ptxHal_UartSetFc ( ptxHal_UART_t halUart,
uint8_t enableFc )

(Re-) Initialize settings and modify Flow Control for the device.

The function (re-) initializes device settings and enables or disables flow control. In order to manually control the handshake lines, set the state to disable and use ptxHal_UartHandshakeManual.

Parameters
[in]halUartPointer to a UART-specific structure.
[in]enableFcWith 0 the interface is set to inactive; set to 1 in order to enable data exchange.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartSetSpeed()

ptxStatus_t ptxHal_UartSetSpeed ( ptxHal_UART_t halUart,
uint32_t bdSpeed )

Set the speed attribute for the interface device.

Control the interface. Set speed parameter.

Parameters
[in]halUartPointer to a UART-specific structure.
[in]bdSpeedNew speed, in baud.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartSetTimeout()

ptxStatus_t ptxHal_UartSetTimeout ( ptxHal_UART_t halUart,
uint32_t msTimeout )

Set the timeout attribute for the interface device.

Control the interface. Set timeout parameter.

Parameters
[in]halUartPointer to a UART-specific structure.
[in]msTimeoutTimeout interval, in ms.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.

◆ ptxHal_UartTRx()

ptxStatus_t ptxHal_UartTRx ( ptxHal_UART_t halUart,
uint8_t * txBuf[],
size_t txLen[],
size_t numBuffers,
uint8_t * rxBuf,
size_t * rxLen )

Exchange content of multiple buffers via the UART Interface, adding SOF if required.

Sends the content of multiple buffers and prepends SOF, if set in the transmission parameter field of the component. In an implementation-specific way, the function concatenates sending of content of multiple buffers. The implementation is hardware-specific, but the interface is done such that the underlying code can be tweaked for maximum performance (e.g. Gather-DMA on some embedded systems, of just multi-send on others).

Parameters
[in]halUartPointer to a UART-specific structure.
[in]txBufArray of pointers to buffers with data to write.
[in]txLenArray of Number of bytes in the respective buffer.
[in]numBuffersNumber of buffers whose data to transmit.
[in]rxBufPointer to a buffer with data to write.
[in]rxLenPointer to a variable providing the maximum number of bytes to read and receiving the actual number of bytes read.
Note
If txBuf or txLen are NULL, then only receive operation is performed (if rx buffer and length are not NULL). For transmitting: individual buffers may be NULL or the length of individual buffers may be zero. It is required however that the total number of bytes to transfer is greater than zero and within the range the length field of the NSC-specific frame can transfer.
Returns
Status, indicating whether the operation was successful. See ptxStatus_t.