mic23099  2.0.0.0
mic23099.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright© 2020 MikroElektronika d.o.o.
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22  * OR OTHER DEALINGS IN THE SOFTWARE.
23  */
32 // ----------------------------------------------------------------------------
33 
34 #ifndef MIC23099_H
35 #define MIC23099_H
36 
41 #ifdef PREINIT_SUPPORTED
42 #include "preinit.h"
43 #endif
44 
45 #ifdef MikroCCoreVersion
46  #if MikroCCoreVersion >= 1
47  #include "delays.h"
48  #endif
49 #endif
50 
51 #include "drv_digital_out.h"
52 #include "drv_digital_in.h"
53 
54 // -------------------------------------------------------------- PUBLIC MACROS
64 #define MIC23099_MAP_MIKROBUS( cfg, mikrobus ) \
65  cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
66  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
67 
73 #define MIC23099_RETVAL uint8_t
74 
75 #define MIC23099_OK 0x00
76 #define MIC23099_INIT_ERROR 0xFF
77 
83 #define MIC23099_DISABLE 0x00
84 #define MIC23099_ENABLE 0x01
85  // End group macro
88 
89 // --------------------------------------------------------------- PUBLIC TYPES
98 typedef struct
99 {
100  // Output pins
101 
102  digital_out_t en;
103 
104  // Input pins
105 
106  digital_in_t int_pin;
107 
108 } mic23099_t;
109 
113 typedef struct
114 {
115  // Additional gpio pins
116 
117  pin_name_t en;
118  pin_name_t int_pin;
119 
121  // End types group
123 
124 // ------------------------------------------------------------------ CONSTANTS // End constants group
132 
133 // ------------------------------------------------------------------ VARIABLES // End variable group
141 
142 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
143 
149 #ifdef __cplusplus
150 extern "C"{
151 #endif
152 
162 
173 
182 
193 void mic23099_set_enable ( mic23099_t *ctx, uint8_t en_mode );
194 
204 
217 
218 #ifdef __cplusplus
219 }
220 #endif
221 #endif // _MIC23099_H_
222  // End public_function group
225 
226 // ------------------------------------------------------------------------- END
mic23099_check_power_good
uint8_t mic23099_check_power_good(mic23099_t *ctx)
Check Power Good pin function.
mic23099_cfg_setup
void mic23099_cfg_setup(mic23099_cfg_t *cfg)
Config Object Initialization function.
mic23099_cfg_t
Click configuration structure definition.
Definition: mic23099.h:114
mic23099_t
Click ctx object definition.
Definition: mic23099.h:99
mic23099_reset
void mic23099_reset(mic23099_t *ctx)
Reset MIC23099 function.
mic23099_cfg_t::en
pin_name_t en
Definition: mic23099.h:117
mic23099_cfg_t::int_pin
pin_name_t int_pin
Definition: mic23099.h:118
mic23099_default_cfg
void mic23099_default_cfg(mic23099_t *ctx)
Click Default Configuration function.
mic23099_t::en
digital_out_t en
Definition: mic23099.h:102
mic23099_t::int_pin
digital_in_t int_pin
Definition: mic23099.h:106
mic23099_set_enable
void mic23099_set_enable(mic23099_t *ctx, uint8_t en_mode)
Enable MIC23099 function.
mic23099_init
MIC23099_RETVAL mic23099_init(mic23099_t *ctx, mic23099_cfg_t *cfg)
Initialization function.
MIC23099_RETVAL
#define MIC23099_RETVAL
Definition: mic23099.h:73