[PATCH] Add GPIO, I2C and SPI support for the RPi BSP
Chris Johns
chrisj at rtems.org
Mon Dec 15 21:39:46 UTC 2014
On 16/12/2014 7:19 am, Alan Cudmore wrote:
> Is the ARM Zync BSP using the new i2c API?
Yes.
> I was looking through the BSP and did not see how it is initialized.
Support is optional with the Zynq because the user needs to route the
pin correctly so by default it is not enabled. I use:
#include <dev/i2c/i2c.h>
#include <dev/i2c/gpio-nxp-pca9535.h>
#include <bsp/i2c.h>
...
const char bus = "/dev/i2c-0";
const char path = "/dev/i2c-0.gpio-0";
...
r = zynq_register_i2c_0()
...
r = zynq_register_i2c_1();
...
r = i2c_dev_register_gpio_nxp_pca9535(&bus[0], &path[0], address);
...
fd = open(&path[0], O_RDWR);
...
r = gpio_nxp_pca9535_set_config(fd, 0xf0f0);
...
r = gpio_nxp_pca9535_set_output(fd, 0);
...
close(fd)
>
> Also, the current libi2c supports SPI. Does anyone see a problem with
> using libi2c for SPI and the new i2c API for i2c?
>
My only issue with this is the wrong name. I have no view on the code. :)
> Finally, will new i2c drivers go in libchip, or in cpukit/dev ?
I suggest you follow what Sebastian has done.
Chris
More information about the devel
mailing list