From d57545bedd5abb049c98b77fae1ec4592dc342e1 Mon Sep 17 00:00:00 2001 From: XECDesign Date: Fri, 25 Jul 2014 12:54:04 +0100 Subject: [PATCH 1/3] Added pin configuration documentation --- configuration/README.md | 2 + configuration/pin-configuration.md | 277 +++++++++++++++++++++++++++++ 2 files changed, 279 insertions(+) create mode 100644 configuration/pin-configuration.md diff --git a/configuration/README.md b/configuration/README.md index 35e19350f9..f527f5ffbd 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -16,3 +16,5 @@ Some basic guides to configuring your Raspberry Pi - Installing and setting up the Raspberry Pi camera board. - [Localisation](localisation.md) - Setting up your Pi to work in your local language / timezone / etc. +- [Default pin configuration](pin-configuration.md) + - Changing the default pin states. diff --git a/configuration/pin-configuration.md b/configuration/pin-configuration.md new file mode 100644 index 0000000000..e14b0e8866 --- /dev/null +++ b/configuration/pin-configuration.md @@ -0,0 +1,277 @@ +# Changing the default pin configuration +*This feature is intended for advanced users.* + +As of July 15th 2014, the Raspberry Pi firmware supports custom default pin configurations through a user-provided device tree blob file. In order to ensure that your firmware is recent enough, please run `vcgencmd version`. +## Providing a custom device tree blob +In order to compile a device tree source (*dts*) file into a device tree blob (*dtb*) file, the device tree compiler must be installed by running `sudo apt-get install device-tree-compiler`. + The `dtc` command can then be used as follows: +``` +sudo dtc -I dts -O dtb -i dt-blob.dts -o /boot/dt-blob.bin +``` +**NOTE:** In the case of NOOBS installs, the dtb file should be placed on the recovery partition instead. + +Similarly, a dtb file can be converted back to a dts file, if required. +``` +dtc -I dtb -O dts -i /boot/dt-blob.bin -o dt-blob.dts +``` +## Sample device tree source file +**NOTE:** As this is a new feature, there is no reference dts file which is guaranteed to be supported by future firmware revisions. + +The dts file below is used for the dtb compiled into the July 23rd 2014 firmware. +``` +/dts-v1/; + +/ { + videocore { + pins_rev1 { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p2 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SDA + pin@p3 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SCL + pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED + pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 + pin@p16 { function = "output"; termination = "pull_up"; polarity="active_low"; }; // activity LED + pin@p27 { function = "output"; termination = "no_pulling"; }; // Camera shutdown + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug + pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <2>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <3>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <27>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <5>; + }; + pin_define@POWER_LOW { + type = "absent"; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <16>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <6>; + }; + }; // pin_defines + }; // pins_rev1 + + pins_rev2 { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p0 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA + pin@p1 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL + pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED + pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 + pin@p16 { function = "output"; termination = "pull_up"; polarity = "active_low"; }; // activity LED + pin@p21 { function = "output"; termination = "no_pulling"; }; // Camera shutdown + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug + pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <21>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <5>; + }; + pin_define@POWER_LOW { + type = "absent"; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <16>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <6>; + }; + }; // pin_defines + }; // pins + + pins_bplus { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 + pin@p28 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA + pin@p29 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL + pin@p31 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p32 { function = "output"; termination = "pull_down"; }; // Camera LED + pin@p35 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Power low + pin@p38 { function = "output"; termination = "no_pulling"; }; // USB current limit (0=600mA, 1=1200mA) + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p41 { function = "output"; termination = "no_pulling"; }; // Camera enable + pin@p44 { function = "gp_clk"; termination = "pull_down"; }; // Ethernet 25MHz output + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Hotplug + pin@p47 { function = "output"; termination = "pull_down"; }; // activity LED + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <28>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <29>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <41>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <32>; + }; + pin_define@POWER_LOW { + type = "internal"; + number = <35>; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <47>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <31>; + }; + }; // pin_defines + }; // pins + + pins_cm { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + + }; // pin_config + pin_defines { + }; // pin_defines + }; // pins_cm + }; +}; +``` From d5fdda094e2c4970516dc1a700ee6fc7b4f0ca0e Mon Sep 17 00:00:00 2001 From: XECDesign Date: Fri, 25 Jul 2014 15:33:17 +0100 Subject: [PATCH 2/3] Compute module camera instructions update --- hardware/computemodule/cmio-camera.md | 122 ++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 8 deletions(-) diff --git a/hardware/computemodule/cmio-camera.md b/hardware/computemodule/cmio-camera.md index 5d18c82218..2cbcf1cba5 100755 --- a/hardware/computemodule/cmio-camera.md +++ b/hardware/computemodule/cmio-camera.md @@ -1,4 +1,7 @@ # Attaching a Raspberry Pi Camera to the Compute Module IO Board +*This document is a work in progress and is intended for advanced users.* + +*For the camera to work with the compute module, the firmware needs to be July 23rd 2014 or newer (use `vcgencmd version` to check).* The 15-way 1mm FFC camera connector on the Raspberry Pi model A and B is attached to the CAM1 interface (though only uses 2 of the 4 available lanes). @@ -6,7 +9,9 @@ The Compute Module IO Board has a 22-way 0.5mm FFC for each camera port, with CA To attach a standard Raspberry Pi Camera to the Compute module IO Board a small adaptor board is available that adapts the 22W FFC to the Pi 15W FFC. -To make the Raspberry Pi Camera work with a standard Raspian OS the same GPIOs and I2C interface that are used on the Raspberry Pi must be wired to the CAM1 connector. This is done by bridging the correct GPIOs from the J6 GPIO connector to the CD1_SDA/SCL and CAM1_IO0/1 pins on the J5 connector using jumper wires. +To make the Raspberry Pi Camera work with a standard Raspian OS the GPIOs and I2C interface must be wired to the CAM1 connector. This is done by bridging the correct GPIOs from the J6 GPIO connector to the CD1_SDA/SCL and CAM1_IO0/1 pins on the J5 connector using jumper wires. Additionally, a *dt-blob.bin* file needs to be provided to override default pin states. + +**The pin numbers below are provided only as an example. LED and SHUTDOWN pins can be shared by both cameras, if required.** The SDA and SCL pins must be either GPIO0 and GPIO1 or GPIO28 and 29 and must be individual to each camera. ## Steps to attach a Raspberry Pi Camera (to CAM1) @@ -15,17 +20,118 @@ To make the Raspberry Pi Camera work with a standard Raspian OS the same GPIOs a 3. Attach a Raspberry Pi Camera to the other, larger 15W 1mm FFC on the camera adaptor board (**contacts on the Raspberry Pi Camera flex must face up**). 4. Attach CD1_SDA (J6 pin 37) to GPIO0 (J5 pin 1). 5. Attach CD1_SCL (J6 pin 39) to GPIO1 (J5 pin 3). -6. Attach CAM1_IO1 (J6 pin 41) to GPIO5 (J5 pin 11). -7. Attach CAM1_IO0 (J6 pin 43) to GPIO 21 (J5 pin 43). +6. Attach CAM1_IO1 (J6 pin 41) to GPIO2 (J5 pin 5). +7. Attach CAM1_IO0 (J6 pin 43) to GPIO3 (J5 pin 7). + +## Configuring default pin states + +The GPIOs used by the camera, default to input mode on the compute module. In order to [override the default pin states](../../configuration/pin-configuration.md) and define the pins used by the camera, the dts file needs to be modified. + +The compute module's **pin_config** section needs the camera's LED and power enable pins set to outputs: + +``` +pin@p2 { + function = "output"; + termination = "no_pulling"; +}; +pin@p3 { + function = "output"; + termination = "no_pulling"; +}; +``` + +To tell the firmware which pins to use and how many cameras to look for, add the following to the **pin_defines** section: + +``` +pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; +}; +pin_define@CAMERA_0_LED { + type = "internal"; + number = <2>; +}; +pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <3>; +}; +pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; +}; +pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0>; +}; +pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <0>; +}; +pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <1>; +}; +``` + +## How to attach two cameras + +Attach the second camera to the (CAM0) connector as before. + +Connect up the I2C and GPIO lines. + +1. Attach CD0_SDA (J6 pin 45) to GPIO28 (J6 pin 1). +2. Attach CD0_SCL (J6 pin 47) to GPIO29 (J6 pin 3). +3. Attach CAM0_IO1 (J6 pin 49) to GPIO30 (J6 pin 5). +4. Attach CAM0_IO0 (J6 pin 51) to GPIO31 (J6 pin 7). + +The compute module's **pin_config** secion needs the second camera's LED and power enable pins configured: -The camera should now work in exactly the same way as a Raspberry Pi Model A/B. +``` +pin@p30 { + function = "output"; + termination = "no_pulling"; +}; +pin@p31 { + function = "output"; + termination = "no_pulling"; +}; +``` -## How to attach 2 cameras +In the compute module's **pin_defines** section of the dts file, change the *NUM_CAMERAS* parameter to 2 and add the following: -Attaching a second camera is a repeat of the above steps 1-3 for the second (CAM0) connector. +``` +pin_define@CAMERA_1_LED { + type = "internal"; + number = <30>; +}; +pin_define@CAMERA_1_SHUTDOWN { + type = "internal"; + number = <31>; +}; +pin_define@CAMERA_1_UNICAM_PORT { + type = "internal"; + number = <0>; +}; +pin_define@CAMERA_1_I2C_PORT { + type = "internal"; + number = <0>; +}; +pin_define@CAMERA_1_SDA_PIN { + type = "internal"; + number = <28>; +}; +pin_define@CAMERA_1_SCL_PIN { + type = "internal"; + number = <29>; +``` -The difference is that the second I2C interface must be used for CD0_SDA and CD0_SCL (you can't put both cameras on the same I2C bus as they have the same address) as well as 2 different GPIOs for CAM0_IO0 and CAM0_IO1. +## Software support -**TODO** +Recent raspicam binaries (*raspivid* and *raspistill*) have the -cs (--camselect) option to specify which camera should be used. +From other applications, MMAL can be told which camera to use by setting MMAL_PARAMETER_CAMERA_NUM accordingly. +``` +MMAL_PARAMETER_INT32_T camera_num = {{MMAL_PARAMETER_CAMERA_NUM, sizeof(camera_num)}, CAMERA_NUMBER}; +status = mmal_port_parameter_set(camera->control, &camera_num.hdr); +``` From 0ff5f8c5a15c20be4a7da5c23eb074a5b0160ae2 Mon Sep 17 00:00:00 2001 From: XECDesign Date: Fri, 1 Aug 2014 18:56:07 +0100 Subject: [PATCH 3/3] Updated default pin configuration --- configuration/pin-configuration.md | 532 +++++++++++++++-------------- 1 file changed, 284 insertions(+), 248 deletions(-) diff --git a/configuration/pin-configuration.md b/configuration/pin-configuration.md index e14b0e8866..6d75500837 100644 --- a/configuration/pin-configuration.md +++ b/configuration/pin-configuration.md @@ -17,261 +17,297 @@ dtc -I dtb -O dts -i /boot/dt-blob.bin -o dt-blob.dts ## Sample device tree source file **NOTE:** As this is a new feature, there is no reference dts file which is guaranteed to be supported by future firmware revisions. -The dts file below is used for the dtb compiled into the July 23rd 2014 firmware. +The dts file below is used for the dtb compiled into the August 1st 2014 firmware. ``` -/dts-v1/; + /dts-v1/; -/ { - videocore { - pins_rev1 { - pin_config { - pin@default { - polarity = "active_high"; - termination = "pull_down"; - startup_state = "inactive"; - function = "input"; - }; // pin - pin@p2 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SDA - pin@p3 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SCL - pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED - pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET - pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 - pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 - pin@p16 { function = "output"; termination = "pull_up"; polarity="active_low"; }; // activity LED - pin@p27 { function = "output"; termination = "no_pulling"; }; // Camera shutdown - pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio - pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio - pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug - pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect - pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK - pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD - pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 - pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 - pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 - pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + / { + videocore { + pins_rev1 { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p2 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SDA + pin@p3 { function = "i2c1"; termination = "pull_up"; }; // I2C 1 SCL + pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED + pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p14 { function = "uart0"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // RX uart0 + pin@p16 { function = "output"; termination = "pull_up"; polarity="active_low"; }; // activity LED + pin@p27 { function = "output"; termination = "no_pulling"; }; // Camera shutdown + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug + pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 - }; // pin_config - pin_defines { - pin_define@HDMI_CONTROL_ATTACHED { - type = "internal"; - number = <46>; - }; - pin_define@NUM_CAMERAS { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_UNICAM_PORT { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_I2C_PORT { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_SDA_PIN { - type = "internal"; - number = <2>; - }; - pin_define@CAMERA_0_SCL_PIN { - type = "internal"; - number = <3>; - }; - pin_define@CAMERA_0_SHUTDOWN { - type = "internal"; - number = <27>; - }; - pin_define@CAMERA_0_LED { - type = "internal"; - number = <5>; - }; - pin_define@POWER_LOW { - type = "absent"; - }; - pin_define@LEDS_DISK_ACTIVITY { - type = "internal"; - number = <16>; - }; - pin_define@LAN_RESET { - type = "internal"; - number = <6>; - }; - }; // pin_defines - }; // pins_rev1 + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <2>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <3>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <27>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <5>; + }; + pin_define@FLASH_0_ENABLE { + type = "absent"; + }; + pin_define@FLASH_0_INDICATOR { + type = "absent"; + }; + pin_define@FLASH_1_ENABLE { + type = "absent"; + }; + pin_define@FLASH_1_INDICATOR { + type = "absent"; + }; + pin_define@POWER_LOW { + type = "absent"; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <16>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <6>; + }; + }; // pin_defines + }; // pins_rev1 - pins_rev2 { - pin_config { - pin@default { - polarity = "active_high"; - termination = "pull_down"; - startup_state = "inactive"; - function = "input"; - }; // pin - pin@p0 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA - pin@p1 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL - pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED - pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET - pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 - pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 - pin@p16 { function = "output"; termination = "pull_up"; polarity = "active_low"; }; // activity LED - pin@p21 { function = "output"; termination = "no_pulling"; }; // Camera shutdown - pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio - pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio - pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug - pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect - pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK - pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD - pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 - pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 - pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 - pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + pins_rev2 { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p0 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA + pin@p1 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL + pin@p5 { function = "output"; termination = "pull_down"; }; // CAM_LED + pin@p6 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p14 { function = "uart0"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // RX uart0 + pin@p16 { function = "output"; termination = "pull_up"; polarity = "active_low"; }; // activity LED + pin@p21 { function = "output"; termination = "no_pulling"; }; // Camera shutdown + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; }; // Hotplug + pin@p47 { function = "input"; termination = "no_pulling"; }; // SD card detect + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 - }; // pin_config - pin_defines { - pin_define@HDMI_CONTROL_ATTACHED { - type = "internal"; - number = <46>; - }; - pin_define@NUM_CAMERAS { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_I2C_PORT { - type = "internal"; - number = <0>; - }; - pin_define@CAMERA_0_SDA_PIN { - type = "internal"; - number = <0>; - }; - pin_define@CAMERA_0_SCL_PIN { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_SHUTDOWN { - type = "internal"; - number = <21>; - }; - pin_define@CAMERA_0_UNICAM_PORT { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_LED { - type = "internal"; - number = <5>; - }; - pin_define@POWER_LOW { - type = "absent"; - }; - pin_define@LEDS_DISK_ACTIVITY { - type = "internal"; - number = <16>; - }; - pin_define@LAN_RESET { - type = "internal"; - number = <6>; - }; - }; // pin_defines - }; // pins + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <21>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <5>; + }; + pin_define@FLASH_0_ENABLE { + type = "absent"; + }; + pin_define@FLASH_0_INDICATOR { + type = "absent"; + }; + pin_define@FLASH_1_ENABLE { + type = "absent"; + }; + pin_define@FLASH_1_INDICATOR { + type = "absent"; + }; + pin_define@POWER_LOW { + type = "absent"; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <16>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <6>; + }; + }; // pin_defines + }; // pins - pins_bplus { - pin_config { - pin@default { - polarity = "active_high"; - termination = "pull_down"; - startup_state = "inactive"; - function = "input"; - }; // pin - pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 - pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 - pin@p28 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA - pin@p29 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL - pin@p31 { function = "output"; termination = "pull_down"; }; // LAN NRESET - pin@p32 { function = "output"; termination = "pull_down"; }; // Camera LED - pin@p35 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Power low - pin@p38 { function = "output"; termination = "no_pulling"; }; // USB current limit (0=600mA, 1=1200mA) - pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio - pin@p41 { function = "output"; termination = "no_pulling"; }; // Camera enable - pin@p44 { function = "gp_clk"; termination = "pull_down"; }; // Ethernet 25MHz output - pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio - pin@p46 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Hotplug - pin@p47 { function = "output"; termination = "pull_down"; }; // activity LED - pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK - pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD - pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 - pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 - pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 - pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + pins_bplus { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p14 { function = "uart0"; termination = "no_pulling"; drive_strength_mA = < 8 >; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // RX uart0 + pin@p28 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SDA + pin@p29 { function = "i2c0"; termination = "pull_up"; }; // I2C 0 SCL + pin@p31 { function = "output"; termination = "pull_down"; }; // LAN NRESET + pin@p32 { function = "output"; termination = "pull_down"; }; // Camera LED + pin@p35 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Power low + pin@p38 { function = "output"; termination = "no_pulling"; }; // USB current limit (0=600mA, 1=1200mA) + pin@p40 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Left audio + pin@p41 { function = "output"; termination = "no_pulling"; }; // Camera enable + pin@p44 { function = "gp_clk"; termination = "pull_down"; }; // Ethernet 25MHz output + pin@p45 { function = "pwm"; termination = "no_pulling"; drive_strength_mA = < 16 >; }; // Right audio + pin@p46 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Hotplug + pin@p47 { function = "output"; termination = "pull_down"; }; // activity LED + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 - }; // pin_config - pin_defines { - pin_define@HDMI_CONTROL_ATTACHED { - type = "internal"; - number = <46>; - }; - pin_define@NUM_CAMERAS { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_I2C_PORT { - type = "internal"; - number = <0>; - }; - pin_define@CAMERA_0_SDA_PIN { - type = "internal"; - number = <28>; - }; - pin_define@CAMERA_0_SCL_PIN { - type = "internal"; - number = <29>; - }; - pin_define@CAMERA_0_SHUTDOWN { - type = "internal"; - number = <41>; - }; - pin_define@CAMERA_0_UNICAM_PORT { - type = "internal"; - number = <1>; - }; - pin_define@CAMERA_0_LED { - type = "internal"; - number = <32>; - }; - pin_define@POWER_LOW { - type = "internal"; - number = <35>; - }; - pin_define@LEDS_DISK_ACTIVITY { - type = "internal"; - number = <47>; - }; - pin_define@LAN_RESET { - type = "internal"; - number = <31>; - }; - }; // pin_defines - }; // pins + }; // pin_config + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "internal"; + number = <46>; + }; + pin_define@NUM_CAMERAS { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0>; + }; + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <28>; + }; + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <29>; + }; + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <41>; + }; + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <1>; + }; + pin_define@CAMERA_0_LED { + type = "internal"; + number = <32>; + }; + pin_define@FLASH_0_ENABLE { + type = "absent"; + }; + pin_define@FLASH_0_INDICATOR { + type = "absent"; + }; + pin_define@FLASH_1_ENABLE { + type = "absent"; + }; + pin_define@FLASH_1_INDICATOR { + type = "absent"; + }; + pin_define@POWER_LOW { + type = "internal"; + number = <35>; + }; + pin_define@LEDS_DISK_ACTIVITY { + type = "internal"; + number = <47>; + }; + pin_define@LAN_RESET { + type = "internal"; + number = <31>; + }; + }; // pin_defines + }; // pins - pins_cm { - pin_config { - pin@default { - polarity = "active_high"; - termination = "pull_down"; - startup_state = "inactive"; - function = "input"; - }; // pin - pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 - pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 - pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK - pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD - pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 - pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 - pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 - pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 + pins_cm { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; // pin + pin@p14 { function = "uart0"; termination = "no_pulling"; }; // TX uart0 + pin@p15 { function = "uart0"; termination = "pull_up"; }; // RX uart0 + pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CLK + pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD CMD + pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D0 + pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D1 + pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D2 + pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = < 8 >; }; // SD D3 - }; // pin_config - pin_defines { - }; // pin_defines - }; // pins_cm - }; -}; + }; // pin_config + pin_defines { + }; // pin_defines + }; // pins_cm + }; + }; ```