Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Macros
configure.h File Reference
#include "base.h"
Include dependency graph for configure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ISR_PCINT0
 Interrupt vector: pin change 0.
 
#define ISR_PCINT1
 Interrupt vector: pin change 1.
 
#define ISR_USI_STARTCOND
 Interrupt vector: USI start condition.
 
#define ISR_USI_OVERFLOW
 Interrupt vector: USI overflow.
 
#define P_USI_SCL
 TWI slave SCL ('twi_sl_scl')
 
#define P_USI_SDA
 TWI slave SDA ('twi_sl_sda')
 
#define GPIO_PINS_MAX
 GPIO: Maximum number of pins usable as GPIOs.
 
#define GPIO_TO_PMASK(GMASK)
 GPIO: Map a logical GPIO mask to MCU port A/B mask (see also GPIO_FROM_PMASK).
 
#define GPIO_FROM_PMASK(PMASK)
 GPIO: Map MCU port mask to a logical GPIO mask. More...
 
#define P_TWI_MA_0_SCL
 TWI master: SCL pin.
 
#define P_TWI_MA_0_SDA
 TWI master: SDA pin.
 
#define P_ADC_0
 ADC (0) pin.
 
#define P_ADC_1
 ADC 1 pin.
 
#define P_UART_RX
 UART receive pin.
 
#define P_UART_TX
 UART transmit pin.
 
#define P_UART_DRIVE
 UART driver enable (set to 1 during transmission)
 
#define P_TEMP_ZACWIRE
 Temperature: ZACwire data pin.
 
#define P_SHADES_0_BTN_UP
 Shades (0): button "up" pin.
 
#define P_SHADES_0_BTN_DN
 Shades (0): button "down" pin.
 
#define P_SHADES_0_ACT_UP
 Shades (0): actuator "up" pin.
 
#define P_SHADES_0_ACT_DN
 Shades (0): actuator "down" pin.
 
#define P_SHADES_1_BTN_UP
 Shades 1: button "up" pin.
 
#define P_SHADES_1_BTN_DN
 Shades 1: button "down" pin.
 
#define P_SHADES_1_ACT_UP
 Shades 1: actuator "up" pin.
 
#define P_SHADES_1_ACT_DN
 Shades 1: actuator "down" pin.
 
General ...
#define IS_MAINTENANCE   0
 This firmware is a maintenance system?
 
#define TWI_SL_NOTIFY   (!IS_MAINTENANCE)
 Device may perform notifications via its slave interface? More...
 
#define TWI_SL_NOTIFY_US   10000.0
 Duration of a notification in microseconds. More...
 
Timer ...
#define WITH_TIMER   0
 The timer is enabled if this is 1 or any other feature requires the timer.
 
GPIO ...
#define GPIO_IN_PRESENCE   0
 Pins to be used as general-purpose inputs.
 
#define GPIO_IN_PULLUP   0
 Inputs with activated internal pullups.
 
#define GPIO_OUT_PRESENCE   0
 Pins to be used as general-purpose outputs.
 
#define GPIO_OUT_PRESET   0
 Output default state (will be set before Z-state is left)
 
TWI Master / Hub ...

Note: Presently, only a single TWI master is supported, which then acts as hub, i.e. all requests/replies to other nodes of the same subnet are forwarded via the master port currently set (#0 at present). In the future, this may change: There may be multiple master ports, and master ports may be used independently of the hub functionality - for example, to work with i2c devices locally.

#define WITH_TWIHUB   0
 Enable TWI hub functionality over master port #0.
 
#define TWIHUB_PORT   0
 TWI master port to use for the hub (must be 0 presently).
 
#define TWI_MA_PORTS   (WITH_TWIHUB ? 1 : 0)
 Number of TWI master ports.
 
#define TWI_MA_INTERNAL_PULLUP   0
 Activate internal pullups for the master SCL/SDA lines (DEPRECATED).
 
Matrix ...

The diode switch matrix uses the pins avaliable as GPIO for the MCU, which may then not be used as GPIOs.

If MATRIX_ROWS > 1, the last MATRIX_ROWS ports are the stimulation ports. The MATRIX_COLS ports before those (or the last ports at all, if no stimulating ports exist) are the sensing ports.

In the special case of MATRIX_ROWS == 1, no stimulation ports are assigned, and no active stimulation is performed by the software module. In the circuitry, the row lines of the switches should be connected to VCC (i.e. constantly be pulled high via some resistor) instead of a stimulation port.

#define MATRIX_ROWS   0
 Number of stimulating lines (rows) (max. 8).
 
#define MATRIX_COLS   0
 Number of sensing lines (columns) (max. 8).
 
#define MATRIX_ROWS_GSHIFT   GPIO_PINS_MAX
 
#define MATRIX_COLS_GSHIFT   (MATRIX_ROWS_GSHIFT - MATRIX_COLS)
 Index of the first GPIO pin to be assigned to column lines. More...
 
#define MATRIX_T_SAMPLE   4
 Time (ticks) a row is driven to 1 to sample.
 
#define MATRIX_T_PERIOD   16
 Time (ticks) before switching to the next row.
 
#define MATRIX_BUFSIZE   8
 Event buffer size.
 
ADCs ...
#define ADC_PORTS   0
 Number of ADC input ports (max. 2)
 
#define ADC_PERIOD   1024
 Sample period in ticks (max. 32767) More...
 
#define P_ADC_0_STROBE   0
 Pin to output a strobe signal before each sampling (0 = no strobe) More...
 
#define ADC_0_STROBE_VALUE   1
 Strobe value (the other times, the pin drives the opposite value)
 
#define ADC_0_STROBE_TICKS   0
 Duration of a strobe if ADC_STROBE_PIN != 0.
 
#define P_ADC_1_STROBE   0
 
#define ADC_1_STROBE_VALUE   1
 
#define ADC_1_STROBE_TICKS   0
 
UART ...
#define WITH_UART   0
 Enable UART.
 
#define UART_WITH_DRIVE   1
 Enable "driver enable" output (e.g. for RS485)
 
#define UART_TX_LISTEN   10
 If "drive enable" is set, this is the number of milliseconds to await silence before sending.
 
#define UART_TX_INV   1
 Set to invert TX output (e.g. for RS485 via MAX485)
 
#define UART_RX_INV   1
 Set to invert RX input (e.g. for RS485 via MAX485)
 
#define UART_BAUDRATE   9600
 Baud rate.
 
#define UART_STOPBITS   1
 Stop bits.
 
#define UART_PARITY   0
 Parity (0 = none, 1 = odd, 2 = even) (ONLY 0 IMPLEMENTED YET)
 
#define UART_TX_BUFSIZE   16
 Capacity of the TX buffer (in bytes, must be power of 2)
 
#define UART_RX_BUFSIZE   16
 Capacity of the RX buffer (in bytes, must be power of 2)
 
#define UART_MULTI_BYTE_ISR   1
 Allow to receive multiple bytes (at most UART_RX_BUFSIZE) within one ISR call.
 
Temperature ...
#define WITH_TEMP_ZACWIRE   0
 Enable ZACwire temperature interface.
 
#define TEMP_NOTIFY   0
 Enable bus notification for temperature changes (does not affect BR_REG_CHANGED).
 
Shades ...

The 'shades' module allows to control up to two window shades (blinds) or actuators in a wider sense (e.g. including actuators to open/close windows or gates). Each actuator is associated with two output pins to active its engine in the "up" or "down" direction and two input pins connected to two push buttons for the two directions.

Note on the shades ports:

  1. For the buttons ('P_SHADES_n_BTN_*'), the internal pullup is activated, and the pin must be pulled to GND (logical 0) by the button.
  2. The actor pins ('P_SHADES_n_ACT_*') are driven high (+VDD) if the engine must be started and low (GND) to stop the engine.
#define SHADES_PORTS   0
 Number of (shades) actuators (max. 2)
 
#define SHADES_TIMEOUT   30000
 Number of milliseconds without connection before the brownie assumes that the master is offline. More...
 
#define SHADES_REVERSE_DELAY   1000
 Minimum time (in ms) the actor is kept off before it is switched on again (either in the same or other direction).
 
#define SHADES_0_RINT_FAILSAFE   0xff
 Failsafe internal request value(s) (RINT) for the case the brownie has lost its connection to the master (-1 = RINT is not changed on time-out). More...
 
#define SHADES_1_RINT_FAILSAFE   0xff
 
#define SHADES_PERSISTENCE   1
 If set, the position is stored in EEPROM to minimize calibrations. If unset, the position is reset to "unknown" on power up.
 
#define SHADES_TOLERANCE   2
 Tolerated deviation between the real and requested position in %. If the difference between real and requested state is no more than this, shades are not started to move.