diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 6c54679..9f14996 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md @@ -350,6 +350,20 @@ to `1` or enabled `PiTFT` support, or otherwise want to use another pin, use GPIO_SHUTDOWN_PIN = "25" +## Enable One-Wire Interface + +One-wire is a single-wire communication bus typically used to connect sensors +to the RaspberryPi. The Raspberry Pi supports one-wire on any GPIO pin, but +the default is GPIO 4. To enable the one-wire interface explicitly set it in +`local.conf` + + ENABLE_W1 = "1" + +Once discovery is complete you can list the devices that your Raspberry Pi has +discovered via all 1-Wire busses check the interface with this command + +`ls /sys/bus/w1/devices/` + ## Manual additions to config.txt The `RPI_EXTRA_CONFIG` variable can be used to manually add additional lines to diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index d9d8bb0..9d007e0 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -290,6 +290,12 @@ do_deploy() { echo "# Enable WM8960" >> $CONFIG echo "dtoverlay=wm8960-soundcard" >> $CONFIG fi + + # W1-GPIO - One-Wire Interface + if [ "${ENABLE_W1}" = "1" ]; then + echo "# Enable One-Wire Interface" >> $CONFIG + echo "dtoverlay=w1-gpio" >> $CONFIG + fi } do_deploy:append:raspberrypi3-64() {