nRF Machine Learning: Internal modules
The nRF Machine Learning application uses modules available in Common Application Framework (CAF), a set of generic modules based on Application Event Manager and available to all applications, and a set of dedicated internal modules. See Firmware architecture for more information.
The nRF Machine Learning application uses the following modules available in CAF:
See the module pages for more information about the modules and their configuration.
The nRF Machine Learning application also uses the following dedicated application modules:
ei_data_forwarder_bt_nusThe module forwards the sensor readouts over NUS to the connected Bluetooth Central. The sensor data is forwarded only if the connection is secured and the connection interval is within the limit defined by the
CONFIG_BT_PERIPHERAL_PREF_MIN_INTandCONFIG_BT_PERIPHERAL_PREF_MAX_INTKconfig options.ei_data_forwarder_uartThe module forwards the sensor readouts over UART.
led_stateThe module displays the application state using LEDs. The LED effects used to display the state of data forwarding, the machine learning results, and the state of the simulated signal are defined in the
led_state_def.hfile located in the application configuration directory. The common LED effects are used to represent the machine learning results and the simulated sensor signal.ml_runnerThe module uses the Edge Impulse wrapper API to control running the machine learning model. It provides the prediction results using
ml_result_event.ml_app_modeThe module controls application mode. It switches between running the machine learning model and forwarding the data. The change is triggered by a long press of the button defined in the module’s configuration.
sensor_sim_ctrlThe module controls the parameters of the generated simulated sensor signal. It switches between predefined sets of parameters for the simulated signal. The parameters of the generated signals are defined by the
sensor_sim_ctrl_def.hfile located in the application configuration directory.usb_stateThe module enables USB.
Note
The ei_data_forwarder_bt_nus and ei_data_forwarder_uart modules stop forwarding the sensor readouts if they receive a sensor_event that cannot be forwarded and needs to be dropped.
This could happen, for example, if the selected sensor sampling frequency is too high for the used implementation of the Edge Impulse data forwarder.
Data forwarding is stopped to make sure that dropped samples are noticed by the user.
If you switch to running the machine learning model and then switch back to data forwarding, the data is again forwarded to the host.