Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_ACR01B2C.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Jan 25, 2022
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7
8#pragma once
9
10#include <cfg/cs_Boards.h>
11#include <cfg/cs_DeviceTypes.h>
12
13/* ********************************************************************************************************************
14 * Crownstone Plug Zero
15 * *******************************************************************************************************************/
16
41 config->pinDimmer = 8;
42 config->pinRelayOn = 6;
43 config->pinRelayOff = 7;
46 config->pinAinDimmerTemp = GpioToAin(5);
47 config->pinRx = 20;
48 config->pinTx = 19;
49
50 config->pinLed[LED_RED] = 10;
51 config->pinLed[LED_GREEN] = 9;
52
53 config->flags.dimmerInverted = false;
54 config->flags.enableUart = false;
55 config->flags.enableLeds = false;
56 config->flags.ledInverted = false;
57 config->flags.dimmerTempInverted = false;
58 config->flags.usesNfcPins = false; // Set to true if you want to use the LEDs.
59 config->flags.canTryDimmingOnBoot = false;
60 config->flags.canDimOnWarmBoot = false;
61 config->flags.dimmerOnWhenPinsFloat = true;
62
64
65 config->voltageMultiplier[GAIN_SINGLE] = 0.2f;
66 config->currentMultiplier[GAIN_SINGLE] = 0.0045f;
67
68 // TODO: 2010 seems to be better than 2003 (check this old remark with theory).
69 config->voltageOffset[GAIN_SINGLE] = 2003;
70 // TODO: 1991 seems to be better than 1997 (check this old remark with theory).
71 config->currentOffset[GAIN_SINGLE] = 1997;
72
73 config->powerOffsetMilliWatt = 1500;
74
75 // ADC values [0, 4095] map to [0V, 1.2V].
76 config->voltageAdcRangeMilliVolt = 1200;
77 config->currentAdcRangeMilliVolt = 1200;
78
79 // About 1.5kOhm --> 90-100C
80 config->pwmTempVoltageThreshold = 0.76;
81 // About 0.7kOhm --> 70-95C
82 config->pwmTempVoltageThresholdDown = 0.41;
83
84 config->minTxPower = -20;
85
86 config->scanWindowUs = 3 * config->scanIntervalUs / 4;
88}
void asACR01B2C(boards_config_t *config)
The very first plug that is delivered to Crownstone users.
Definition: cs_ACR01B2C.h:40
uint8_t GpioToAin(uint8_t gpio)
@ LED_GREEN
Definition: cs_Boards.h:133
@ LED_RED
Definition: cs_Boards.h:132
@ GAIN_SINGLE
Definition: cs_Boards.h:101
#define DEVICE_CROWNSTONE_PLUG
Definition: cs_DeviceTypes.h:24
Board configuration.
Definition: cs_Boards.h:169
uint8_t pinDimmer
GPIO pin to control the IGBTs.
Definition: cs_Boards.h:174
int32_t powerOffsetMilliWatt
Measured power when there is no load (mW).
Definition: cs_Boards.h:306
int8_t minTxPower
The minimum radio transmission power to be used.
Definition: cs_Boards.h:326
int32_t currentOffset[GAIN_COUNT]
Offset for current measurement (in ADC values).
Definition: cs_Boards.h:303
struct boards_config_t::@7 flags
Flags about pin order, presence of components, etc.
bool enableUart
True if the board should have UART enabled by default.
Definition: cs_Boards.h:243
uint8_t pinAinDimmerTemp
Analog input pin to read the dimmer temperature.
Definition: cs_Boards.h:201
bool ledInverted
True if LED is off when GPIO is set high.
Definition: cs_Boards.h:250
uint8_t pinAinCurrent[GAIN_COUNT]
Analog input pins to read the current with different gains (if present).
Definition: cs_Boards.h:189
uint32_t scanIntervalUs
Scan interval in μs.
Definition: cs_Boards.h:345
bool canTryDimmingOnBoot
True if the Crownstone can try dimming at boot, because it has an accurate enough power measurement,...
Definition: cs_Boards.h:263
float pwmTempVoltageThresholdDown
Voltage of PWM thermometer at which the dimmer is cool enough again.
Definition: cs_Boards.h:332
bool dimmerOnWhenPinsFloat
True if the dimmer can be on when the pins are floating (during boot).
Definition: cs_Boards.h:269
uint32_t currentAdcRangeMilliVolt
Range in mV to be used for the current pin.
Definition: cs_Boards.h:319
float voltageMultiplier[GAIN_COUNT]
Multiplication factor for voltage measurement.
Definition: cs_Boards.h:282
uint32_t scanWindowUs
Scan window in μs.
Definition: cs_Boards.h:353
int8_t tapToToggleDefaultRssiThreshold
Default RSSI threshold, above which tap to toggle will trigger.
Definition: cs_Boards.h:358
uint8_t pinTx
GPIO pin to send UART.
Definition: cs_Boards.h:216
bool dimmerInverted
True if the dimmer is inverted (setting gpio high turns dimmer off).
Definition: cs_Boards.h:240
uint8_t pinLed[LED_COUNT]
GPIO pins of LEDs.
Definition: cs_Boards.h:225
bool enableLeds
True if the board has LEDs that should be enabled by default.
Definition: cs_Boards.h:247
uint8_t deviceType
Device type, e.g.
Definition: cs_Boards.h:276
bool dimmerTempInverted
True if the temperature sensor of the dimmer is inverted (NTC).
Definition: cs_Boards.h:253
bool canDimOnWarmBoot
True if the Crownstone can dim immediately after a warm boot.
Definition: cs_Boards.h:266
float pwmTempVoltageThreshold
Voltage of PWM thermometer at which the dimmer is too hot.
Definition: cs_Boards.h:329
float currentMultiplier[GAIN_COUNT]
Multiplication factor for current measurement.
Definition: cs_Boards.h:294
uint8_t pinRelayOn
GPIO pin to switch the relay on.
Definition: cs_Boards.h:183
uint8_t pinAinVoltage[GAIN_COUNT]
Analog input pins to read the voltage with different gains (if present).
Definition: cs_Boards.h:192
uint8_t pinRelayOff
GPIO pin to switch the relay off.
Definition: cs_Boards.h:186
bool usesNfcPins
True if the NFC pins (p0.09 and p0.10) are used as GPIO.
Definition: cs_Boards.h:256
int32_t voltageOffset[GAIN_COUNT]
Offset for voltage measurement (in ADC values).
Definition: cs_Boards.h:297
uint32_t voltageAdcRangeMilliVolt
Range in mV to be used for the voltage pin.
Definition: cs_Boards.h:313
uint8_t pinRx
GPIO pin to receive UART.
Definition: cs_Boards.h:213