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 
37 #include "mikrosdk_version.h"
38 
39 #ifdef __GNUC__
40 #if mikroSDK_GET_VERSION < 20800ul
41 #include "rcu_delays.h"
42 #else
43 #include "delays.h"
44 #endif
45 #endif
46 
47 #include "drv_digital_out.h"
48 #include "drv_digital_in.h"
49 
50 // -------------------------------------------------------------- PUBLIC MACROS
60 #define MIC23099_MAP_MIKROBUS( cfg, mikrobus ) \
61  cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
62  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
63 
69 #define MIC23099_RETVAL uint8_t
70 
71 #define MIC23099_OK 0x00
72 #define MIC23099_INIT_ERROR 0xFF
73 
79 #define MIC23099_DISABLE 0x00
80 #define MIC23099_ENABLE 0x01
81  // End group macro
84 
85 // --------------------------------------------------------------- PUBLIC TYPES
94 typedef struct
95 {
96  // Output pins
97 
98  digital_out_t en;
99 
100  // Input pins
101 
102  digital_in_t int_pin;
103 
104 } mic23099_t;
105 
109 typedef struct
110 {
111  // Additional gpio pins
112 
113  pin_name_t en;
114  pin_name_t int_pin;
115 
117  // End types group
119 
120 // ------------------------------------------------------------------ CONSTANTS // End constants group
128 
129 // ------------------------------------------------------------------ VARIABLES // End variable group
137 
138 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
139 
145 #ifdef __cplusplus
146 extern "C"{
147 #endif
148 
158 
169 
178 
189 void mic23099_set_enable ( mic23099_t *ctx, uint8_t en_mode );
190 
200 
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 #endif // _MIC23099_H_
218  // End public_function group
221 
222 // ------------------------------------------------------------------------- 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:110
mic23099_t
Click ctx object definition.
Definition: mic23099.h:95
mic23099_reset
void mic23099_reset(mic23099_t *ctx)
Reset MIC23099 function.
mic23099_cfg_t::en
pin_name_t en
Definition: mic23099.h:113
mic23099_cfg_t::int_pin
pin_name_t int_pin
Definition: mic23099.h:114
mic23099_default_cfg
void mic23099_default_cfg(mic23099_t *ctx)
Click Default Configuration function.
mic23099_t::en
digital_out_t en
Definition: mic23099.h:98
mic23099_t::int_pin
digital_in_t int_pin
Definition: mic23099.h:102
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:69