nanopower2  2.0.0.0
nanopower2.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  */
24 
33 // ----------------------------------------------------------------------------
34 
35 #ifndef NANOPOWER2_H
36 #define NANOPOWER2_H
37 
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 
41 // -------------------------------------------------------------- PUBLIC MACROS
52 #define NANOPOWER2_MAP_MIKROBUS( cfg, mikrobus ) \
53  cfg.out= MIKROBUS( mikrobus, MIKROBUS_INT )
54 
60 #define NANOPOWER2_OK 0
61 #define NANOPOWER2_ERROR -1
62  // End group macro
65 // --------------------------------------------------------------- PUBLIC TYPES
74 typedef struct
75 {
76  digital_in_t out;
77 
78 } nanopower2_t;
79 
83 typedef struct
84 {
85 
86  pin_name_t out;
87 
89  // End types group
91 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
92 
98 #ifdef __cplusplus
99 extern "C"{
100 #endif
101 
111 
120 
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 #endif // _NANOPOWER2_H_
136  // End public_function group
139 
140 // ------------------------------------------------------------------------- END
nanopower2_cfg_t::out
pin_name_t out
Definition: nanopower2.h:86
nanopower2_check_output
uint8_t nanopower2_check_output(nanopower2_t *ctx)
Click Check Output function.
nanopower2_cfg_t
Click configuration structure definition.
Definition: nanopower2.h:84
nanopower2_t
Click ctx object definition.
Definition: nanopower2.h:75
nanopower2_cfg_setup
void nanopower2_cfg_setup(nanopower2_cfg_t *cfg)
Config Object Initialization function.
nanopower2_t::out
digital_in_t out
Definition: nanopower2.h:76
nanopower2_init
err_t nanopower2_init(nanopower2_t *ctx, nanopower2_cfg_t *cfg)
Initialization function.