Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
Relay Class Reference

Class that provides a bi-stable relay. More...

#include <cs_Relay.h>

Public Member Functions

void init (const boards_config_t &board)
 
bool hasRelay ()
 Returns true when this board has a relay. More...
 
bool set (bool value)
 Set relay on or off. More...
 

Private Member Functions

 TYPIFY (CONFIG_RELAY_HIGH_DURATION) _relayHighDurationMs
 
bool turnOn ()
 
bool turnOff ()
 

Private Attributes

bool _initialized = false
 
bool _hasRelay
 
uint8_t _pinRelayOn
 
uint8_t _pinRelayOff
 
uint8_t _pinRelayDebug
 
bool _ledInverted
 

Detailed Description

Class that provides a bi-stable relay.

  • Controls GPIO.
  • Powers the relay long enough for it to toggle.
  • TODO: toggles relay in a non blocking / asynchronous way.

Member Function Documentation

◆ hasRelay()

bool Relay::hasRelay ( )

Returns true when this board has a relay.

◆ init()

void Relay::init ( const boards_config_t board)

◆ set()

bool Relay::set ( bool  value)

Set relay on or off.

Parameters
[in]valueTrue to set the relay on.
Returns
True on success.

◆ turnOff()

bool Relay::turnOff ( )
private

◆ turnOn()

bool Relay::turnOn ( )
private

◆ TYPIFY()

Relay::TYPIFY ( CONFIG_RELAY_HIGH_DURATION  )
private

Member Data Documentation

◆ _hasRelay

bool Relay::_hasRelay
private

◆ _initialized

bool Relay::_initialized = false
private

◆ _ledInverted

bool Relay::_ledInverted
private

◆ _pinRelayDebug

uint8_t Relay::_pinRelayDebug
private

◆ _pinRelayOff

uint8_t Relay::_pinRelayOff
private

◆ _pinRelayOn

uint8_t Relay::_pinRelayOn
private

The documentation for this class was generated from the following file: