Board Device Adaption
Board-level device configuration primarily references the BMGR device reference pages. This section explains how to use the device reference documentation for board-level configuration, and how to handle hardware not yet supported by BMGR.
Configure via Device Reference Pages
BMGR provides a dedicated device reference page for each built-in device type (Device Reference), with each page containing two types of templates: minimum configuration and full fields:
Minimum configuration: Minimal examples of
board_peripherals.yamlandboard_devices.yamllisted by common interface andsub_type, suitable for copying directly and modifying according to the schematic.Full fields: Contains all configurable fields and value descriptions for the device type, covering all options supported by the BMGR parser.
Even if a particular configuration combination is not used in existing boards, the field annotations and value references can be found in the “Full Fields” template on the corresponding device page.
Recommended approach: Open the reference page for the target device type, find the example in the “Minimum Configuration” template that matches the hardware interface, replace [IO] and [TO_BE_CONFIRMED] fields according to the schematic and actual device, and refer to “Full Fields” to adjust optional parameters as needed.
Note
The I2S standard mode microphone and speaker in the audio_codec device is a typical example—this configuration is not widely used in existing boards, but its fields and usage are fully documented on the device reference page and can be configured directly. See Audio Codec (audio_codec).
Using the custom Device Type
If BMGR does not yet have a built-in device type corresponding to the target hardware, use the custom device type for adaptation:
Declare the device in
board_devices.yamlwithtype: custom, with thenamefield named according to the hardware function.During the BMGR generation phase, a dedicated configuration structure
dev_custom_{name}_config_twill be generated for this device.In
setup_device.cor other source files participating in the build, register the init and deinit implementations using theCUSTOM_DEVICE_IMPLEMENTmacro.At runtime, BMGR will look up and call the registered implementation by device name.
See Custom Device (custom) for details.