ireclipse2  2.1.0.0
ireclipse2.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 IRECLIPSE2_H
29 #define IRECLIPSE2_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 
67 #define IRECLIPSE2_STATE_NO_ECLIPSE 0
68 #define IRECLIPSE2_STATE_ECLIPSE 1
69  // ireclipse2_set
71 
86 #define IRECLIPSE2_MAP_MIKROBUS( cfg, mikrobus ) \
87  cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST ); \
88  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
89  // ireclipse2_map // ireclipse2
92 
97 typedef struct
98 {
99  digital_out_t en;
101  digital_in_t int_pin;
103 } ireclipse2_t;
104 
109 typedef struct
110 {
111  pin_name_t en;
112  pin_name_t int_pin;
115 
120 typedef enum
121 {
123  IRECLIPSE2_ERROR = -1
124 
126 
143 
158 
169 
180 
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 #endif // IRECLIPSE2_H
197  // ireclipse2
199 
200 // ------------------------------------------------------------------------ END
IRECLIPSE2_OK
@ IRECLIPSE2_OK
Definition: ireclipse2.h:122
ireclipse2_return_value_t
ireclipse2_return_value_t
IR Eclipse 2 Click return value data.
Definition: ireclipse2.h:121
ireclipse2_t::int_pin
digital_in_t int_pin
Definition: ireclipse2.h:101
ireclipse2_get_state
uint8_t ireclipse2_get_state(ireclipse2_t *ctx)
IR Eclipse 2 get state function.
ireclipse2_t
IR Eclipse 2 Click context object.
Definition: ireclipse2.h:98
ireclipse2_t::en
digital_out_t en
Definition: ireclipse2.h:99
ireclipse2_disable
void ireclipse2_disable(ireclipse2_t *ctx)
IR Eclipse 2 disable function.
IRECLIPSE2_ERROR
@ IRECLIPSE2_ERROR
Definition: ireclipse2.h:123
ireclipse2_cfg_t::int_pin
pin_name_t int_pin
Definition: ireclipse2.h:112
ireclipse2_cfg_t
IR Eclipse 2 Click configuration object.
Definition: ireclipse2.h:110
ireclipse2_init
err_t ireclipse2_init(ireclipse2_t *ctx, ireclipse2_cfg_t *cfg)
IR Eclipse 2 initialization function.
ireclipse2_cfg_setup
void ireclipse2_cfg_setup(ireclipse2_cfg_t *cfg)
IR Eclipse 2 configuration object setup function.
ireclipse2_cfg_t::en
pin_name_t en
Definition: ireclipse2.h:111
ireclipse2_enable
void ireclipse2_enable(ireclipse2_t *ctx)
IR Eclipse 2 enable function.