Renesas PTX1xxR IoT-Reader API (non-OS) Version 7.3.1
Renesas Software Stack for IoT-Reader Applications (non-OS)
ptxNSC_Hal.h
Go to the documentation of this file.
1
49#ifndef COMPS_NSC_PTXNSC_HAL_H_
50#define COMPS_NSC_PTXNSC_HAL_H_
51
52/*
53 * ####################################################################################################################
54 * INCLUDES
55 * ####################################################################################################################
56 */
57#include "ptxStatus.h"
58#include <stddef.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64/*
65 * ####################################################################################################################
66 * DEFINES / TYPES / INTERNALS
67 * ####################################################################################################################
68 */
69
70
71#define PTX_HAL_WRITE_TIMEOUT (500u)
72//nscCtx->RspTimeout = (uint32_t)(20 * PTX_HAL_READ_TIMEOUT); /* 20 Times timeout at Hal level */
73#define PTX_HAL_READ_TIMEOUT (500u)
74#define PTX_NSC_RESPONSE_TIMEOUT (uint32_t)(20 * PTX_HAL_READ_TIMEOUT)
77#define PTX_NSC_HAL_ADDRESS_LENGTH (0x02u)
79#define PTX_NSC_HAL_BUFFER_LENGTH_RX_MAX (256u)
80#define PTX_NSC_HAL_DUMMY_VALUE (0xFFu)
81#define PTX_NSC_LENGTH_MAX (255u)
83#define PTX_NSC_HAL_PAYLOAD_LENGTH_WI_MAX (252u)
84#define PTX_NSC_HAL_WRITE_INSTRUCTION_MASK (0x04u)
85#define PTX_NSC_HAL_WRITE_RANDOM_ADDRESS_MASK (0x05u)
86#define PTX_NSC_HAL_READ_BUFFER_MASK (0x03u)
87#define PTX_NSC_HAL_WRITE_BUFFER_MASK (0x07u)
88#define PTX_NSC_HAL_READ_RANDOM_ADDRESS_MASK (0x01u)
89#define PTX_NSC_HAL_READ_CONTINUOUS_ADDRESS_MASK (0x02u)
90#define PTX_NSC_HAL_WRITE_CONTINUOUS_ADDRESS_MASK (0x06u)
91#define PTX_NSC_HAL_BUFFER_ADDRESS_MASK (0x1Fu)
96struct ptxNSC;
97
102{
103 NscWriteBuffer_0,
104 NscWriteBuffer_1,
105 NscWriteBuffer_2,
106 NscWriteBuffer_3,
107 NscWriteBuffer_4,
108 NscWriteBuffer_5,
109 NscWriteBuffer_6,
110 NscWriteBuffer_7,
111 NscWriteBuffer_8,
112 NscWriteBuffer_9,
113 NscWriteBuffer_10,
114 NscWriteBuffer_11,
115 NscWriteBuffer_12,
116 NscWriteBuffer_13,
117 NscWriteBuffer_14,
118 NscWriteBuffer_15,
119 NscWriteBuffer_Max
121
122/*
123 * ####################################################################################################################
124 * FUNCTIONS
125 * ####################################################################################################################
126 */
127
139ptxStatus_t ptxNSC_HAL_WriteBuffer(struct ptxNSC *nscCtx, ptxNscHal_BufferId_t bufferId, uint8_t *txBuf[], size_t txLen[], size_t numBuffers);
140
150ptxStatus_t ptxNSC_HAL_Wra(struct ptxNSC *nscCtx, uint16_t address, uint8_t value);
151
161ptxStatus_t ptxNSC_HAL_Wra_NoWait(struct ptxNSC *nscCtx, uint16_t address, uint8_t value);
162
172ptxStatus_t ptxNSC_HAL_Wra_NoCheck(struct ptxNSC *nscCtx, uint16_t address, uint8_t value);
173
183ptxStatus_t ptxNSC_HAL_Rra(struct ptxNSC *nscCtx, uint16_t address, uint8_t *value);
184
195ptxStatus_t ptxNSC_HAL_WriteInstruction(struct ptxNSC *nscCtx, uint16_t address, uint8_t *pPayload, size_t txLen );
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif /* Guard */
202
ptxStatus_t ptxNSC_HAL_Wra_NoWait(struct ptxNSC *nscCtx, uint16_t address, uint8_t value)
Internal command to write certain SFRs (operating-mode dependent).
ptxStatus_t ptxNSC_HAL_Wra_NoCheck(struct ptxNSC *nscCtx, uint16_t address, uint8_t value)
Internal command to write certain SFRs (operating-mode dependent).
enum ptxNscHal_BufferId ptxNscHal_BufferId_t
ID of buffers handled by Hardware.
ptxStatus_t ptxNSC_HAL_WriteBuffer(struct ptxNSC *nscCtx, ptxNscHal_BufferId_t bufferId, uint8_t *txBuf[], size_t txLen[], size_t numBuffers)
Internal command to exchange NSC-commands using buffers.
ptxStatus_t ptxNSC_HAL_WriteInstruction(struct ptxNSC *nscCtx, uint16_t address, uint8_t *pPayload, size_t txLen)
Internal command to write NSC-instructions.
ptxNscHal_BufferId
ID of buffers handled by Hardware.
Definition ptxNSC_Hal.h:102
ptxStatus_t ptxNSC_HAL_Rra(struct ptxNSC *nscCtx, uint16_t address, uint8_t *value)
Internal command to read certain SFRs.
ptxStatus_t ptxNSC_HAL_Wra(struct ptxNSC *nscCtx, uint16_t address, uint8_t value)
Internal command to write certain SFRs.
uint16_t ptxStatus_t
Status Type.
Definition ptxStatus.h:70
Main NSC component structure.
Definition ptxNSC.h:1184