Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
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 "ptx_Status.h"
60#include "ptxOsal.h"
61#include "ptxLog.h"
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67/*
68 * ####################################################################################################################
69 * DEFINES / TYPES
70 * ####################################################################################################################
71 */
72#if defined (_WIN32) || defined (_WIN64) || defined (ming) || defined (__MINGW32__) || defined (__GNUWIN32__)
73 #define PTX_API_LIBFUNC __declspec(dllexport) /* */
74#else
75
76 #if defined (__GNUC__) /* GCC */
77 #define PTX_API_LIBFUNC __attribute__ ((visibility("default"))) /* requires -fvisibility=hidden as compiler option */
78 #elif defined (_linux) || defined (__linux) /* Linux with some other compiler */
79 #error Missing Platform Specification /* To be added */
80 #else
81 #error Missing Platform Specification
82 #endif
83#endif
84
85/*
86 * ####################################################################################################################
87 * TYPES
88 * ####################################################################################################################
89 */
90
99
103typedef enum ptxGPIO_Pin
104{
105 GPIO_Pin_5 = 5,
106 GPIO_Pin_6 = 6,
107 GPIO_Pin_7 = 7,
108 GPIO_Pin_8 = 8,
109 GPIO_Pin_9 = 9,
110 GPIO_Pin_10 = 10,
111 GPIO_Pin_11 = 11,
112 GPIO_Pin_12 = 12,
113
115
119typedef enum ptxGPIO_Flags
120{
121 GPIO_Flags_None,
122 GPIO_Flags_In_Enable_Internal_Pullup,
123 GPIO_Flags_Out_Enable_High_Driver_Strength,
124
126
130typedef enum ptxGPIO_Config
131{
132 GPIO_Config_Input,
133 GPIO_Config_Output,
134
136
140typedef struct ptxGPIO
141{
142 /* Components */
145 struct ptxOsal *OS;
147 void *StackComp;
150 uint8_t *DataShared;
153
154/*
155 * ####################################################################################################################
156 * API FUNCTIONS
157 * ####################################################################################################################
158 */
159
168PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Init (ptxGPIO_t *gpioComp, ptxGPIO_InitParams_t *initParams);
169
177PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Deinit (ptxGPIO_t *gpioComp);
178
190PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Config(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, ptxGPIO_Config_t gpioConfig, ptxGPIO_Flags_t gpioFlags);
191
202PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Write(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t gpioValue);
203
214PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Read(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t *gpioValue);
215
225PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Write_DAC(ptxGPIO_t *gpioComp, uint8_t dacValue);
226
227#ifdef __cplusplus
228}
229#endif
230
233#endif /* Guard */
234
ptxGPIO_Flags
Supported GPIO-Flags.
Definition ptxGPIO.h:120
struct ptxGPIO ptxGPIO_t
GPIO Component.
enum ptxGPIO_Flags ptxGPIO_Flags_t
Supported GPIO-Flags.
ptxGPIO_Pin
Supported GPIO-pins.
Definition ptxGPIO.h:104
PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Deinit(ptxGPIO_t *gpioComp)
Deinitializes the GPIO Component.
PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Write_DAC(ptxGPIO_t *gpioComp, uint8_t dacValue)
Sets 5-bit value to DAC (pin DAC_0)
PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Init(ptxGPIO_t *gpioComp, ptxGPIO_InitParams_t *initParams)
Initializes the GPIO Component.
ptxGPIO_Config
GPIO Config.
Definition ptxGPIO.h:131
enum ptxGPIO_Pin ptxGPIO_Pin_t
Supported GPIO-pins.
enum ptxGPIO_Config ptxGPIO_Config_t
GPIO Config.
PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Write(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t gpioValue)
Writes the selected GPIO-pin high or low.
struct ptxGPIO_InitParams ptxGPIO_InitParams_t
GPIO Initialization Parameters.
PTX_API_LIBFUNC ptxStatus_t ptxGPIO_Read(ptxGPIO_t *gpioComp, ptxGPIO_Pin_t gpioNr, uint8_t *gpioValue)
Reads the current value of a selected GPIO-pin.
uint16_t ptxStatus_t
Status Type.
Definition ptx_Status.h:82
enum ptxStatus_Comps ptxStatus_Comps_t
Component Definitions.
struct ptxSemaphore * ptxSemaphore_t
Semaphore Wrapper Structure - Forward Declaration.
Definition ptxOsal.h:100
GPIO Initialization Parameters.
Definition ptxGPIO.h:95
void * StackComp
Definition ptxGPIO.h:96
GPIO Component.
Definition ptxGPIO.h:141
ptxSemaphore_t * Sem_Completion
Definition ptxGPIO.h:148
ptxLog_t * LOG
Definition ptxGPIO.h:146
uint16_t * CompletionStatus
Definition ptxGPIO.h:149
void * StackComp
Definition ptxGPIO.h:147
uint8_t * DataShared
Definition ptxGPIO.h:150
ptxStatus_Comps_t CompId
Definition ptxGPIO.h:143
struct ptxOsal * OS
Definition ptxGPIO.h:145
Logger Component Structure.
Definition ptxLog.h:208