Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
relay_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 RELAY_DRV_H
36 #define RELAY_DRV_H
37 
38 #include "drv_digital_out.h"
39 
44 #define RELAY_STATE_ON 1
45 #define RELAY_STATE_OFF 0
52 #define RELAY_NUM_1 1
53 #define RELAY_NUM_2 2 // End group macro
57 // --------------------------------------------------------------- PUBLIC TYPES
66 typedef struct
67 {
68  // Output pins
69 
70  digital_out_t rel2;
71  digital_out_t rel1;
72 
73 } relay_t;
74 
78 typedef struct
79 {
80  // Additional gpio pins
81 
82  pin_name_t rel2;
83  pin_name_t rel1;
84 
85 } relay_cfg_t;
86  // End types group
88 
89 #endif // RELAY_DRV_H
90  // End public_function group
93 
94 // ------------------------------------------------------------------------- END
Click configuration structure definition.
Definition: relay_drv.h:79
pin_name_t rel2
Definition: relay_drv.h:82
pin_name_t rel1
Definition: relay_drv.h:83
Click ctx object definition.
Definition: relay_drv.h:67
digital_out_t rel1
Definition: relay_drv.h:71
digital_out_t rel2
Definition: relay_drv.h:70