Skip to content

Common Peripheral Driver Guide

UART

  • Corresponding node: /dev/ttyMSM0
  • Get information
bash
stty -F /dev/ttyMSM0
  • Set baud rate
bash
stty -F /dev/ttyMSM0 115200
  • Read
bash
cat /dev/ttyMSM0
  • Write
bash
echo "test" > /dev/ttyMSM0

I2C

  • Scan devices
bash
i2cdetect -y 2
  • Read register 0x00 from device 0x50
bash
i2cget -y 2 0x50 0x00
  • Write value 0xFF to register 0x01 of device 0x50
bash
i2cset -y 2 0x50 0x01 0xFF