Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
thermo3_drv.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 THERMO3_DRV_H
36 #define THERMO3_DRV_H
37 
38 #include "drv_digital_in.h"
39 #include "drv_digital_out.h"
40 #include "drv_i2c_master.h"
41 
42 // --------------------------------------------------------------- PUBLIC TYPES
51 typedef struct
52 {
53  // Input pins
54 
55  digital_in_t al;
56 
57  // Modules
58 
59  i2c_master_t i2c;
60 
61  // ctx variable
62 
63  uint8_t slave_address;
64 
65 } thermo3_t;
66 
70 typedef struct
71 {
72  // Communication gpio pins
73 
74  pin_name_t scl;
75  pin_name_t sda;
76 
77  // Additional gpio pins
78 
79  pin_name_t al;
80 
81  // static variable
82 
83  uint32_t i2c_speed;
84  uint8_t i2c_address;
85 
87  // End types group
89 
90 #endif // THERMO3_DRV_H
91  // End public_function group
94 
95 // ------------------------------------------------------------------------- END
Click configuration structure definition.
Definition: thermo3_drv.h:71
uint32_t i2c_speed
Definition: thermo3_drv.h:83
pin_name_t sda
Definition: thermo3_drv.h:75
pin_name_t al
Definition: thermo3_drv.h:79
uint8_t i2c_address
Definition: thermo3_drv.h:84
pin_name_t scl
Definition: thermo3_drv.h:74
Click ctx object definition.
Definition: thermo3_drv.h:52
i2c_master_t i2c
Definition: thermo3_drv.h:59
digital_in_t al
Definition: thermo3_drv.h:55
uint8_t slave_address
Definition: thermo3_drv.h:63