Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
relay_click.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2022, Cascoda Ltd.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the copyright holder nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32/*
33 * Example click interface driver
34*/
35
36#ifndef RELAY_CLICK_H
37#define RELAY_CLICK_H
38
39#include <stdint.h>
40
42{
43 RELAY_OFF = 0, /* relay is off */
44 RELAY_ON = 1 /* relay is on */
45};
46
48{
49 RELAY_ST_OK = 0, /* read values ok */
50 RELAY_ST_FAIL = 1 /* acquisition failed */
51};
52
53/* new functions */
54void MIKROSDK_RELAY_set_state(uint8_t num, uint8_t state);
55void MIKROSDK_RELAY_pin_mapping(uint8_t r1, uint8_t r2);
56uint8_t MIKROSDK_RELAY_Initialise(void);
57uint8_t MIKROSDK_RELAY_Driver(uint8_t relay_1_state, uint8_t relay_2_state);
58
59#endif // RELAY_CLICK_H
int num
Definition hal_i2c_master.c:49
relay_state
Definition relay_click.h:42
@ RELAY_ON
Definition relay_click.h:44
@ RELAY_OFF
Definition relay_click.h:43
uint8_t MIKROSDK_RELAY_Initialise(void)
Definition relay.c:84
void MIKROSDK_RELAY_set_state(uint8_t num, uint8_t state)
Definition relay.c:59
uint8_t MIKROSDK_RELAY_Driver(uint8_t relay_1_state, uint8_t relay_2_state)
Definition relay.c:105
void MIKROSDK_RELAY_pin_mapping(uint8_t r1, uint8_t r2)
Definition relay.c:77
relay_status
Definition relay_click.h:48
@ RELAY_ST_FAIL
Definition relay_click.h:50
@ RELAY_ST_OK
Definition relay_click.h:49