Difference between revisions of "AsDevices"

From ArmadeusWiki
Jump to: navigation, search
(New page: {{Under_Construction}} AsDevices is an ARMadeus specific library that simplify apf-board devices usages for developer. This library is written to be use with C, C++ and Python languages....)
 
Line 19: Line 19:
 
want.
 
want.
  
== Use library in application ==
+
== Use library in an application ==
  
 
=== In C ===
 
=== In C ===
 
=== In C++ ===
 
=== In C++ ===
 
=== In Python ===
 
=== In Python ===
 +
 +
To use AsDevices library in python, select the Python wrapper in menuconfig then, on platform, import the module :
 +
 +
<source lang="Python">
 +
>>> import AsDevices
 +
</source>
 +
 +
All python classes available in the module can be found with dir() function :
 +
 +
<source lang="Python">
 +
>>> dir(AsDevices)
 +
['Apf27Pwm', 'Apf27PwmError', 'NUMBER_OF_PWM', '__author__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '__versionTime__', '__version__', 'wrappers']
 +
</source>
  
 
== Devices supported by library ==
 
== Devices supported by library ==
Line 35: Line 48:
 
{| border="1" cellpadding="5" cellspacing="0" summary="put summary here"
 
{| border="1" cellpadding="5" cellspacing="0" summary="put summary here"
 
|- style="background:#efefef;" align="center"
 
|- style="background:#efefef;" align="center"
! width="33%" | Title A !! width="33%" | Title B !! Title C
+
! Name !! C functions !! C++ wrapper !! Python wrapper !! Python class !!
 +
description
 
|- align="center"
 
|- align="center"
| A1 || B1 || C1
+
| apf27_pwm || bgcolor=#60FF00 | OK  ||  bgcolor=#60FF00 |  OK  || bgcolor=#60FF00 |  OK  ||  bgcolor=#60FF00 |  OK || Drive imx27 pwm
 
|- align="center"
 
|- align="center"
| A2 || B2 || C2
+
| i2c || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive I2C
 
|- align="center"
 
|- align="center"
| A3 || B3 || C3
+
| apf27_gpio || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive imx27 GPIO
 +
|- align="center"
 +
| ad5258 || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive Digital potentiometer [http://www.analog.com/en/digital-to-analog-converters/digital-potentiometers/AD5258/products/product.html AD5258]
 +
|- align="center"
 +
| ds1374 || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive RTC chip [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3806 DS1374]
 +
|- align="center"
 +
| max1027 || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive Analog to Digital chip [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3872/t/al MAX1027]
 +
|- align="center"
 +
| max5821 || bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK ||bgcolor=#FF0000| NOK  || Drive Digital to Analog chip [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3288/t/al MAX5821]
 +
 
 
|}
 
|}

Revision as of 11:49, 12 October 2009

Page under construction... 

Construction.png Informations on this page are not guaranteed !!

AsDevices is an ARMadeus specific library that simplify apf-board devices usages for developer. This library is written to be use with C, C++ and Python languages.

Install AsDevices on target

The library is included in buildroot menu, to use it just select it in «make menuconfig» :

Package Selection for the target  --->
    *** Armadeus specific packages ***   
    [*] as_devices 
    [*]   wrapper C++
    [*]   wrapper Python

The base library is in C, to use it with C++ or Python, select the wrapper you want.

Use library in an application

In C

In C++

In Python

To use AsDevices library in python, select the Python wrapper in menuconfig then, on platform, import the module :

>>> import AsDevices

All python classes available in the module can be found with dir() function :

>>> dir(AsDevices)
['Apf27Pwm', 'Apf27PwmError', 'NUMBER_OF_PWM', '__author__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '__versionTime__', '__version__', 'wrappers']

Devices supported by library

PWM

Development planning

AsDevices is not finished, following tabular indicate the remaining work:

Name C functions C++ wrapper Python wrapper Python class

description

apf27_pwm OK OK OK OK Drive imx27 pwm
i2c NOK NOK NOK NOK Drive I2C
apf27_gpio NOK NOK NOK NOK Drive imx27 GPIO
ad5258 NOK NOK NOK NOK Drive Digital potentiometer AD5258
ds1374 NOK NOK NOK NOK Drive RTC chip DS1374
max1027 NOK NOK NOK NOK Drive Analog to Digital chip MAX1027
max5821 NOK NOK NOK NOK Drive Digital to Analog chip MAX5821