|
Renesas PTX1xxR IoT-Reader API (non-OS) Version 7.3.1
Renesas Software Stack for IoT-Reader Applications (non-OS)
|

Data Structures | |
| struct | ptxPLAT_ConfigPars |
| Platform-specific parameter initializers. More... | |
Macros | |
| #define | PTX_PLAT_TRX_FLAGS_I2C_RESTART_CONDITION 0x01 |
| Platform-specific flags parameter initializers. | |
| #define | PTX_PLAT_HOST_SPEED_I2C_100000 (100000UL) |
| Platform-dependent I2C speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!) | |
| #define | PTX_PLAT_HOST_SPEED_I2C_400000 (400000UL) |
| #define | PTX_PLAT_HOST_SPEED_I2C_1000000 (1000000UL) |
| #define | PTX_PLAT_HOST_SPEED_I2C_3400000 (3400000UL) |
| #define | PTX_PLAT_HOST_SPEED_I2C_MAX PTX_PLAT_HOST_SPEED_I2C_3400000 |
| #define | PTX_PLAT_HOST_SPEED_UART_9600 (9600UL) |
| Platform-dependent UART speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!) | |
| #define | PTX_PLAT_HOST_SPEED_UART_14400 (14400UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_19200 (19200UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_28800 (28800UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_38400 (38400UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_57600 (57600UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_115200 (115200UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_230400 (230400UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_460800 (460800UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_921600 (921600UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_1843200 (1843200UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_3000000 (3000000UL) |
| #define | PTX_PLAT_HOST_SPEED_UART_MAX PTX_PLAT_HOST_SPEED_UART_3000000 |
| #define | PTX_PLAT_HOST_DEFAULT_UART_SPEED PTX_PLAT_HOST_SPEED_UART_115200 |
| #define | PTX_PLAT_HOST_SPEED_SPI_1M (1000000UL) |
| Platform-dependent SPI speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!) | |
| #define | PTX_PLAT_HOST_SPEED_SPI_5M (5000000UL) |
| #define | PTX_PLAT_HOST_SPEED_SPI_10M (10000000UL) |
| #define | PTX_PLAT_HOST_SPEED_SPI_MAX PTX_PLAT_HOST_SPEED_SPI_10M |
Typedefs | |
| typedef void(* | pptxPlat_RxCallBack_t) (void *ctx) |
| Callback function for IRQ triggered (asynchronously). | |
| typedef void(* | pptxPlat_TimerCallBack_t) (void *ctx) |
| Callback function for Timer Interrupt. | |
| typedef struct ptxPLAT_ConfigPars | ptxPLAT_ConfigPars_t |
| Platform-specific parameter initializers. | |
Functions | |
| ptxStatus_t | ptxPLAT_AllocAndInit (struct ptxPlat **plat, struct ptxPLAT_ConfigPars *initParams) |
| Allocate and initialize the PLAT context. | |
| ptxStatus_t | ptxPLAT_Deinit (struct ptxPlat *plat) |
| De-initialize the PLAT context. | |
| ptxStatus_t | ptxPLAT_TRx (struct ptxPlat *plat, uint8_t *txBuf[], size_t txLen[], size_t numTxBuffers, uint8_t *rxBuf[], size_t *rxLen[], size_t numRxBuffers, uint8_t flags) |
| Send and receive content of multiple buffers through the physical interface to the PTX1K. | |
| ptxStatus_t | ptxPLAT_WaitForInterrupt (struct ptxPlat *plat) |
| Wait for any kind of interrupt to be triggered on the CPU. (Blocking) | |
| ptxStatus_t | ptxPLAT_StartWaitForRx (struct ptxPlat *plat, pptxPlat_RxCallBack_t irqCb, void *ctxIrqCb) |
| Start waiting for IRQ to be triggered.(Not-blocking) | |
| ptxStatus_t | ptxPLAT_StopWaitForRx (struct ptxPlat *plat) |
| Stop the waiting for IRQ. | |
| ptxStatus_t | ptxPLAT_Sleep (struct ptxPlat *plat, uint32_t sleep_ms) |
| Sleep software execution. | |
| void | ptxPLAT_DisableInterrupts (struct ptxPlat *plat) |
| Disable Interrupts. | |
| void | ptxPLAT_EnableInterrupts (struct ptxPlat *plat) |
| Enable Interrupts. | |
| ptxStatus_t | ptxPLAT_ResetChip (struct ptxPlat *plat) |
| Resets PTX1K. | |
| ptxStatus_t | ptxPLAT_GetInitializedTimer (struct ptxPlat *plat, struct ptxPlatTimer **timer) |
| Get an initialized timer. | |
| ptxStatus_t | ptxPLAT_TimerStart (struct ptxPlat *plat, struct ptxPlatTimer *timer, uint32_t ms, uint8_t isBlock, pptxPlat_TimerCallBack_t fnISRCb, void *ISRCxt) |
| Start timer for some milliseconds. | |
| ptxStatus_t | ptxPLAT_TimerIsElapsed (struct ptxPlat *plat, struct ptxPlatTimer *timer, uint8_t *isElapsed) |
| Get Elapse state of the timer. | |
| ptxStatus_t | ptxPLAT_TimerDeinit (struct ptxPlat *plat, struct ptxPlatTimer *timer) |
| De initialize the timer. | |
| ptxStatus_t | ptxPLAT_IsRxPending (struct ptxPlat *plat, uint8_t *isRxPending) |
| It checks if Rx Operation is pending from PTX100X. | |
| ptxStatus_t | ptxPLAT_TriggerRx (struct ptxPlat *plat) |
| It triggers Rx Operation from PTX100X (If rx operation pending) | |
| uint8_t | ptxPLAT_CheckRxActive (struct ptxPlat *plat) |
| Check if PLAT interface reception is taking place at the moment. | |
| #define PTX_PLAT_HOST_DEFAULT_UART_SPEED PTX_PLAT_HOST_SPEED_UART_115200 |
UART default Speed after reset.
| #define PTX_PLAT_HOST_SPEED_I2C_100000 (100000UL) |
Platform-dependent I2C speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!)
I2C Standard (100 kHz).
| #define PTX_PLAT_HOST_SPEED_I2C_1000000 (1000000UL) |
I2C Fast-Mode-Plus (up to 1 MHz).
| #define PTX_PLAT_HOST_SPEED_I2C_3400000 (3400000UL) |
I2C High-Speed-Mode (up to 3.4 MHz).
| #define PTX_PLAT_HOST_SPEED_I2C_400000 (400000UL) |
I2C Fast-Mode (400 kHz).
| #define PTX_PLAT_HOST_SPEED_I2C_MAX PTX_PLAT_HOST_SPEED_I2C_3400000 |
I2C Max. Speed/Bitrate
| #define PTX_PLAT_HOST_SPEED_SPI_10M (10000000UL) |
SPI 10 MBit/s.
| #define PTX_PLAT_HOST_SPEED_SPI_1M (1000000UL) |
Platform-dependent SPI speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!)
SPI 1 MBit/s.
| #define PTX_PLAT_HOST_SPEED_SPI_5M (5000000UL) |
SPI 5 MBit/s.
| #define PTX_PLAT_HOST_SPEED_SPI_MAX PTX_PLAT_HOST_SPEED_SPI_10M |
SPI Max. Speed/Bitrate
| #define PTX_PLAT_HOST_SPEED_UART_115200 (115200UL) |
UART 115200 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_14400 (14400UL) |
UART 14400 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_1843200 (1843200UL) |
UART 1843200 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_19200 (19200UL) |
UART 19200 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_230400 (230400UL) |
UART 230400 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_28800 (28800UL) |
UART 28800 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_3000000 (3000000UL) |
UART 3000000 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_38400 (38400UL) |
UART 38400 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_460800 (460800UL) |
UART 460800 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_57600 (57600UL) |
UART 57600 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_921600 (921600UL) |
UART 921600 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_9600 (9600UL) |
Platform-dependent UART speeds/bitrates (Attention: Bitrates highly dependent on the target system and might require adaption!)
UART 9600 Baud.
| #define PTX_PLAT_HOST_SPEED_UART_MAX PTX_PLAT_HOST_SPEED_UART_3000000 |
UART Max. Speed/Bitrate
| #define PTX_PLAT_TRX_FLAGS_I2C_RESTART_CONDITION 0x01 |
Platform-specific flags parameter initializers.
Bit 0 ....: I2C: Restart-Condition required after Write-operation or not. Bit 1 - 3.: RFU Bit 4 - 7.: Custom Flags (free to use) I2C: If set, the restart condition should be issued after the write operation.
| ptxStatus_t ptxPLAT_AllocAndInit | ( | struct ptxPlat ** | plat, |
| struct ptxPLAT_ConfigPars * | initParams ) |
Allocate and initialize the PLAT context.
| [in,out] | plat | Pointer to pointer where the allocated and initialized platform context is going to be provided. |
| [in] | initParams | Initializers for platform context parameters, e.g. com interface speed and flow control. |
| uint8_t ptxPLAT_CheckRxActive | ( | struct ptxPlat * | plat | ) |
Check if PLAT interface reception is taking place at the moment.
| [in] | plat | Pointer to an initialized component structure. |
| ptxStatus_t ptxPLAT_Deinit | ( | struct ptxPlat * | plat | ) |
De-initialize the PLAT context.
This function deallocates and de-init the resources used by the Platform Component that were previously initialized by /ref ptxPLAT_AllocAndInit.
| [in] | plat | Pointer to an initialized component structure. |
| void ptxPLAT_DisableInterrupts | ( | struct ptxPlat * | plat | ) |
Disable Interrupts.
This is used to disable IRQs from the underlying HW-platform.
| [in] | plat | Pointer to an initialized component structure. |
| void ptxPLAT_EnableInterrupts | ( | struct ptxPlat * | plat | ) |
Enable Interrupts.
This is used to (re-)enable IRQs from the underlying HW-platform.
| [in] | plat | Pointer to an initialized component structure. |
| ptxStatus_t ptxPLAT_GetInitializedTimer | ( | struct ptxPlat * | plat, |
| struct ptxPlatTimer ** | timer ) |
Get an initialized timer.
| [in] | plat | Pointer to an initialized component structure. |
| [out] | timer | Pointer to pointer where the allocated and initialized timer context is going to be provided. |
| ptxStatus_t ptxPLAT_IsRxPending | ( | struct ptxPlat * | plat, |
| uint8_t * | isRxPending ) |
It checks if Rx Operation is pending from PTX100X.
| [in] | plat | Pointer to an initialized component structure. |
| [out] | isRxPending | Pointer to write if rx operation is pending. ( 1 if rx operation is pending, 0 if not ) |
| ptxStatus_t ptxPLAT_ResetChip | ( | struct ptxPlat * | plat | ) |
Resets PTX1K.
This is used to reset the PTX1K-HW via the SEN-pin (optional, if connected)
| [in] | plat | Pointer to an initialized component structure. |
| ptxStatus_t ptxPLAT_Sleep | ( | struct ptxPlat * | plat, |
| uint32_t | sleep_ms ) |
Sleep software execution.
This function returns when the time provided by /ref sleep_ms has elapsed.
| [in] | plat | Pointer to an initialized component structure. |
| [in] | sleep_ms | Number of milliseconds to sleep. |
| ptxStatus_t ptxPLAT_StartWaitForRx | ( | struct ptxPlat * | plat, |
| pptxPlat_RxCallBack_t | irqCb, | ||
| void * | ctxIrqCb ) |
Start waiting for IRQ to be triggered.(Not-blocking)
This function registers a CallBack function to be called by the platform (e.g. typically from ISR) when the IRQ has been triggered by the PTX1K.
| [in] | plat | Pointer to an initialized component structure. |
| [in] | irqCb | Callback function to be called from HW (PLatform) when the IRQ is triggered by PTX1K. |
| [in] | ctxIrqCb | Context to be used as first argument when invoking the callback. |
| ptxStatus_t ptxPLAT_StopWaitForRx | ( | struct ptxPlat * | plat | ) |
Stop the waiting for IRQ.
This function stops the asynchronous wait for IRQ triggered by /ref ptxPLAT_StartWaitForIRQ.
| [in] | plat | Pointer to an initialized component structure. |
| ptxStatus_t ptxPLAT_TimerDeinit | ( | struct ptxPlat * | plat, |
| struct ptxPlatTimer * | timer ) |
De initialize the timer.
| [in] | plat | Pointer to an initialized component structure. |
| [in] | timer | Pointer to an initialized timer context. |
| ptxStatus_t ptxPLAT_TimerIsElapsed | ( | struct ptxPlat * | plat, |
| struct ptxPlatTimer * | timer, | ||
| uint8_t * | isElapsed ) |
Get Elapse state of the timer.
| [in] | plat | Pointer to an initialized component structure. |
| [in] | timer | Pointer to an initialized timer context. |
| [out] | isElapsed | Pointer where the elapse state is going to be written.(e.g. 1 if timer is elapsed, 0 if timer is not elapsed) |
| ptxStatus_t ptxPLAT_TimerStart | ( | struct ptxPlat * | plat, |
| struct ptxPlatTimer * | timer, | ||
| uint32_t | ms, | ||
| uint8_t | isBlock, | ||
| pptxPlat_TimerCallBack_t | fnISRCb, | ||
| void * | ISRCxt ) |
Start timer for some milliseconds.
1./ It blocks and waits until the time elapses. 2./ It does not block, It register a callback that will be called asyncrhously when the time elapses.
| [in] | plat | Pointer to an initialized component structure. |
| [in] | timer | Pointer to an initialized timer context. |
| [in] | ms | Milliseconds to wait. |
| [in] | isBlock | Set to 0 if the function is blocking. Set to 1 if it blocks. |
| [in] | fnISRCb | Callback function that may be used in case of not-blocking call. NULL to be provided if not-used. |
| [in] | ISRCxt | Context to be used by /ref fnISRCb. NULL to be provided if not-used. |
| ptxStatus_t ptxPLAT_TriggerRx | ( | struct ptxPlat * | plat | ) |
It triggers Rx Operation from PTX100X (If rx operation pending)
| [in] | plat | Pointer to an initialized component structure. |
| ptxStatus_t ptxPLAT_TRx | ( | struct ptxPlat * | plat, |
| uint8_t * | txBuf[], | ||
| size_t | txLen[], | ||
| size_t | numTxBuffers, | ||
| uint8_t * | rxBuf[], | ||
| size_t * | rxLen[], | ||
| size_t | numRxBuffers, | ||
| uint8_t | flags ) |
Send and receive content of multiple buffers through the physical interface to the PTX1K.
Sends the content of multiple buffers. 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] | plat | 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] | numTxBuffers | Number of buffers whose data to transmit. |
| [in,out] | rxBuf | Array of pointers to buffers where data is going to be received. |
| [in,out] | rxLen | Array of length of /rxBuf. As input parameter capacity of the buffers and as output actual number of bytes read out. |
| [in] | numRxBuffers | Number of buffers with data to be received. |
| [in] | flags | General purpose flags for TRx-operation (specific to used host-interface). |
| ptxStatus_t ptxPLAT_WaitForInterrupt | ( | struct ptxPlat * | plat | ) |
Wait for any kind of interrupt to be triggered on the CPU. (Blocking)
This function is expected to be used is expected to be used by upper layers for waiting for any asynchronous event to happen