Author Topic: CubieTruck analog pins programming  (Read 2293 times)

Offline Eudaimonium

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
CubieTruck analog pins programming
« on: August 18, 2015, 05:56:35 am »
Hi,

Official documentation states that Cubietruck has 8 analog pins:
http://docs.cubieboard.org/tutorials/cubietruck/start

Is there a way to read and write to those pins in C programming?

I am using Sunxi library which works perfectly with standard digital GPIO pins via
Code: [Select]
sunxi_gpio_set_cfgpin(pinID, direction)
sunxi_gpio_output(pinID, value)
sunxi_gpio_input(pinID)

However the library's header file doesn't even declare any functions for analog operations, nor a way to get their addresses. Digital pins are found via define declaration:
Code: [Select]
#define SOME_PIN_X SUNXI_GP*(X)
Where
* = Bank name (A-I)
X = Pin number within it's bank

How does one work with analog pins on Cubietruck, then? Are there any official Sunxi libraries, or third party libraries that can help me read and write analog values?