Ubilinux and GPIO

Jaap Cammeraat
Jaap Cammeraat New Member Posts: 28
We use the UPboard in one of our products running Ubilinux.
Can somebody tell me which complete library we can use to do the I2C and SPI stuff on the GPIO?

We will use this library for creating in a new plugin/wrapper called by Xojo.

It would be nice of this (Ubilinux) library can be used on the new UP2 and UPcore

Comments

  • Jaap Cammeraat
    Jaap Cammeraat New Member Posts: 28
    BUMP

    Is MRAA the most complete library for UP hardware related to Ubilinux?
    Need to know for our future product design.
  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin
    Hi xinfinite,

    LibMRAA is an open source library available for many other SBC that we updated to include support for UP Board.

    If you don't want to use the I/O directly from the system, I think LibMRAA is the best option you have.

    We are working to support MRAA also on UP Squared (currently in beta testing) and it will be considered for future boards too.
  • Jaap Cammeraat
    Jaap Cammeraat New Member Posts: 28
    Well, I'm using UART1 directly within my software with Xojo.
    And some pins with shell commands.
    But what is the best way to do some I2C or SPI directly without LibMRAA?
  • Dan O'Donovan
    Dan O'Donovan Administrator, Moderator, Emutex Posts: 241 admin
    Are you using one of the official kernels we provide for UP, such as ubilinux or the Ubuntu kernel, or the Yocto BSP meta layer? If so, the support needed to enable the UART is provided by kernel drivers and your application should be able to use it like a normal UART.
  • Jaap Cammeraat
    Jaap Cammeraat New Member Posts: 28
    We use the latest Ubilinux build for the UP.
    UART isn't the problem.

    Where do I find find more info about using I2C or SPI directly ( without LibMRAA )?
  • Dan O'Donovan
    Dan O'Donovan Administrator, Moderator, Emutex Posts: 241 admin
    Sorry, I re-read the messages and realised that you're asking about I2C and SPI.

    To use the SPI bus from a user-space application, you can access it directly via /dev/spidev2.0 (documented here: https://www.kernel.org/doc/Documentation/spi/spidev) or, as Daniele mentioned, use a library such as MRAA for this.

    Similarly, to use the I2C bus from a user-space application, you can access it directly via /dev/i2c-1 (documented here: https://www.kernel.org/doc/Documentation/i2c/dev-interface) or again using a library such as MRAA.

    In both cases above, an UP kernel as mentioned in the previous post is still required for that to work.
Privacy Policy