i2c_smbus_read_i2c_block_data

Raspberry Pi 2

i2c_smbus_read_i2c_block_data

Postby ryano88 » Fri Sep 25, 2015 10:09 am

I have a simple C++ I2C class that uses the following functions:

i2c_smbus_read_i2c_block_data
i2c_smbus_write_i2c_block_data

This compiles on raspbian as long as I have the libi2c-dev package installed. However this package does not exist on alarm so the file will not compile. I have tried installing i2c-tools and lm_sensors instead, but it still does not compile.

Does anyone know what package I need to install?
ryano88
 
Posts: 7
Joined: Fri Feb 06, 2015 5:09 pm

Re: i2c_smbus_read_i2c_block_data

Postby WarheadsSE » Fri Sep 25, 2015 2:45 pm

What files does this "libi2c-dev" package contain?

You can use the pkgfile command to locate the owner of those files in Arch & derivatives (like ALARM)
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: i2c_smbus_read_i2c_block_data

Postby ryano88 » Sat Sep 26, 2015 1:32 pm

Thanks for the tip. I include "linux/i2c-dev.h" in my code, so I searched for this file using

$this->bbcode_second_pass_code('', 'pkgfile i2c-dev.h')

which got me the following list of packages:

$this->bbcode_second_pass_quote('', 'c')ore/linux-am33x-headers
core/linux-api-headers
core/linux-armv7-headers
core/linux-armv7-rc-headers
core/linux-boundary-headers
core/linux-cubox-headers
core/linux-headers-d3plug
core/linux-headers-imx6-cubox
core/linux-headers-imx6-cubox-dt
core/linux-headers-odroid
core/linux-headers-utilite-dt
core/linux-odroid-c1-headers
core/linux-odroid-xu-headers
core/linux-odroid-xu-headless-headers
core/linux-odroid-xu-mainline-headers
core/linux-odroid-xu3-headers
core/linux-parallella-headers
core/linux-peach-headers
core/linux-raspberrypi-headers
core/linux-utilite-headers
core/linux-veyron-headers
core/linux-wandboard-headers
core/linux-zedboard-headers
community/kernel-headers-musl


Out of that list, linux-raspberrypi-headers seemed to be the most likely option so I installed it and tried to compile my code but I still get errors:

$this->bbcode_second_pass_quote('', 'e')rror: 'i2c_smbus_read_i2c_block_data' was not declared in this scope
ryano88
 
Posts: 7
Joined: Fri Feb 06, 2015 5:09 pm

Re: i2c_smbus_read_i2c_block_data

Postby sdjf » Thu Oct 01, 2015 4:46 pm

Have you tried googling that latest error? seems to be a discussion on github about it.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 2 guests