CCAux  2.20.0.0
CCAux API reference
DigIO.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 2023 CrossControl AB
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; with
8  * version 2.1 of the License.
9  */
10 /*
11  * File description:
12  * Read digital inputs
13  *
14  * Use the function GetDigIO() to get a handle to pass on to the other functions.
15  * Use the method DigIO_release(DIGIOHANDLE) to return the handle.
16  *
17  * Example Usage:
18  * @include digio_example.cpp
19  *
20  ************************************************/
21 #ifndef CC_DIGIO_H
22 #define CC_DIGIO_H
23 
24 #include "CCAuxErrors.h"
25 #include "CCPlatform.h"
26 
27 #ifdef __cplusplus
28 namespace CrossControl
29 {
30 #endif
31 
32 typedef void *DIGIOHANDLE;
33 
34 const uint8_t DigitalIn_1 = (1 << 0);
35 const uint8_t DigitalIn_2 = (1 << 1);
36 const uint8_t DigitalIn_3 = (1 << 2);
37 const uint8_t DigitalIn_4 = (1 << 3);
58 EXTERN_C
59 CCAUXDLL_API
61 CCAUXDLL_CALLING_CONV
62 GetDigIO(void);
63 
74 EXTERN_C
75 CCAUXDLL_API
76 void CCAUXDLL_CALLING_CONV DigIO_release(DIGIOHANDLE);
77 
95 EXTERN_C
96 CCAUXDLL_API
97 eErr CCAUXDLL_CALLING_CONV DigIO_getDigIO(DIGIOHANDLE, uint8_t *status);
98 
116 EXTERN_C
117 CCAUXDLL_API
118 eErr CCAUXDLL_CALLING_CONV DigIO_setDigIO(DIGIOHANDLE, uint8_t state);
119 
146 EXTERN_C
147 CCAUXDLL_API
148 eErr CCAUXDLL_CALLING_CONV DigIO_getDigPowerOutput(DIGIOHANDLE, PowerOutput output, CCStatus *enabled, uint8_t *status);
149 
166 EXTERN_C
167 CCAUXDLL_API
168 eErr CCAUXDLL_CALLING_CONV DigIO_setDigPowerOutput(DIGIOHANDLE, PowerOutput output, CCStatus enabled);
169 
171 #ifdef __cplusplus
172 } /* namespace CrossControl */
173 #endif
174 
175 #endif /* CC_DIGIO_H */
unsigned char uint8_t
Definition: CCAuxTypes.h:37
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV DigIO_getDigIO(DIGIOHANDLE, uint8_t *status)
EXTERN_C CCAUXDLL_API DIGIOHANDLE CCAUXDLL_CALLING_CONV GetDigIO(void)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV DigIO_setDigIO(DIGIOHANDLE, uint8_t state)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV DigIO_setDigPowerOutput(DIGIOHANDLE, PowerOutput output, CCStatus enabled)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV DigIO_release(DIGIOHANDLE)
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV DigIO_getDigPowerOutput(DIGIOHANDLE, PowerOutput output, CCStatus *enabled, uint8_t *status)
Definition: About.h:30
PowerOutput
Definition: CCAuxTypes.h:690
const uint8_t DigitalIn_2
Definition: DigIO.h:35
void * DIGIOHANDLE
Definition: DigIO.h:32
CCStatus
Definition: CCAuxTypes.h:153
const uint8_t DigitalIn_4
Definition: DigIO.h:37
const uint8_t DigitalIn_3
Definition: DigIO.h:36
eErr
Definition: CCAuxTypes.h:162
const uint8_t DigitalIn_1
Definition: DigIO.h:34