mic3  2.0.0.0
mic3.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 MIC3_H
29 #define MIC3_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 
58 #define MIC3_PIN_STATE_HIGH 0x01
59 #define MIC3_PIN_STATE_LOW 0x00
60  // mic3_set
62 
77 #define MIC3_MAP_MIKROBUS( cfg, mikrobus ) \
78  cfg.shd = MIKROBUS( mikrobus, MIKROBUS_CS )
79  // mic3_map // mic3
82 
87 typedef struct
88 {
89  digital_out_t shd;
91 } mic3_t;
92 
97 typedef struct
98 {
99  pin_name_t shd;
102 } mic3_cfg_t;
103 
108 typedef enum
109 {
110  MIC3_OK = 0,
111  MIC3_ERROR = -1
112 
114 
130 void mic3_cfg_setup ( mic3_cfg_t *cfg );
131 
145 err_t mic3_init ( mic3_t *ctx, mic3_cfg_t *cfg );
146 
160 err_t mic3_default_cfg ( mic3_t *ctx );
161 
171 void mic3_shd_pin_set ( mic3_t *ctx, uint8_t state );
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 #endif // MIC3_H
177  // mic3
179 
180 // ------------------------------------------------------------------------ END
MIC3_OK
Definition: mic3.h:109
mic3_return_value_t
mic3_return_value_t
MIC 3 Click return value data.
Definition: mic3.h:107
mic3_default_cfg
err_t mic3_default_cfg(mic3_t *ctx)
MIC 3 default configuration function.
mic3_t
MIC 3 Click context object.
Definition: mic3.h:86
mic3_cfg_setup
void mic3_cfg_setup(mic3_cfg_t *cfg)
MIC 3 configuration object setup function.
mic3_shd_pin_set
void mic3_shd_pin_set(mic3_t *ctx, uint8_t state)
MIC 3 SHD pin setting function.
mic3_init
err_t mic3_init(mic3_t *ctx, mic3_cfg_t *cfg)
MIC 3 initialization function.
MIC3_ERROR
Definition: mic3.h:110
mic3_cfg_t
MIC 3 Click configuration object.
Definition: mic3.h:96