Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
ptxHal_UART_Ext.h
Go to the documentation of this file.
1
43#ifndef COMPS_HAL_PTXHAL_UART_EXT_H_
44#define COMPS_HAL_PTXHAL_UART_EXT_H_
45
46
47/*
48 * ####################################################################################################################
49 * INCLUDES
50 * ####################################################################################################################
51 */
52
53#include "ptxHal_Ext.h"
54
55#if (defined PTX_PLAT_MACOS) || (defined PTX_PLAT_LINUX) || (defined PTX_PLAT_ANDROID)
56
57# include <unistd.h>
58# include <semaphore.h>
59# include <fcntl.h>
60# include <pthread.h>
61# include <sys/ioctl.h>
62# include <sys/select.h>
63# include <sys/eventfd.h>
64# include <sys/stat.h>
65# include <sys/time.h>
66# include <errno.h>
67# include <termios.h>
68# include <signal.h>
69
70#elif defined PTX_PLAT_WINDOWS
71
72# include <windows.h>
73# include <process.h>
74
75 #if (defined PTX_FEATURES_TESTING)
76 #include "ptxIo.h"
77 #endif
78
79#else
80# error Invalid platform.
81#endif
82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
87/*
88 * ####################################################################################################################
89 * DEFINES / TYPES
90 * ####################################################################################################################
91 */
92#define PTX_HAL_UART_MAX_LEN 256
95/*
96 * ####################################################################################################################
97 * INTERNALS
98 * ####################################################################################################################
99 */
100
106{
107 uint8_t IsTxBlocking;
108#if (defined PTX_PLAT_MACOS) || (defined PTX_PLAT_LINUX) || (defined PTX_PLAT_ANDROID)
109
110 uint32_t WriteTimeout;
111 struct termios OldTio;
112 struct termios Tio;
113 fd_set FdTx;
114 fd_set FdRx;
115 int Fd;
116 int Efd;
117
118#elif defined PTX_PLAT_WINDOWS
119
120#if (defined PTX_FEATURES_TESTING)
121 ptxOsalLib_t *LH;
122 void *H;
123 ptxIo_Functions_t Fn;
124#endif
125
126 COMMTIMEOUTS OldTimeouts;
127 COMMTIMEOUTS Timeouts;
128 OVERLAPPED OvTx;
129 OVERLAPPED OvRx;
130 OVERLAPPED OvTxDone;
131 DCB Dcb;
132 DCB OldDcb;
133 HANDLE Dev;
134 HANDLE CancelEvent;
135 uint8_t CancelFlag;
136
137#else
138# error "Invalid platform"
139#endif
140
142 struct ptxOsal *OS;
143 struct ptxLog *LOG;
145 uint32_t ReadTimeout;
146 uint8_t AddSof;
147};
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif /* COMPS_HAL_PTXHAL_UART_EXT_H_ */
154
155
enum ptxHal_InterfaceType ptxHal_InterfaceType_t
struct ptxMutex * ptxMutex_t
Mutex Wrapper Structure - Forward Declaration.
Definition ptxOsal.h:95
UART specific data and operational state.
Definition ptxHal_UART_Ext.h:106
uint32_t ReadTimeout
Definition ptxHal_UART_Ext.h:145
struct ptxLog * LOG
Definition ptxHal_UART_Ext.h:143
ptxMutex_t Mutex
Definition ptxHal_UART_Ext.h:144
uint8_t AddSof
Definition ptxHal_UART_Ext.h:146
ptxHal_InterfaceType_t InfType
Definition ptxHal_UART_Ext.h:141
uint8_t IsTxBlocking
Definition ptxHal_UART_Ext.h:107
struct ptxOsal * OS
Definition ptxHal_UART_Ext.h:142
Logger Component Structure.
Definition ptxLog.h:208