Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
ptxNSC_Hal.h
Go to the documentation of this file.
1
43#ifndef COMPS_NSC_PTXNSC_HAL_H_
44#define COMPS_NSC_PTXNSC_HAL_H_
45
52/*
53 * ####################################################################################################################
54 * INCLUDES
55 * ####################################################################################################################
56 */
57
59#include "ptxHal.h"
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65/*
66 * ####################################################################################################################
67 * DEFINES / TYPES
68 * ####################################################################################################################
69 */
70
75#define PTX_NSC_HAL_PAYLOAD_LENGTH_WI_MAX (252u)
82#define PTX_NSC_HAL_WRITE_INSTRUCTION_MASK (0x04u)
83#define PTX_NSC_HAL_WRITE_RANDOM_ADDRESS_MASK (0x05u)
84#define PTX_NSC_HAL_READ_BUFFER_MASK (0x03u)
85#define PTX_NSC_HAL_WRITE_BUFFER_MASK (0x07u)
86#define PTX_NSC_HAL_READ_RANDOM_ADDRESS_MASK (0x01u)
87#define PTX_NSC_HAL_READ_CONTINUOUS_ADDRESS_MASK (0x02u)
88#define PTX_NSC_HAL_WRITE_CONTINUOUS_ADDRESS_MASK (0x06u)
89#define PTX_NSC_HAL_BUFFER_ADDRESS_MASK (0x1Fu)
96#define PTX_NSC_HAL_ADDRESS_RAM_INITIAL (0x0000u)
97#define PTX_NSC_HAL_ADDRES_RAM_END (0x0FFFu)
98#define PTX_NSC_HAL_ADDRESS_SFR_INITIAL (0x1000u)
99#define PTX_NSC_HAL_ADDRES_SFR_END (0x10FFu)
105struct ptxNSC;
106
107
108/*
109 * ####################################################################################################################
110 * API FUNCTIONS
111 * ####################################################################################################################
112 */
113
127ptxStatus_t ptxNSC_Hal_WriteBuffer_Async(struct ptxNSC *nscCtx, uint8_t addressOfBuffer, uint8_t* pPayload, size_t txLen );
128
139ptxStatus_t ptxNSC_Hal_WriteRawData (struct ptxNSC *nscCtx, uint8_t* pPayload, size_t txLen );
140
153ptxStatus_t ptxNSC_Hal_WriteInstruction_Synchronous (struct ptxNSC *nscCtx, uint16_t address, uint8_t* pPayload, size_t txLen );
154
168ptxStatus_t ptxNSC_Hal_WRA (struct ptxNSC *nscCtx, uint16_t address, uint8_t value);
169
186ptxStatus_t ptxNSC_Hal_WRA_HwAck (struct ptxNSC *nscCtx, uint16_t address, uint8_t value);
187
200ptxStatus_t ptxNSC_Hal_WriteRandomAddressMulti_Synchronous (struct ptxNSC *nscCtx, ptxTypes_WRA_t *pWRA);
201
216ptxStatus_t ptxNSC_Hal_WriteContinuousAddress_Synchronous (struct ptxNSC *nscCtx, uint16_t address, uint8_t *value, size_t length);
217
232ptxStatus_t ptxNSC_Hal_WriteBuffer_Synchronous(struct ptxNSC *nscCtx, uint8_t addressOfBuffer, uint8_t* pPayload, size_t txLen );
233
247ptxStatus_t ptxNSC_Hal_ReadRandomAddress_Synchronous (struct ptxNSC *nscCtx, uint16_t address, uint8_t *value);
248
261ptxStatus_t ptxNSC_Hal_WriteInstruction_Framing (struct ptxNSC *nscCtx, uint16_t address, uint8_t* pPayload, size_t txLen );
262
276ptxStatus_t ptxNSC_Hal_ReadBuffer_Synchronous (struct ptxNSC *nscCtx, uint8_t *payload, size_t *length);
277
292ptxStatus_t ptxNSC_Hal_ReadContinuousAddress_Synchronous (struct ptxNSC *nscCtx, uint16_t address, size_t length, uint8_t *bytesReceived);
293
303
313
322ptxStatus_t ptxNSC_Hal_TRx(struct ptxNSC *nscCtx, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen);
323
324#ifdef __cplusplus
325}
326#endif
327
330#endif /* Guard */
331
332
ptxStatus_t ptxNSC_Hal_WriteInstruction_Synchronous(struct ptxNSC *nscCtx, uint16_t address, uint8_t *pPayload, size_t txLen)
Do a Write Instruction operation on the chip and wait for the ACK (0x00). This function stop the rece...
ptxHal_InterfaceType_t ptxNSC_Hal_GetActiveIfType(struct ptxNSC *nscCtx)
Wrapper function used to get the Active Interface at Hal.
ptxStatus_t ptxNSC_Hal_WriteInstruction_Framing(struct ptxNSC *nscCtx, uint16_t address, uint8_t *pPayload, size_t txLen)
Split the payload to write to memory program in chunks of 252 B and update memory address accordingly...
ptxStatus_t ptxNSC_Hal_WriteRawData(struct ptxNSC *nscCtx, uint8_t *pPayload, size_t txLen)
Send raw data directly to the chip. Do a Write Buffer operation.
ptxStatus_t ptxNSC_Hal_Cancel(struct ptxNSC *nscCtx)
Wrapper function used to call Cancel Operation at Hal.
ptxStatus_t ptxNSC_Hal_WriteBuffer_Async(struct ptxNSC *nscCtx, uint8_t addressOfBuffer, uint8_t *pPayload, size_t txLen)
Do a write buffer operation on the chip.
ptxStatus_t ptxNSC_Hal_TRx(struct ptxNSC *nscCtx, uint8_t *txBuf[], size_t txLen[], size_t numBuffers, uint8_t *rxBuf, size_t *rxLen)
Wrapper function used to call Trx at Hal.
uint16_t ptxStatus_t
Status Type.
Definition ptx_Status.h:82
enum ptxHal_InterfaceType ptxHal_InterfaceType_t
Definition ptxNSC_Interface.h:152
WRA data type.
Definition ptxNSC_InterfaceTypes.h:340