Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Relay.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Jan 29, 2020
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7#pragma once
8
9#include <cfg/cs_Boards.h>
10#include <common/cs_Types.h>
11
18class Relay {
19public:
20 void init(const boards_config_t& board);
21
25 bool hasRelay();
26
33 bool set(bool value);
34
35private:
36 bool _initialized = false;
38 uint8_t _pinRelayOn;
39 uint8_t _pinRelayOff;
40 TYPIFY(CONFIG_RELAY_HIGH_DURATION) _relayHighDurationMs;
41
44
45 bool turnOn();
46 bool turnOff();
47};
Class that provides a bi-stable relay.
Definition: cs_Relay.h:18
TYPIFY(CONFIG_RELAY_HIGH_DURATION) _relayHighDurationMs
void init(const boards_config_t &board)
uint8_t _pinRelayOn
Definition: cs_Relay.h:38
uint8_t _pinRelayDebug
Definition: cs_Relay.h:42
bool turnOff()
bool hasRelay()
Returns true when this board has a relay.
uint8_t _pinRelayOff
Definition: cs_Relay.h:39
bool _hasRelay
Definition: cs_Relay.h:37
bool _ledInverted
Definition: cs_Relay.h:43
bool set(bool value)
Set relay on or off.
bool _initialized
Definition: cs_Relay.h:36
bool turnOn()
@ CONFIG_RELAY_HIGH_DURATION
Board configuration.
Definition: cs_Boards.h:169