3 KConfig Setup
Set up the configuration file. This file contains the project configuration flags from KConfig. Flags can be added manually, as in the case of the prj.conf file included in the sample.
# Copyright (c) 2025 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0
CONFIG_LOG=y
CONFIG_LOG_ALWAYS_RUNTIME=y
CONFIG_SERIAL=y
CONFIG_SENSOR=y
CONFIG_MTCH9010=y
CONFIG_MTCH9010_RESET_ON_STARTUP=n
In addition, flags can also be set using the interactive GUI, but the project must be built at least once before opening the GUI. Note that this initial build may fail.
west build -p always -b saml21_xpro samples/sensor/mtch9010 -- -DDTC_OVERLAY_FILE=conductive.overlay
Running this command will display a GUI. If set up correctly, the MTCH9010 options will appear under the following path: Device Drivers>Sensor drivers>MTCH9010. Alternatively, press / to search for the symbol and press Enter.
Reset MTCHP9010 on Startupis enabled because the MTCH9010 can only be configured once per power-up. If the device is not reset before configuring, then initialization will fail. To use this feature, an I/O pin must be allocated to reset the device. If an I/O pin is not assigned to reset, a warning will be printed to the console, and no action will be taken.Save MTCH9010 Setting on Startuplocks the settings so that the MTCH9010 automatically resumes them on power-upMaximum wait time to get a sample (ms)controls how long the MCU will wait for a sample to be sent by the MTCH9010Override Delay if not Wake on Requestis related. If the device is not configured in wake-on-demand, it takes N seconds for a new sample to be sent. Enabling this option increases the timeout from <delay> to <delay + sleep period>, if applicable.Reference Averaging Countsets the number of samples used to average the reference value during configuration. A value of 1 means no averaging is performed.Heartbeat Monitoringallows the driver to detect whether the heartbeat signal from the MTCH9010 is present. This requires an I/O pin to be allocated.Max compiled-in log level for MTCHP9010 (Default)specifies the level of debug logging that the driver will generate
