solidswitch8  2.1.0.0
solidswitch8.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef SOLIDSWITCH8_H
29 #define SOLIDSWITCH8_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
39 #ifdef PREINIT_SUPPORTED
40 #include "preinit.h"
41 #endif
42 
43 #ifdef MikroCCoreVersion
44  #if MikroCCoreVersion >= 1
45  #include "delays.h"
46  #endif
47 #endif
48 
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 
72 #define SOLIDSWITCH8_PIN_STATE_LOW 0x00
73 #define SOLIDSWITCH8_PIN_STATE_HIGH 0x01
74  // solidswitch8_set
76 
91 #define SOLIDSWITCH8_MAP_MIKROBUS( cfg, mikrobus ) \
92  cfg.err = MIKROBUS( mikrobus, MIKROBUS_RST ); \
93  cfg.in = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
94  cfg.sts = MIKROBUS( mikrobus, MIKROBUS_INT )
95  // solidswitch8_map // solidswitch8
98 
103 typedef struct
104 {
105  digital_out_t err;
106  digital_out_t in;
108  digital_in_t sts;
111 
116 typedef struct
117 {
118  pin_name_t err;
119  pin_name_t in;
120  pin_name_t sts;
123 
128 typedef enum
129 {
131  SOLIDSWITCH8_ERROR = -1
132 
134 
151 
166 
178 
189 void solidswitch8_set_err_pin ( solidswitch8_t *ctx, uint8_t pin_state );
190 
201 void solidswitch8_set_in_pin ( solidswitch8_t *ctx, uint8_t pin_state );
202 
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 #endif // SOLIDSWITCH8_H
219  // solidswitch8
221 
222 // ------------------------------------------------------------------------ END
solidswitch8_t
SolidSwitch 8 Click context object.
Definition: solidswitch8.h:104
solidswitch8_t::in
digital_out_t in
Definition: solidswitch8.h:106
solidswitch8_cfg_t
SolidSwitch 8 Click configuration object.
Definition: solidswitch8.h:117
solidswitch8_default_cfg
void solidswitch8_default_cfg(solidswitch8_t *ctx)
SolidSwitch 8 default configuration function.
solidswitch8_set_in_pin
void solidswitch8_set_in_pin(solidswitch8_t *ctx, uint8_t pin_state)
SolidSwitch 8 in pin setting function.
solidswitch8_set_err_pin
void solidswitch8_set_err_pin(solidswitch8_t *ctx, uint8_t pin_state)
SolidSwitch 8 err pin setting function.
solidswitch8_t::sts
digital_in_t sts
Definition: solidswitch8.h:108
solidswitch8_cfg_t::err
pin_name_t err
Definition: solidswitch8.h:118
solidswitch8_init
err_t solidswitch8_init(solidswitch8_t *ctx, solidswitch8_cfg_t *cfg)
SolidSwitch 8 initialization function.
solidswitch8_get_sts_pin
uint8_t solidswitch8_get_sts_pin(solidswitch8_t *ctx)
SolidSwitch 8 sts pin reading function.
solidswitch8_cfg_t::sts
pin_name_t sts
Definition: solidswitch8.h:120
solidswitch8_t::err
digital_out_t err
Definition: solidswitch8.h:105
solidswitch8_cfg_setup
void solidswitch8_cfg_setup(solidswitch8_cfg_t *cfg)
SolidSwitch 8 configuration object setup function.
solidswitch8_cfg_t::in
pin_name_t in
Definition: solidswitch8.h:119
SOLIDSWITCH8_OK
@ SOLIDSWITCH8_OK
Definition: solidswitch8.h:130
SOLIDSWITCH8_ERROR
@ SOLIDSWITCH8_ERROR
Definition: solidswitch8.h:131
solidswitch8_return_value_t
solidswitch8_return_value_t
SolidSwitch 8 Click return value data.
Definition: solidswitch8.h:129