|
Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
|

Topics | |
| HAL Interface Diversity | |
Data Structures | |
| struct | ptxHal_InitParam |
| Initialization Parameters Structure. More... | |
Macros | |
| #define | PTX_HAL_MAX_TX_LEN 256 |
| #define | PTX_HAL_READ_TIMEOUT 500 |
| #define | PTX_HAL_WRITE_TIMEOUT 500 |
Typedefs | |
| typedef enum ptxHal_InterfaceType | ptxHal_InterfaceType_t |
| typedef struct ptxHal_InitParam | ptxHal_InitParam_t |
| Initialization Parameters Structure. | |
| typedef struct ptxHal * | pptxHal_t |
| Pointer to main HAL component. | |
| typedef ptxStatus_t(* | pptxHal_Cancel_t) (pptxHal_t halCtx) |
| Cancel any operation on the HAL. | |
| typedef ptxStatus_t(* | pptxHal_TRx_t) (pptxHal_t halCtx, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen) |
| Send content of multiple buffers via the Interface, adding SOF if required, receive response. | |
Enumerations | |
| enum | ptxHal_InterfaceType { ptxHal_InterfaceType_None , ptxHal_InterfaceType_I2C , ptxHal_InterfaceType_SPI , ptxHal_InterfaceType_UART , ptxHal_InterfaceType_AAR_I2C , ptxHal_InterfaceType_AAR_SPI , ptxHal_InterfaceType_LPC , ptxHal_InterfaceType_USB , ptxHal_InterfaceType_FTDI_SPI , ptxHal_InterfaceType_FTDI_I2C , ptxHal_InterfaceType_FTDI_UART , ptxHal_InterfaceType_MAX } |
Functions | |
| ptxStatus_t | ptxHal_AllocOpen (struct ptxHal *halCtx, struct ptxHal_InitParam *initParam) |
| Initialize the HAL. | |
| ptxStatus_t | ptxHal_CloseDeAlloc (struct ptxHal *halCtx) |
| Close the HAL. | |
| ptxHal_InterfaceType_t | ptxHal_GetActiveIfType (struct ptxHal *halCtx) |
| Get the active HAL interface type. | |
| ptxStatus_t | ptxHal_Cancel (struct ptxHal *halCtx) |
| Cancel any operation on the HAL. | |
| ptxStatus_t | ptxHal_ClearCancel (struct ptxHal *halCtx) |
| Clear Cancel Flag . | |
| ptxStatus_t | ptxHal_SetTimeout (struct ptxHal *halCtx, uint32_t msTimeout) |
| Set the timeout attribute for the interface device. | |
| ptxStatus_t | ptxHal_SetSpeed (struct ptxHal *halCtx, uint32_t bdSpeed) |
| Set the communication interface speed. | |
| ptxStatus_t | ptxHal_SetBusAddress (struct ptxHal *halCtx, uint16_t busAddress) |
| Set the bus address attribute for the I2C interface device. | |
| ptxStatus_t | ptxHal_HandshakeManual (struct ptxHal *halCtx, uint8_t enableHS) |
| Set the state of handshake lines, if available. | |
| ptxStatus_t | ptxHal_SetFlowCtrlState (struct ptxHal *halCtx, uint8_t enableFc) |
| Enable/disable flow control mode for the Uart interface device. | |
| ptxStatus_t | ptxHal_SetI2C_NoStopFlag (struct ptxHal *halCtx) |
| Set I2C Not Stop Condition flag. | |
| ptxStatus_t | ptxHal_ClearI2C_NoStopFlag (struct ptxHal *halCtx) |
| Clear I2C Not Stop Condition flag. | |
| ptxStatus_t | ptxHal_TRx (struct ptxHal *halCtx, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen) |
| Send content of multiple buffers via the Interface, adding SOF if required, receive response. | |
| ptxStatus_t | ptxHal_WaitForInterrupt (struct ptxHal *halCtx) |
| Wait for Interrupt. | |
| ptxStatus_t | ptxHal_SetKeepNssActive (struct ptxHal *halCtx) |
| Keeps NSS Active after a Trx Operation (SPI specific). | |
| ptxStatus_t | ptxHal_ClearKeepNssActive (struct ptxHal *halCtx) |
| Clear Keeps NSS Active after a Trx Operation (SPI specific). | |
Bit-coded values, interface specific. | |
Put the values (using logical OR for more than one value to be set) into the CommParam member of ptxHal_InitParam_t. Serial: Bit(s) 7 6 5 4 3 2 1 0 Meaning |STOPBIT| | |
| #define | PTX_HAL_COMMPARAM_SERIAL_STOPBIT_MASK 3 /* */ |
| #define | PTX_HAL_COMMPARAM_SERIAL_ONESTOPBIT 0 /* */ |
| #define | PTX_HAL_COMMPARAM_SERIAL_ONE5STOPBITS 1 /* */ |
| #define | PTX_HAL_COMMPARAM_SERIAL_TWOSTOPBITS 2 /* */ |
| #define | PTX_HAL_COMMPARAM_SERIAL_INIT_SPEED (115200UL) /* */ |
| #define PTX_HAL_COMMPARAM_SERIAL_INIT_SPEED (115200UL) /* */ |
Serial interface initial speed.
| #define PTX_HAL_COMMPARAM_SERIAL_ONE5STOPBITS 1 /* */ |
Serial interface specific parameter, 1.5 stop bits:
| #define PTX_HAL_COMMPARAM_SERIAL_ONESTOPBIT 0 /* */ |
Serial interface specific parameter, one stop bit:
| #define PTX_HAL_COMMPARAM_SERIAL_STOPBIT_MASK 3 /* */ |
Mask for the stop bits. Internally used.
| #define PTX_HAL_COMMPARAM_SERIAL_TWOSTOPBITS 2 /* */ |
Serial interface specific parameter, two stop bit:
| #define PTX_HAL_MAX_TX_LEN 256 |
HAL max transfer length.
| #define PTX_HAL_READ_TIMEOUT 500 |
Hal read timeout in ms.
| #define PTX_HAL_WRITE_TIMEOUT 500 |
Hal write timeout in ms.
| typedef ptxStatus_t(* pptxHal_Cancel_t) (pptxHal_t halCtx) |
Cancel any operation on the HAL.
Cancels pending operations in the HAL but returns immediately. The function does not wait for the canceled operation to finish.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| typedef ptxStatus_t(* pptxHal_TRx_t) (pptxHal_t halCtx, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen) |
Send content of multiple buffers via the Interface, adding SOF if required, receive response.
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 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).
The receive function returns the bytes received during I/O. Some interfaces have additional requirements like having to keep CS asserted or to apply repeated a start condition. The Exchange function allows for requirements like these.
| [in] | halCtx | Pointer to an initialized component structure. |
| [in] | txBuf | Array of pointers to buffers with data to write. |
| [in] | txLen | Array of Number of bytes in the respective transmit buffer. |
| [in] | numBuffers | Number of buffers whose data to transmit. |
| [in] | rxBuf | Pointer to a buffer that is going to receive the data. |
| [in,out] | rxLen | Pointer to a variable that provides and receives the length information. Invoke the function with the maximum number of bytes to read which is the size of the rx buffer. When returning the function sets the referenced variable to the number of actually received bytes. |
| typedef enum ptxHal_InterfaceType ptxHal_InterfaceType_t |
Hal Interface Types
| enum ptxHal_InterfaceType |
Hal Interface Types
| ptxStatus_t ptxHal_AllocOpen | ( | struct ptxHal * | halCtx, |
| struct ptxHal_InitParam * | initParam ) |
Initialize the HAL.
Allocates and initializes all specific objects for a defined interface.
| [in] | halCtx | Pointer to an allocated but non-initialized structure. |
| [in] | initParam | Pointer to a temporary structure (stack-allocated) with initialization values. |
| ptxStatus_t ptxHal_Cancel | ( | struct ptxHal * | halCtx | ) |
Cancel any operation on the HAL.
Cancels pending operations in the HAL but returns immediately. The function does not wait for the canceled operation to finish.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_ClearCancel | ( | struct ptxHal * | halCtx | ) |
Clear Cancel Flag .
In case Cancel is issues before a call to RX the flag still can cause the following receive operation to be canceled. This function clears the cancel flag.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_ClearI2C_NoStopFlag | ( | struct ptxHal * | halCtx | ) |
Clear I2C Not Stop Condition flag.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_ClearKeepNssActive | ( | struct ptxHal * | halCtx | ) |
Clear Keeps NSS Active after a Trx Operation (SPI specific).
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_CloseDeAlloc | ( | struct ptxHal * | halCtx | ) |
Close the HAL.
De-init and de-allocate all specific objects for a defined interface.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxHal_InterfaceType_t ptxHal_GetActiveIfType | ( | struct ptxHal * | halCtx | ) |
Get the active HAL interface type.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_HandshakeManual | ( | struct ptxHal * | halCtx, |
| uint8_t | enableHS ) |
Set the state of handshake lines, if available.
Set the state of the handshake lines. Caution: This is only possible when auto control-flow is OFF (ptxHal_SetFlowCtrlState).
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| [in] | enableHS | With 0 the lines is set to inactive; set to 1 in order to set control lines to active state. |
| ptxStatus_t ptxHal_SetBusAddress | ( | struct ptxHal * | halCtx, |
| uint16_t | busAddress ) |
Set the bus address attribute for the I2C interface device.
Control the interface. Set I2C address of the NFC chip.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| [in] | busAddress | Address of slave for interface. |
| ptxStatus_t ptxHal_SetFlowCtrlState | ( | struct ptxHal * | halCtx, |
| uint8_t | enableFc ) |
Enable/disable flow control mode for the Uart interface device.
Control the interface. Set flow control to active or inactive. Initial state is inactive.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| [in] | enableFc | With 0 the mode is set to inactive; set to 1 in order to enable the mode. |
| ptxStatus_t ptxHal_SetI2C_NoStopFlag | ( | struct ptxHal * | halCtx | ) |
Set I2C Not Stop Condition flag.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_SetKeepNssActive | ( | struct ptxHal * | halCtx | ) |
Keeps NSS Active after a Trx Operation (SPI specific).
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| ptxStatus_t ptxHal_SetSpeed | ( | struct ptxHal * | halCtx, |
| uint32_t | bdSpeed ) |
Set the communication interface speed.
Control the interface. Set speed.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| [in] | bdSpeed | Speed, in baud-per-second. |
| ptxStatus_t ptxHal_SetTimeout | ( | struct ptxHal * | halCtx, |
| uint32_t | msTimeout ) |
Set the timeout attribute for the interface device.
Control the interface. Set timeout parameter.
| [in] | halCtx | Pointer to an allocated and initialized structure. |
| [in] | msTimeout | Timeout interval, in ms. |
| ptxStatus_t ptxHal_TRx | ( | struct ptxHal * | halCtx, |
| uint8_t * | txBuf[], | ||
| size_t | txLen[], | ||
| size_t | numBuffers, | ||
| uint8_t * | rxBuf, | ||
| size_t * | rxLen ) |
Send content of multiple buffers via the Interface, adding SOF if required, receive response.
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 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).
The receive function returns the bytes received during I/O. Some interfaces have additional requirements like having to keep CS asserted or to apply repeated a start condition. The Exchange function allows for requirements like these.
| [in] | halCtx | Pointer to an initialized component structure. |
| [in] | txBuf | Array of pointers to buffers with data to write. |
| [in] | txLen | Array of Number of bytes in the respective transmit buffer. |
| [in] | numBuffers | Number of buffers whose data to transmit. |
| [in] | rxBuf | Pointer to a buffer that is going to receive the data. |
| [in,out] | rxLen | Pointer to a variable that provides and receives the length information. Invoke the function with the maximum number of bytes to read which is the size of the rx buffer. When returning the function sets the referenced variable to the number of actually received bytes. |
| ptxStatus_t ptxHal_WaitForInterrupt | ( | struct ptxHal * | halCtx | ) |
Wait for Interrupt.
| [in] | halCtx | Pointer to an allocated and initialized structure. |