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_RETVAL uint8_t
61 
62 #define NANOPOWER2_OK 0x00
63 #define NANOPOWER2_INIT_ERROR 0xFF
64  // End group macro
67 // --------------------------------------------------------------- PUBLIC TYPES
76 typedef struct
77 {
78  digital_in_t out;
79 
80 } nanopower2_t;
81 
85 typedef struct
86 {
87 
88  pin_name_t out;
89 
91  // End types group
93 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
94 
100 #ifdef __cplusplus
101 extern "C"{
102 #endif
103 
113 
122 
123 
134 
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 #endif // _NANOPOWER2_H_
140  // End public_function group
143 
144 // ------------------------------------------------------------------------- END
nanopower2_cfg_t::out
pin_name_t out
Definition: nanopower2.h:88
NANOPOWER2_RETVAL
#define NANOPOWER2_RETVAL
Definition: nanopower2.h:60
nanopower2_cfg_t
Click configuration structure definition.
Definition: nanopower2.h:85
nanopower2_t
Click ctx object definition.
Definition: nanopower2.h:76
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:78
nanopower2_check_output
NANOPOWER2_RETVAL nanopower2_check_output(nanopower2_t *ctx)
Click Check Output function.
nanopower2_init
NANOPOWER2_RETVAL nanopower2_init(nanopower2_t *ctx, nanopower2_cfg_t *cfg)
Initialization function.