Smart Remote 3 nRF52 v1.2
Firmware architecture

The Smart Remote firmware consists of independent modules grouped around the event bus, which functions as the main communication channel in the system. The modules broadcast messages using the event bus or react to messages that are sent by other modules.

sr3_nrf52_fw_arch.svg
Firmware architecture block diagram

The modules can be divided into three categories, based on their role in the system:

For example, when a keyboard key is pressed, the keyboard module sends an EVT_KEY_DOWN event with a corresponding key identifier. When the HID protocol module detects this message, it checks if the given key is mapped to a HID usage code. If it is mapped, it sends an EVT_HID_REPORT_INPUT message with a corresponding usage code. This message is interpreted by the communication module which updates its state and sends the report to the host. At the same time, the IR protocol module checks the IR keyboard map in response to the EVT_KEY_DOWN message. If the key is mapped, it sends an EVT_IR_SYMBOL event, which is interpreted by the IR Transmission module, responsible for controlling the IR transmitter.

Because all event messages that are sent over the event bus have to use a common event_t data structure, all modules use the same unified data format. Also, to keep the design of individual modules simple and straightforward, all of them operate on the same interrupt level. This assures context unification and eliminates the need of explicit synchronization and locking. For details about context management, consult Task management and latency minimization.

In the Smart Remote firmware architecture, modules cannot directly communicate with the hardware. Instead, they use dedicated drivers. The drivers abstract the hardware of a particular type, providing simple API for basic operations, like power management, data readout, and similar. All data and state management is realized by the corresponding module that handles a given peripheral.

Firmware architecture aspects

See the following sections for detailed descriptions of specific aspects of the firmware architecture.

Audio subsystem

BLE advertisement

BLE connection management

BLE services

Clocking options

Firmware components

HID report descriptor

HID state subsystem

Infrared transmitter

NFC pairing

Packet scheduling

Pattern of the API calls

Power management

Task management and latency minimization

User input


Documentation feedback | Developer Zone | Subscribe | Updated