EasyManua.ls Logo

Phytec i.MX 93 - Adc; Leds; I²C Bus

Default Icon
85 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
i.MX 93 BSP Manual PD24.1.1 Documentation Rev.: imx8mp-pd22.1.2-51-ga548be7d
7.6 ADC
The PHYTEC i.MX 93 include general purpose Analog-to-Digital Converters (ADC) which can be used for
interfacing analog sensors.
Reading the ADC values can be done through sysfs:
target:~$ cat /sys/bus/iio/devices/iio:deviceX/in_voltageY_raw
On phyBOARD-Nash the ADC lines are accessible on X16 expansion connector:
ADC input X16 pin
ADC_IN0 47
ADC_IN2 49
7.7 LEDs
If any LEDs are connected to GPIOs, you have the possibility to access them by a special LED driver interface
instead of the general GPIO interface (section GPIOs). You will then access them using /sys/class/leds/
instead of /sys/class/gpio/. The maximum brightness of the LEDs can be read from the max_brightness
le. The brightness le will set the brightness of the LED (taking a value from 0 up to max_brightness).
Most LEDs do not have hardware brightness support and will just be turned on by all non-zero brightness
settings.
Below is a simple example.
To get all available LEDs, type:
target:~$ ls /sys/class/leds
green:heartbeat@ mmc0::@ mmc1::@ yellow:@
Here the LEDs green:heartbeat is on the phyCORE-i.MX93. If you are using phyBOARD-Segin there is
also yellow LED which is populated on the PEB-EVAL-01.
To toggle the LEDs ON:
target:~$ echo 1 > /sys/class/leds/green\:heartbeat/brightness
To toggle OFF:
target:~$ echo 0 > /sys/class/leds/green\:heartbeat/brightness
Device tree conguration for the User I/O conguration can be found here: https://git.phytec.de/linux-imx/
tree/arch/arm64/boot/dts/freescale/imx93-phyboard-segin-peb-eval-01.dtso?h=v6.1.55_2.2.0-phy3#n33
7.8 I²C Bus
The i.MX 93 contains several Multimaster fast-mode I²C modules. PHYTEC boards provide plenty of
dierent I²C devices connected to the I²C modules of the i.MX 93. This section describes the basic device
usage and its DT representation of some I²C devices integrated into our phyBOARD-Segin/Nash i.MX 93.
The device tree node for i2c contains settings such as clock-frequency to set the bus frequency and the pin
control settings including scl-gpios and sda-gpios which are alternate pin congurations used for bus recovery.
Accessing Peripherals 59