Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
Board configuration. More...
#include <cs_Boards.h>
Public Attributes | |
uint32_t | hardwareBoard |
The hardware board type (number). More... | |
uint8_t | pinDimmer |
GPIO pin to control the IGBTs. More... | |
uint8_t | pinEnableDimmer |
GPIO pin to enable the IGBT circuit. More... | |
uint8_t | pinRelayDebug |
GPIO to debug the relay: turns on when relay is turned on, and vice versa. Inverted when LEDs are inverted. More... | |
uint8_t | pinRelayOn |
GPIO pin to switch the relay on. More... | |
uint8_t | pinRelayOff |
GPIO pin to switch the relay off. More... | |
uint8_t | pinAinCurrent [GAIN_COUNT] |
Analog input pins to read the current with different gains (if present). More... | |
uint8_t | pinAinVoltage [GAIN_COUNT] |
Analog input pins to read the voltage with different gains (if present). More... | |
uint8_t | pinAinVoltageAfterLoad [GAIN_COUNT] |
Analog input pins to read the voltage after the load with different gains (if present). More... | |
uint8_t | pinAinZeroRef |
Analog input pin to read 'zero' / offset (to be used for both current and voltage measurements). More... | |
uint8_t | pinAinDimmerTemp |
Analog input pin to read the dimmer temperature. More... | |
uint8_t | pinAinEarth |
Analog input pin to measure EARTH. More... | |
uint8_t | pinCurrentZeroCrossing |
GPIO pin to get zero-crossing information for current. More... | |
uint8_t | pinVoltageZeroCrossing |
GPIO pin to get zero-crossing information for voltage. More... | |
uint8_t | pinRx |
GPIO pin to receive UART. More... | |
uint8_t | pinTx |
GPIO pin to send UART. More... | |
uint8_t | pinGpio [GPIO_INDEX_COUNT] |
GPIO pins that can be used as GPIO by the user, for example microapps. More... | |
uint8_t | pinButton [BUTTON_COUNT] |
GPIO pins of buttons (on dev. kit). More... | |
uint8_t | pinLed [LED_COUNT] |
GPIO pins of LEDs. More... | |
struct { | |
uint8_t cs | |
Chip select pin. More... | |
uint8_t clk | |
Clock pin. More... | |
uint8_t dio [4] | |
Data pins. More... | |
} | pinFlash |
JTAG / SWD pins for flashing. More... | |
struct { | |
bool dimmerInverted: 1 | |
True if the dimmer is inverted (setting gpio high turns dimmer off). More... | |
bool enableUart: 1 | |
True if the board should have UART enabled by default. More... | |
bool enableLeds: 1 | |
True if the board has LEDs that should be enabled by default. More... | |
bool ledInverted: 1 | |
True if LED is off when GPIO is set high. More... | |
bool dimmerTempInverted: 1 | |
True if the temperature sensor of the dimmer is inverted (NTC). More... | |
bool usesNfcPins: 1 | |
True if the NFC pins (p0.09 and p0.10) are used as GPIO. More... | |
bool hasAccuratePowerMeasurement: 1 | |
True if the Crownstone has a more accurate power measurement. More... | |
bool canTryDimmingOnBoot: 1 | |
True if the Crownstone can try dimming at boot, because it has an accurate enough power measurement, and a lower startup time of the dimmer circuit. More... | |
bool canDimOnWarmBoot: 1 | |
True if the Crownstone can dim immediately after a warm boot. More... | |
bool dimmerOnWhenPinsFloat: 1 | |
True if the dimmer can be on when the pins are floating (during boot). More... | |
} | flags |
Flags about pin order, presence of components, etc. More... | |
uint8_t | deviceType |
Device type, e.g. More... | |
float | voltageMultiplier [GAIN_COUNT] |
Multiplication factor for voltage measurement. More... | |
float | voltageAfterLoadMultiplier [GAIN_COUNT] |
Multiplication factor for voltage measurement after the load. More... | |
float | currentMultiplier [GAIN_COUNT] |
Multiplication factor for current measurement. More... | |
int32_t | voltageOffset [GAIN_COUNT] |
Offset for voltage measurement (in ADC values). More... | |
int32_t | voltageAfterLoadOffset [GAIN_COUNT] |
Offset for voltage measurement after the load (in ADC values). More... | |
int32_t | currentOffset [GAIN_COUNT] |
Offset for current measurement (in ADC values). More... | |
int32_t | powerOffsetMilliWatt |
Measured power when there is no load (mW). More... | |
uint32_t | voltageAdcRangeMilliVolt |
Range in mV to be used for the voltage pin. More... | |
uint32_t | currentAdcRangeMilliVolt |
Range in mV to be used for the current pin. More... | |
int8_t | minTxPower |
The minimum radio transmission power to be used. More... | |
float | pwmTempVoltageThreshold |
Voltage of PWM thermometer at which the dimmer is too hot. More... | |
float | pwmTempVoltageThresholdDown |
Voltage of PWM thermometer at which the dimmer is cool enough again. More... | |
uint32_t | scanIntervalUs |
Scan interval in μs. More... | |
uint32_t | scanWindowUs |
Scan window in μs. More... | |
int8_t | tapToToggleDefaultRssiThreshold |
Default RSSI threshold, above which tap to toggle will trigger. More... | |
Board configuration.
Configure pins for control relays, IGBTs, LEDs, UART, current sensing, etc.
bool boards_config_t::canDimOnWarmBoot |
True if the Crownstone can dim immediately after a warm boot.
bool boards_config_t::canTryDimmingOnBoot |
True if the Crownstone can try dimming at boot, because it has an accurate enough power measurement, and a lower startup time of the dimmer circuit.
uint8_t boards_config_t::clk |
Clock pin.
uint8_t boards_config_t::cs |
Chip select pin.
uint32_t boards_config_t::currentAdcRangeMilliVolt |
Range in mV to be used for the current pin.
Determines the ADC gain. See adcRangeVoltage.
float boards_config_t::currentMultiplier[GAIN_COUNT] |
Multiplication factor for current measurement.
Current through mains = (ADC value - offset) * multiplier
int32_t boards_config_t::currentOffset[GAIN_COUNT] |
Offset for current measurement (in ADC values).
uint8_t boards_config_t::deviceType |
Device type, e.g.
crownstone plug, crownstone builtin, guidestone.
This can be overwritten for debug purposes at compile time, but is otherwise determined by the board type.
bool boards_config_t::dimmerInverted |
True if the dimmer is inverted (setting gpio high turns dimmer off).
bool boards_config_t::dimmerOnWhenPinsFloat |
True if the dimmer can be on when the pins are floating (during boot).
bool boards_config_t::dimmerTempInverted |
True if the temperature sensor of the dimmer is inverted (NTC).
uint8_t boards_config_t::dio[4] |
Data pins.
bool boards_config_t::enableLeds |
True if the board has LEDs that should be enabled by default.
Some boards do have LEDs, but cannot deliver enough power when also listening (scanning / meshing).
bool boards_config_t::enableUart |
True if the board should have UART enabled by default.
struct { ... } boards_config_t::flags |
Flags about pin order, presence of components, etc.
uint32_t boards_config_t::hardwareBoard |
The hardware board type (number).
bool boards_config_t::hasAccuratePowerMeasurement |
True if the Crownstone has a more accurate power measurement.
bool boards_config_t::ledInverted |
True if LED is off when GPIO is set high.
int8_t boards_config_t::minTxPower |
The minimum radio transmission power to be used.
Builtins need higher TX power than plugs because of surrounding metal and wall material.
uint8_t boards_config_t::pinAinCurrent[GAIN_COUNT] |
Analog input pins to read the current with different gains (if present).
uint8_t boards_config_t::pinAinDimmerTemp |
Analog input pin to read the dimmer temperature.
uint8_t boards_config_t::pinAinEarth |
Analog input pin to measure EARTH.
uint8_t boards_config_t::pinAinVoltage[GAIN_COUNT] |
Analog input pins to read the voltage with different gains (if present).
uint8_t boards_config_t::pinAinVoltageAfterLoad[GAIN_COUNT] |
Analog input pins to read the voltage after the load with different gains (if present).
uint8_t boards_config_t::pinAinZeroRef |
Analog input pin to read 'zero' / offset (to be used for both current and voltage measurements).
uint8_t boards_config_t::pinButton[BUTTON_COUNT] |
GPIO pins of buttons (on dev. kit).
uint8_t boards_config_t::pinCurrentZeroCrossing |
GPIO pin to get zero-crossing information for current.
uint8_t boards_config_t::pinDimmer |
GPIO pin to control the IGBTs.
uint8_t boards_config_t::pinEnableDimmer |
GPIO pin to enable the IGBT circuit.
struct { ... } boards_config_t::pinFlash |
JTAG / SWD pins for flashing.
uint8_t boards_config_t::pinGpio[GPIO_INDEX_COUNT] |
GPIO pins that can be used as GPIO by the user, for example microapps.
uint8_t boards_config_t::pinLed[LED_COUNT] |
GPIO pins of LEDs.
uint8_t boards_config_t::pinRelayDebug |
GPIO to debug the relay: turns on when relay is turned on, and vice versa. Inverted when LEDs are inverted.
uint8_t boards_config_t::pinRelayOff |
GPIO pin to switch the relay off.
uint8_t boards_config_t::pinRelayOn |
GPIO pin to switch the relay on.
uint8_t boards_config_t::pinRx |
GPIO pin to receive UART.
uint8_t boards_config_t::pinTx |
GPIO pin to send UART.
uint8_t boards_config_t::pinVoltageZeroCrossing |
GPIO pin to get zero-crossing information for voltage.
int32_t boards_config_t::powerOffsetMilliWatt |
Measured power when there is no load (mW).
float boards_config_t::pwmTempVoltageThreshold |
Voltage of PWM thermometer at which the dimmer is too hot.
float boards_config_t::pwmTempVoltageThresholdDown |
Voltage of PWM thermometer at which the dimmer is cool enough again.
uint32_t boards_config_t::scanIntervalUs |
Scan interval in μs.
Since this setting is also used when connecting, it influences the time it takes to make an outgoing connection. For some reason, if the scan interval is 2s, it takes at least 2s before a connection is made.
It's also best to make this interval not a multiple of the advertising interval, because in that case, it can happen that the advertisements are outside the scan window every time.
Must not be larger than (1000 * BEARER_SCAN_INT_MAX_MS).
uint32_t boards_config_t::scanWindowUs |
Scan window in μs.
Must not be larger than scan interval, and not smaller than (1000 * BEARER_SCAN_WIN_MIN_MS). See https://devzone.nordicsemi.com/f/nordic-q-a/14733/s132-scan-interval-window-adv-interval
int8_t boards_config_t::tapToToggleDefaultRssiThreshold |
Default RSSI threshold, above which tap to toggle will trigger.
bool boards_config_t::usesNfcPins |
True if the NFC pins (p0.09 and p0.10) are used as GPIO.
uint32_t boards_config_t::voltageAdcRangeMilliVolt |
float boards_config_t::voltageAfterLoadMultiplier[GAIN_COUNT] |
Multiplication factor for voltage measurement after the load.
Voltage on mains after load = (ADC value - offset) * multiplier
int32_t boards_config_t::voltageAfterLoadOffset[GAIN_COUNT] |
Offset for voltage measurement after the load (in ADC values).
float boards_config_t::voltageMultiplier[GAIN_COUNT] |
Multiplication factor for voltage measurement.
Voltage on mains = (ADC value - offset) * multiplier
int32_t boards_config_t::voltageOffset[GAIN_COUNT] |
Offset for voltage measurement (in ADC values).