Day02 - Device List Exploration¶
This lab explores the device files available in the /dev directory and identifies hardware interfaces such as UART, SPI, and I2C.
List All Devices¶
Command:
Example output (partial):
The /dev directory contains device nodes that represent hardware devices managed by the Linux kernel.
UART Device¶
UART devices appear as:
On this system:
Check symbolic link:
Example:
Meaning:
ttyAMA10is the actual UART deviceserial0is an alias pointing to the default UART
Example usage:
SPI Device¶
SPI devices appear as:
On this system:
Meaning:
- SPI bus: 10
- Chip Select: 0
Example usage in C:
SPI communication is usually configured with ioctl() calls.
I2C Device¶
I2C devices appear as:
Example:
However, on this system the I2C interface is not enabled by default, so no /dev/i2c-* device is present.
Enable I2C¶
Enable I2C using:
Navigate to:
Reboot the system afterwards.
After enabling I2C, the following device should appear:
Storage Device¶
Storage devices appear as block devices.
Example:
Meaning:
mmcblk0→ SD cardmmcblk0p1→ partition 1mmcblk0p2→ partition 2
Summary¶
Detected devices:
| Interface | Device |
|---|---|
| UART | ttyAMA10 |
| UART alias | serial0 |
| SPI | spidev10.0 |
| I2C | not enabled |
| Storage | mmcblk0 |
The /dev directory exposes hardware devices as files that can be accessed by user applications.