Renesas PTX1xxR IoT-Reader API (non-OS) Version 7.3.1
Renesas Software Stack for IoT-Reader Applications (non-OS)
ptxGPIO.h
Go to the documentation of this file.
1
49#ifndef APIS_PTX_GPIO_H_
50#define APIS_PTX_GPIO_H_
51
52/*
53 * ####################################################################################################################
54 * INCLUDES
55 * ####################################################################################################################
56 */
57
58#include <stdint.h>
59#include "ptxStatus.h"
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65/*
66 * ####################################################################################################################
67 * DEFINES / TYPES
68 * ####################################################################################################################
69 */
70
74#define PTX_GPIO_FLAGS_ENABLE_INTERNAL_PULLUP (uint8_t)0x01
75#define PTX_GPIO_FLAGS_ENABLE_HIGH_DRIVER_STRENGTH (uint8_t)0x02
77/*
78 * ####################################################################################################################
79 * TYPES
80 * ####################################################################################################################
81 */
82
91
95typedef enum ptxGPIO_Pin
96{
97 GPIO_Pin_5 = 5,
98 GPIO_Pin_6 = 6,
99 GPIO_Pin_7 = 7,
100 GPIO_Pin_8 = 8,
101 GPIO_Pin_9 = 9,
102 GPIO_Pin_10 = 10,
103 GPIO_Pin_11 = 11,
104 GPIO_Pin_12 = 12,
105
107
111typedef enum ptxGPIO_Flags
112{
113 GPIO_Flags_None,
114 GPIO_Flags_In_Enable_Internal_Pullup,
115 GPIO_Flags_Out_Enable_High_Driver_Strength,
116
118
122typedef enum ptxGPIO_Config
123{
124 GPIO_Config_Input,
125 GPIO_Config_Output,
126
128
132typedef struct ptxGPIO
133{
134 /* Components */
137 struct ptxNSC *Nsc;
138 uint8_t GPIO_Cfg[12];
141
142/*
143 * ####################################################################################################################
144 * API FUNCTIONS
145 * ####################################################################################################################
146 */
147
157
166
179
190ptxStatus_t ptxGPIO_Write(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t gpioValue);
191
202ptxStatus_t ptxGPIO_Read(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t *gpioValue);
203
213ptxStatus_t ptxGPIO_Write_DAC(ptxGPIO_t *gpioComp, uint8_t dacValue);
214
215#ifdef __cplusplus
216}
217#endif
218
221#endif /* Guard */
222
ptxGPIO_Flags
Supported GPIO-Flags.
Definition ptxGPIO.h:112
struct ptxGPIO ptxGPIO_t
GPIO Component.
ptxStatus_t ptxGPIO_Deinit(ptxGPIO_t *gpioComp)
Deinitializes the GPIO Component.
enum ptxGPIO_Flags ptxGPIO_Flags_t
Supported GPIO-Flags.
ptxGPIO_Pin
Supported GPIO-pins.
Definition ptxGPIO.h:96
ptxGPIO_Config
GPIO Config.
Definition ptxGPIO.h:123
ptxStatus_t ptxGPIO_Init(ptxGPIO_t *gpioComp, ptxGPIO_InitParams_t *initParams)
Initializes the GPIO Component.
enum ptxGPIO_Pin ptxGPIO_Pin_t
Supported GPIO-pins.
ptxStatus_t ptxGPIO_Write(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t gpioValue)
Writes the selected GPIO-pin high or low.
ptxStatus_t ptxGPIO_Read(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t *gpioValue)
Reads the current value of a selected GPIO-pin.
enum ptxGPIO_Config ptxGPIO_Config_t
GPIO Config.
struct ptxGPIO_InitParams ptxGPIO_InitParams_t
GPIO Initialization Parameters.
ptxStatus_t ptxGPIO_Write_DAC(ptxGPIO_t *gpioComp, uint8_t dacValue)
Sets 5-bit value to DAC (pin DAC_0)
uint16_t ptxStatus_t
Status Type.
Definition ptxStatus.h:70
enum ptxStatus_Comps ptxStatus_Comps_t
Component Definitions.
GPIO Initialization Parameters.
Definition ptxGPIO.h:87
struct ptxNSC * Nsc
Definition ptxGPIO.h:88
GPIO Component.
Definition ptxGPIO.h:133
uint8_t GPIO_Cfg[12]
Definition ptxGPIO.h:138
struct ptxNSC * Nsc
Definition ptxGPIO.h:137
ptxStatus_Comps_t CompId
Definition ptxGPIO.h:135
Main NSC component structure.
Definition ptxNSC.h:1184