pcf8574

All about the Raspberry Pi SBC and Rpi projects,hints, etc.

pcf8574

Postby Richard-TX » Sun Oct 19, 2014 12:36 pm

PCF8574 8 bit i-o expander


$ uname -a
Linux raspberrypi 3.12.18+ #679 PREEMPT Thu May 1 14:40:27 BST 2014 armv6l GNU/Linux

$ cd linux

# Enable PCF857x:
# Device Drivers -> -*- GPIO Support -> <M> PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders
$ make menuconfig
$ make prepare

# build
$ make SUBDIRS=drivers/gpio modules
CC [M] drivers/gpio/gpio-pcf857x.o
Building modules, stage 2.
MODPOST 1 modules
CC drivers/gpio/gpio-pcf857x.mod.o
LD [M] drivers/gpio/gpio-pcf857x.ko

# install
$ sudo make SUBDIRS=drivers/gpio modules_install
INSTALL drivers/gpio/gpio-pcf857x.ko
DEPMOD 3.12.18+
$ sudo depmod

# load driver
$ sudo modprobe i2c-bcm2708
$ sudo modprobe i2c-dev
$ sudo modprobe gpio-pcf857x
$ echo pcf8574 0x39 | sudo tee /sys/bus/i2c/devices/i2c-1/new_device

# Output added by mikroskeem
$ dmesg | tail
[ 703.075077] pcf857x 1-0038: probed
[ 703.080759] i2c i2c-1: new_device: Instantiated device pcf8574 at 0x38
User avatar
Richard-TX
Site Admin
 
Posts: 208
Images: 6
Joined: Sat Feb 04, 2012 8:10 pm

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest

cron