Changes

Jump to: navigation, search

DESK-MX9-L/Peripherals/GPIOs

859 bytes removed, 17 May
no edit summary
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |2024/02/02
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |DESK-MX9-L-5.0.0 release
|-
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2024/05/17
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-MX9-L-5.1.0 release
|-
|}
i.MX93 can handle external pins in many different ways and most of them can be configured as GPIOs. When a pin is set as a GPIO, it is possible to read its value, change its direction or change output value directly from the shell.
 
=== Device tree configuration ===
Here below is an example of device tree configuration for using the GPIOs and enabling UART2 on standard DAVE's kit for the AURA SOM:
 
From <code>imx93-aura-cb2001.dts</code>:
 
<pre>
leds {
compatible = "gpio-leds";
status = "okay";
 
uart2_en {
label = "uart2_en";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2_en>;
gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
 
uart2_mode {
label = "uart2_mode";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2_mode>;
gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>;
default-state = "off";
status = "disabled";
};
};
};
</pre>
 
while the related pad configuration has been defined in the <code>iomuxc</code> section:
 
<pre>
pinctrl_uart2_mode: uart2_mode {
fsl,pins = <
MX93_PAD_CCM_CLKO2__GPIO3_IO27 0x31e
>;
};
</pre>
===Accessing the peripheral===
====Linux messages at boot time====
 
With the previous <code>leds</code> configuration for the GPIOs, it is possible to find them on <code>sysfs</code> under ''/sys/class/leds'' sub-directory:
 
<pre class="workstation-terminal">
root@desk-mx93:~# ls -la /sys/class/leds/uart2*
total 0
lrwxrwxrwx 1 root root 0 Mar 3 2023 uart2_en -> ../../devices/platform/leds/leds/uart2_en
root@desk-mx93:~#
</pre>
==== Usage with [https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/README libgpiod] ====
dave_user
226
edits

Navigation menu