Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Tree [f71e5c] master /
History



File Date Author Commit
Makefile 2013-10-31 Oleg Dzhimiev Oleg Dzhimiev [9f1646] initial commit
README.md 2013-11-22 Andrey Filippov Andrey Filippov [a780d1] Merge branch 'master' of ssh://git.code.sf.net/...
build_driver.sh 2013-11-22 Andrey Filippov Andrey Filippov [a780d1] Merge branch 'master' of ssh://git.code.sf.net/...
cp210x.patch 2013-10-31 Oleg Dzhimiev Oleg Dzhimiev [9f1646] initial commit
cp210x_gpio.py 2013-11-23 Andrey Filippov Andrey Filippov [f71e5c] bug fix

Read Me

CP210x GPIO control

A patch to the CP210x USB to UART Bridges driver that adds GPIO pins control by implementing ioctl function and a python script to program devices.

Supported OS

  • Kubuntu Linux 13.04 (kernel 3.8.0-32)

Tested devices

  • CP2103
  • CP2104

Install

  1. Build:

    ./build_driver
    
  2. Reload driver (from the built directory):

    sudo rmmod cp210x
    sudo insmod cp210x.ko
    

Program GPIO_MAS

  1. Examples:

    • Set all 1's:

      sudo ./cp210x_gpio.py -d /dev/ttyUSB0 -m 0xff 0xff
      
    • Set GPIO[3]=1, others - 0:

      sudo ./cp210x_gpio.py -d /dev/ttyUSB1 -m 0xff 0x08
      

Changes in the driver

  • Changes in the driver cp210x.c are based on the patch found here
  • GPIO_VALUE=arg[23:16], GPIO_MASK=arg[7:0]

Unresolved questions

  • Silabs drivers in 2.6.x and 3.x.x for GPIOs differ:
    • 2.6.x: GPIO_VALUE=arg[23:16], GPIO_MASK=arg[7:0] - this matches the patch
    • 3.x.x: GPIO_VALUE=arg[15: 8], GPIO_MASK=arg[7:0]