Accordion Application Layer & Channel Concept
The application layer features an MQTT wrapper that provides seamless access to the AGENT hardware. This layer takes care of the communication and data exchange between the hardware and external applications.
The automation handler goes through a hardware abstraction layer (HAL), which abstracts the actual implementation of the drivers for each Accordion module.
Software Modules
Software modules enhance the Accordion framework by integrating new peripheral features and functionalities. These modules can be pre-configured or loaded dynamically, providing flexibility in extending the system’s capabilities.
Alias Translation File
An alias translation file simplifies programming by assigning descriptive names to hardware channels and configuring their initial states. This file ensures that all defined hardware components respond as expected, streamlining the development process.
Channel Concept
All functions in an Accordion system are
abstracted through a ‘Channel’ concept. A channel could be anything from a
Digital or analog input or output, a temperature input, a register, or a
communications channel. The intention of this abstraction is to provide an
intuitive interface towards complex functions.
Channel Initialization
When the Accordion system boots, a discovery process is started to find all attached hardware modules. Each module reports the channels it supports.
The ‘value’ of a channel is always represented as a string. If it is a boolean-type value (as for a digital channel), the string value is either “true” or “false”. For floating point numbers (as for an analog channel), the string value is always a value convertible from a double value with dot as a decimal separator “1.234”.
Values are always in SI units if applicable. Measuring a voltage returns the value in ‘Volts’ for example.
Channel Values
The value of a channel is represented as a string:
- Boolean values: “true” or “false”
- Floating point numbers: Double values with a dot as a decimal separator (e.g., “1.234”)
- SI Units: Used where applicable (e.g., Volts for voltage, °C for temperature)
Channel Types and Configurations
Analog Channels
Analog channels can function as inputs or outputs. Gain and Offset settings are used to convert values linearly (y = kx + m). This configuration is essential for applications like pressure sensors, where measurements need to be converted into usable units.
Digital Channels
Digital channels can also be configured as inputs or outputs. Depending on the module’s capabilities, settings like PushType (OpenDrain, PushPull) and PullType (None, Up, Down) can be adjusted.
Specialized Channels
- Multiplexer: Represents the common node of a multiplexer, with its value indicating the selected node.
- Temperature: Measures real-world temperatures, configurable by sensor type.
- Resistance: Measures resistance indirectly by calculating current flow.
- Counter: Counts pulses and can be reset by re-enabling the channel.
- Frequency: Measures or generates frequency signals.
- Actuator: Functions similarly to a digital output but includes toggling capabilities.
- PowerSupply: Configures power supply output, current limits, and overcurrent responses.
- Register: Handles miscellaneous chip registers or string-based values.
- Ratiometric: Used for values relative to another property, typically ranging from 0 to 1.
- UART/SPI/I2C: Bus communication-specific channels managed through the ‘Bus Communication’ tab.