Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. I2C bus control using Qt/Qml
Forum Update on Monday, May 27th 2025

I2C bus control using Qt/Qml

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 2 Posters 11.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nilesh Prakash Kokane
    wrote on 11 Dec 2014, 10:01 last edited by
    #1

    Hi ,

    I managed to cross compile i2c-tools for my i.mx board. But doesn't have an idea how to control the bus through it.

    can anyone please provide qt reference code for i2c.

    Br
    Nilesh

    Nilesh Kokane

    1 Reply Last reply
    1
    • J Offline
      J Offline
      jazzycamel
      wrote on 11 Dec 2014, 12:19 last edited by jazzycamel
      #2

      i2c-tools is a set of command line tools for interfacing with I2C bus, not an API. It does however use the i2c-dev.h which has methods for the SMBus protocol and is nicely documented "here":https://xgoat.com/wp/2007/11/11/using-i2c-from-userspace-in-linux/.

      However as the I2C bus, like most devices, is mapped into the file system you can actually just read from/write to it using standard (or Qt) file operations. Look in your '/dev/' directory for filenames starting with 'i2c-', for example:

      $ ls /dev/ | grep 'i2c-'
      

      Look "here":http://elinux.org/Interfacing_with_I2C_Devices for an example of how to open, gain control, read and write to this 'file'.

      Hope this helps ;o)

      For the avoidance of doubt:

      1. All my code samples (C++ or Python) are tested before posting
      2. As of 23/03/20, my Python code is formatted to PEP-8 standards using black from the PSF (https://github.com/psf/black)
      1 Reply Last reply
      3
      • N Offline
        N Offline
        Nilesh Prakash Kokane
        wrote on 12 Dec 2014, 05:43 last edited by
        #3

        Hi jazzycamel ,

        Perfect, That will help me a lot.

        Thanks for your suggestion..

        Br
        Nilesh

        Nilesh Kokane

        1 Reply Last reply
        0

        1/3

        11 Dec 2014, 10:01

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved