Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Dimmer.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 Dimmer {
19public:
20 void init(const boards_config_t& board);
21
25 bool hasDimmer();
26
32 void start();
33
41 bool set(uint8_t intensity, bool fade);
42
48 void setSoftOnSpeed(uint8_t speed);
49
50private:
53 bool _hasDimmer = false;
54
56
57 bool _initialized = false;
58 bool _started = false;
59 bool _enabled = false;
60
61 void enable();
62};
Class that provides a dimmer.
Definition: cs_Dimmer.h:18
bool hasDimmer()
Returns true when this board has a dimmer.
bool _enabled
Definition: cs_Dimmer.h:59
TYPIFY(STATE_SOFT_ON_SPEED) _softOnSpeed
void init(const boards_config_t &board)
uint32_t _hardwareBoard
Definition: cs_Dimmer.h:51
void enable()
bool _initialized
Definition: cs_Dimmer.h:57
void start()
Start dimmer.
uint8_t _pinEnableDimmer
Definition: cs_Dimmer.h:52
bool _hasDimmer
Definition: cs_Dimmer.h:53
void setSoftOnSpeed(uint8_t speed)
Change the soft of speed.
bool _started
Definition: cs_Dimmer.h:58
bool set(uint8_t intensity, bool fade)
Set dimmer intensity.
@ STATE_SOFT_ON_SPEED
Board configuration.
Definition: cs_Boards.h:169