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 "drv_digital_out.h"
38 #include "drv_digital_in.h"
39 
40 // -------------------------------------------------------------- PUBLIC MACROS
50 #define MIC23099_MAP_MIKROBUS( cfg, mikrobus ) \
51  cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
52  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
53 
59 #define MIC23099_RETVAL uint8_t
60 
61 #define MIC23099_OK 0x00
62 #define MIC23099_INIT_ERROR 0xFF
63 
69 #define MIC23099_DISABLE 0x00
70 #define MIC23099_ENABLE 0x01
71  // End group macro
74 
75 // --------------------------------------------------------------- PUBLIC TYPES
84 typedef struct
85 {
86  // Output pins
87 
88  digital_out_t en;
89 
90  // Input pins
91 
92  digital_in_t int_pin;
93 
94 } mic23099_t;
95 
99 typedef struct
100 {
101  // Additional gpio pins
102 
103  pin_name_t en;
104  pin_name_t int_pin;
105 
107  // End types group
109 
110 // ------------------------------------------------------------------ CONSTANTS // End constants group
118 
119 // ------------------------------------------------------------------ VARIABLES // End variable group
127 
128 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
129 
135 #ifdef __cplusplus
136 extern "C"{
137 #endif
138 
147 void mic23099_cfg_setup ( mic23099_cfg_t *cfg );
148 
159 
167 void mic23099_default_cfg ( mic23099_t *ctx );
168 
179 void mic23099_set_enable ( mic23099_t *ctx, uint8_t en_mode );
180 
189 void mic23099_reset ( mic23099_t *ctx );
190 
202 uint8_t mic23099_check_power_good ( mic23099_t *ctx );
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 #endif // _MIC23099_H_
208  // End public_function group
211 
212 // ------------------------------------------------------------------------- END
void mic23099_set_enable(mic23099_t *ctx, uint8_t en_mode)
Enable MIC23099 function.
#define MIC23099_RETVAL
Definition: mic23099.h:59
void mic23099_reset(mic23099_t *ctx)
Reset MIC23099 function.
void mic23099_default_cfg(mic23099_t *ctx)
Click Default Configuration function.
digital_in_t int_pin
Definition: mic23099.h:92
MIC23099_RETVAL mic23099_init(mic23099_t *ctx, mic23099_cfg_t *cfg)
Initialization function.
uint8_t mic23099_check_power_good(mic23099_t *ctx)
Check Power Good pin function.
pin_name_t en
Definition: mic23099.h:103
Click configuration structure definition.
Definition: mic23099.h:99
digital_out_t en
Definition: mic23099.h:88
Click ctx object definition.
Definition: mic23099.h:84
pin_name_t int_pin
Definition: mic23099.h:104
void mic23099_cfg_setup(mic23099_cfg_t *cfg)
Config Object Initialization function.