[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-303-g97d5c7a
Brought to you by:
sszy
|
From: jscheer <js...@us...> - 2014-06-25 08:10:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 97d5c7acdc7fa39277ce9086f73dd17b00b58280 (commit)
from dd547792c9e48f07ea6cf9f47524ce710193f27d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 97d5c7acdc7fa39277ce9086f73dd17b00b58280
Author: Jeremie Scheer <jer...@ar...>
Date: Wed Jun 25 10:09:45 2014 +0200
[AS_DEVICES] Remove warnings when generating documentation with Doxygen.
[AS_DEVICES] Put AsDevices elements in groups in Doxygen documentation according to the programming language.
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/DoxyDefines.h | 25 +
target/packages/as_devices/Doxyfile | 3 +-
target/packages/as_devices/c/as_93lcxx.h | 4 +-
target/packages/as_devices/c/as_adc.h | 8 +
target/packages/as_devices/c/as_adc_iio.h | 6 +
target/packages/as_devices/c/as_as1531.h | 6 +
target/packages/as_devices/c/as_backlight.h | 9 +-
target/packages/as_devices/c/as_dac.h | 7 +
target/packages/as_devices/c/as_gpio.h | 8 +
target/packages/as_devices/c/as_helpers.h | 6 +
target/packages/as_devices/c/as_i2c.h | 8 +
target/packages/as_devices/c/as_i2c_eeprom.h | 29 +-
target/packages/as_devices/c/as_led.h | 8 +
target/packages/as_devices/c/as_max1027.h | 7 +
target/packages/as_devices/c/as_max5821.h | 11 +
target/packages/as_devices/c/as_power_supply.h | 8 +
target/packages/as_devices/c/as_pwm.h | 7 +
target/packages/as_devices/c/as_spi.h | 2 +-
target/packages/as_devices/c/as_tcs3472.h | 7 +
target/packages/as_devices/cpp/as_93lcxx.hpp | 13 +-
target/packages/as_devices/cpp/as_adc.cpp | 13 -
target/packages/as_devices/cpp/as_adc.hpp | 26 +
target/packages/as_devices/cpp/as_backlight.hpp | 21 +-
target/packages/as_devices/cpp/as_dac.cpp | 17 +-
target/packages/as_devices/cpp/as_dac.hpp | 28 +
target/packages/as_devices/cpp/as_gpio.cpp | 47 +--
target/packages/as_devices/cpp/as_gpio.hpp | 63 +++
target/packages/as_devices/cpp/as_i2c.cpp | 68 +---
target/packages/as_devices/cpp/as_i2c.hpp | 85 +++
target/packages/as_devices/cpp/as_i2c_eeprom.hpp | 13 +-
target/packages/as_devices/cpp/as_pwm.hpp | 13 +-
target/packages/as_devices/cpp/as_spi.cpp | 52 --
target/packages/as_devices/cpp/as_spi.hpp | 70 +++
.../as_devices/python/AsDevices/Apf27Pwm.py | 16 +
.../packages/as_devices/python/AsDevices/AsAdc.py | 16 +
.../packages/as_devices/python/AsDevices/AsDac.py | 11 +
.../packages/as_devices/python/AsDevices/AsGpio.py | 11 +
.../packages/as_devices/python/AsDevices/AsI2c.py | 11 +
.../packages/as_devices/python/AsDevices/AsSpi.py | 11 +
.../packages/as_devices/python/src/Apf27Pwm_wrap.c | 333 ++++++------
.../packages/as_devices/python/src/Apf27Pwm_wrap.h | 52 +-
target/packages/as_devices/python/src/AsAdc_wrap.c | 158 +++---
target/packages/as_devices/python/src/AsAdc_wrap.h | 12 +-
target/packages/as_devices/python/src/AsDac_wrap.c | 163 +++---
target/packages/as_devices/python/src/AsDac_wrap.h | 12 +-
.../packages/as_devices/python/src/AsGpio_wrap.c | 485 +++++++++--------
.../packages/as_devices/python/src/AsGpio_wrap.h | 28 +-
target/packages/as_devices/python/src/AsI2c_wrap.c | 563 ++++++++++----------
target/packages/as_devices/python/src/AsI2c_wrap.h | 28 +-
target/packages/as_devices/python/src/AsSpi_wrap.c | 515 ++++++++++---------
target/packages/as_devices/python/src/AsSpi_wrap.h | 28 +-
51 files changed, 1855 insertions(+), 1296 deletions(-)
create mode 100644 target/packages/as_devices/DoxyDefines.h
diff --git a/target/packages/as_devices/DoxyDefines.h b/target/packages/as_devices/DoxyDefines.h
new file mode 100644
index 0000000..6fa011d
--- /dev/null
+++ b/target/packages/as_devices/DoxyDefines.h
@@ -0,0 +1,25 @@
+/*! \mainpage
+ *
+ * Cette librairie contient les fonctions et wrappers nécessaires à l'utilisation et
+ * au fonctionnement des différents devices systèmes.
+ *
+ */
+
+/*!
+ * \defgroup c_files C: Fonctions utilitaires en C pour les devices systèmes.
+ *
+*/
+
+/*!
+ * \defgroup cpp_wrappers C++: Wrappers C++ des fonctions utilitaires C
+ *
+*/
+
+
+/*!
+ * \defgroup python_wrappers PYTHON: Wrappers Python des fonctions utilitaires C
+ *
+*/
+
+
+
diff --git a/target/packages/as_devices/Doxyfile b/target/packages/as_devices/Doxyfile
index cbca69b..497649c 100644
--- a/target/packages/as_devices/Doxyfile
+++ b/target/packages/as_devices/Doxyfile
@@ -578,7 +578,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = .
+INPUT = . \
+ ./DoxyDefines.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/target/packages/as_devices/c/as_93lcxx.h b/target/packages/as_devices/c/as_93lcxx.h
index a49a68e..84b87e0 100644
--- a/target/packages/as_devices/c/as_93lcxx.h
+++ b/target/packages/as_devices/c/as_93lcxx.h
@@ -26,7 +26,7 @@
/** @file
* @brief Provide standard commands to drive 93LCxx eeprom (from microchip)
*
- *
+ * @ingroup c_files
*/
#ifdef __cplusplus
@@ -39,6 +39,8 @@ extern "C" {
/**
* Store eeprom parameters
+ *
+ * @ingroup c_files
*/
struct as_93lcxx_device {
unsigned char *spidev_filename; /**< filename of the spidev /dev file */
diff --git a/target/packages/as_devices/c/as_adc.h b/target/packages/as_devices/c/as_adc.h
index 6c58917..4cab58a 100644
--- a/target/packages/as_devices/c/as_adc.h
+++ b/target/packages/as_devices/c/as_adc.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive ADC
+ *
+ * @ingroup c_files
+ */
+
#ifndef __AS_ADC_H__
#define __AS_ADC_H__
@@ -33,6 +39,8 @@ extern const char AS_AS1531_NAME[];
extern const char AS_IIO_NAME[];
/** @brief Store ADC parameters
+ *
+ * @ingroup c_files
*/
struct as_adc_device {
const char *device_type; /*!< device type: "as1531" or "max1027" */
diff --git a/target/packages/as_devices/c/as_adc_iio.h b/target/packages/as_devices/c/as_adc_iio.h
index 14f9ad9..2ac2fa8 100644
--- a/target/packages/as_devices/c/as_adc_iio.h
+++ b/target/packages/as_devices/c/as_adc_iio.h
@@ -18,6 +18,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive ADC IIO
+ *
+ * @ingroup c_files
+ */
+
#ifndef __AS_ADC_IIO_H__
#define __AS_ADC_IIO_H__
diff --git a/target/packages/as_devices/c/as_as1531.h b/target/packages/as_devices/c/as_as1531.h
index 507fdaf..e818b41 100644
--- a/target/packages/as_devices/c/as_as1531.h
+++ b/target/packages/as_devices/c/as_as1531.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive AS1531
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASAS1531_H__
#define __ASAS1531_H__
diff --git a/target/packages/as_devices/c/as_backlight.h b/target/packages/as_devices/c/as_backlight.h
index b678f8c..bf4c3dc 100644
--- a/target/packages/as_devices/c/as_backlight.h
+++ b/target/packages/as_devices/c/as_backlight.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive backlight
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASBACKLIGHT_H__
#define __ASBACKLIGHT_H__
@@ -30,6 +36,7 @@ extern "C" {
/** @brief Structure to store backlight device parameters
*
+ * @ingroup c_files
*/
struct as_backlight_device {
int fileActualBrightness; /*!< file descriptor to get current brightness */
@@ -67,7 +74,7 @@ int32_t as_backlight_get_actual_brightness(struct as_backlight_device *aDev);
*/
int32_t as_backlight_get_max_brightness(struct as_backlight_device *aDev);
-/** @bief Set brightness
+/** @brief Set brightness
*
* @param aDev pointer to device structure
* @param aBrightness backlight brightness
diff --git a/target/packages/as_devices/c/as_dac.h b/target/packages/as_devices/c/as_dac.h
index 878d655..4dad9a4 100644
--- a/target/packages/as_devices/c/as_dac.h
+++ b/target/packages/as_devices/c/as_dac.h
@@ -19,6 +19,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive DAC
+ *
+ * @ingroup c_files
+ */
+
#ifndef __AS_DAC_H__
#define __AS_DAC_H__
@@ -33,6 +39,7 @@ extern "C" {
/** @brief Store DAC parameters
*
+ * @ingroup c_files
*/
struct as_dac_device {
int bus_number; /*!< bus number */
diff --git a/target/packages/as_devices/c/as_gpio.h b/target/packages/as_devices/c/as_gpio.h
index f390020..a6a5d4f 100644
--- a/target/packages/as_devices/c/as_gpio.h
+++ b/target/packages/as_devices/c/as_gpio.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive GPIOs
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASGPIO_H__
#define __ASGPIO_H__
@@ -37,6 +43,8 @@ extern "C" {
/**
* Store gpio parameters
+ *
+ * @ingroup c_files
*/
struct as_gpio_device {
int port_num;
diff --git a/target/packages/as_devices/c/as_helpers.h b/target/packages/as_devices/c/as_helpers.h
index 3e8bd64..1e77ab0 100644
--- a/target/packages/as_devices/c/as_helpers.h
+++ b/target/packages/as_devices/c/as_helpers.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide help functions for other modules
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASHELPERS_H__
#define __ASHELPERS_H__
diff --git a/target/packages/as_devices/c/as_i2c.h b/target/packages/as_devices/c/as_i2c.h
index 07fd78b..d22d240 100644
--- a/target/packages/as_devices/c/as_i2c.h
+++ b/target/packages/as_devices/c/as_i2c.h
@@ -19,6 +19,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive I2C
+ *
+ * @ingroup c_files
+ */
+
#ifndef AS_I2C_H_
#define AS_I2C_H_
@@ -31,6 +37,8 @@ extern "C" {
/**
* Store i2c parameters
+ *
+ * @ingroup c_files
*/
struct as_i2c_device {
int i2c_id;
diff --git a/target/packages/as_devices/c/as_i2c_eeprom.h b/target/packages/as_devices/c/as_i2c_eeprom.h
index 773d3a5..a2922ec 100644
--- a/target/packages/as_devices/c/as_i2c_eeprom.h
+++ b/target/packages/as_devices/c/as_i2c_eeprom.h
@@ -26,7 +26,7 @@
/** @file
* @brief Provide standard commands to drive i2c eeprom (from microchip)
*
- *
+ * @ingroup c_files
*/
#ifdef __cplusplus
@@ -42,14 +42,39 @@ extern "C" {
/**
* Store eeprom parameters
+ *
+ * @param i2c_dev store i2c device parameters
+ *
+ * @ingroup c_files
*/
struct as_i2c_eeprom_device {
+ /**
+ * Store i2c device parameters
+ */
struct as_i2c_device *i2c_dev;
- uint32_t eeprom_addr;
+ /**
+ * Eeprom memory address
+ */
+ uint32_t eeprom_addr;
+ /**
+ * Eeprom memory address width
+ */
uint32_t addr_width;
+ /**
+ * Eeprom page buffer size
+ */
uint32_t page_buffer_size;
+ /**
+ * Number of pages in eeprom memory
+ */
uint16_t number_pages;
+ /**
+ * Page size in eeprom memory
+ */
uint16_t page_size;
+ /**
+ * Writing time in us
+ */
uint32_t write_time_us;
};
diff --git a/target/packages/as_devices/c/as_led.h b/target/packages/as_devices/c/as_led.h
index 5e43215..1166ca3 100644
--- a/target/packages/as_devices/c/as_led.h
+++ b/target/packages/as_devices/c/as_led.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive LEDs
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASLED_H__
#define __ASLED_H__
@@ -31,6 +37,8 @@ extern "C" {
/**
* @brief Store LED device parameters
+ *
+ * @ingroup c_files
*/
struct as_led_device {
char led_name[32]; /*!< LED device name */
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
index eb3612d..f0cd642 100644
--- a/target/packages/as_devices/c/as_max1027.h
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -18,6 +18,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive MAX1027
+ *
+ * @ingroup c_files
+ */
+
#ifndef __AS_MAX1027_H__
#define __AS_MAX1027_H__
@@ -36,6 +42,7 @@ typedef enum {
/** @brief Structure to store max1027 parameters
*
+ * @ingroup c_files
*/
struct as_max1027_device {
AS_max1027_mode mode; /*!< mode/speed */
diff --git a/target/packages/as_devices/c/as_max5821.h b/target/packages/as_devices/c/as_max5821.h
index 8c17d10..5b17957 100644
--- a/target/packages/as_devices/c/as_max5821.h
+++ b/target/packages/as_devices/c/as_max5821.h
@@ -18,6 +18,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive MAX5821
+ *
+ * @ingroup c_files
+ */
+
#ifndef AS_MAX5821_H_
#define AS_MAX5821_H_
@@ -27,6 +33,11 @@ extern "C" {
#include "as_i2c.h"
+/**
+ * @brief Structure to store MAX5821 parameters
+ *
+ * @ingroup c_files
+ */
struct as_max5821_device {
struct as_i2c_device *i2c_dev;
};
diff --git a/target/packages/as_devices/c/as_power_supply.h b/target/packages/as_devices/c/as_power_supply.h
index c696e0b..14ec257 100644
--- a/target/packages/as_devices/c/as_power_supply.h
+++ b/target/packages/as_devices/c/as_power_supply.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive Power Supply
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASPOWERSUPPLY_H__
#define __ASPOWERSUPPLY_H__
@@ -31,6 +37,8 @@ extern "C" {
/**
* @brief Store power supplier parameters
+ *
+ * @ingroup c_files
*/
struct as_power_supply_device {
char power_supply_name[32]; /*!< device name */
diff --git a/target/packages/as_devices/c/as_pwm.h b/target/packages/as_devices/c/as_pwm.h
index 3089abe..a6e5dcc 100644
--- a/target/packages/as_devices/c/as_pwm.h
+++ b/target/packages/as_devices/c/as_pwm.h
@@ -19,6 +19,12 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/** @file
+ * @brief Provide standard commands to drive PWM
+ *
+ * @ingroup c_files
+ */
+
#ifndef __ASAPF27PWM_H__
#define __ASAPF27PWM_H__
@@ -33,6 +39,7 @@ extern "C" {
/** @brief Structure to handle PWM device
*
+ * @ingroup c_files
*/
struct as_pwm_device {
int fileFrequency; /*!< file descriptor to set frequency */
diff --git a/target/packages/as_devices/c/as_spi.h b/target/packages/as_devices/c/as_spi.h
index ceb84fe..2ece166 100644
--- a/target/packages/as_devices/c/as_spi.h
+++ b/target/packages/as_devices/c/as_spi.h
@@ -20,13 +20,13 @@
* - use a device structure instead of int fd.
*/
-
#ifndef AS_SPI_H_
#define AS_SPI_H_
/** @file
* @brief Provide access to SPI Bus.
*
+ * @ingroup c_files
*/
#ifdef __cplusplus
diff --git a/target/packages/as_devices/c/as_tcs3472.h b/target/packages/as_devices/c/as_tcs3472.h
index 7dcf89c..3ef3e89 100644
--- a/target/packages/as_devices/c/as_tcs3472.h
+++ b/target/packages/as_devices/c/as_tcs3472.h
@@ -18,6 +18,12 @@
*
*/
+/** @file
+ * @brief Provide standard commands to drive TCS3274 device
+ *
+ * @ingroup c_files
+ */
+
#ifndef __AS_TCS3472_H__
#define __AS_TCS3472_H__
@@ -29,6 +35,7 @@ extern "C" {
/** @brief Structure to handle TCS3274 device
*
+ * @ingroup c_files
*/
struct as_tcs3472 {
struct as_i2c_device *i2c_dev; /*!< I2C bus handler */
diff --git a/target/packages/as_devices/cpp/as_93lcxx.hpp b/target/packages/as_devices/cpp/as_93lcxx.hpp
index cdfab83..a608aa0 100644
--- a/target/packages/as_devices/cpp/as_93lcxx.hpp
+++ b/target/packages/as_devices/cpp/as_93lcxx.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for TCS3274 device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_93LCXX__HPP__
#define AS_93LCXX__HPP__
@@ -27,6 +33,8 @@
/**
* C++ wrapper for 93LCXX device
+ *
+ * @ingroup cpp_wrappers
*/
class As93LCXX
{
@@ -44,7 +52,7 @@ public:
/** @brief read a value in address given
*
- * @param aAddress addresse of register to be read
+ * @param anAddress addresse of register to be read
*
* @return positive register value on success, negative value on error.
*/
@@ -94,6 +102,9 @@ public:
long ewds();
protected:
+ /**
+ * As_93lcxx device C structure
+ */
mutable struct as_93lcxx_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_adc.cpp b/target/packages/as_devices/cpp/as_adc.cpp
index 68764ac..23b7498 100644
--- a/target/packages/as_devices/cpp/as_adc.cpp
+++ b/target/packages/as_devices/cpp/as_adc.cpp
@@ -23,12 +23,6 @@
#include "as_adc.hpp"
#include <iostream>
-/** @brief Constructor: Initialize port access
- *
- * @param aDeviceNum device number
- * @param aAdcType ADC type 0:max1027 1:as1531
- * @param aVRef reference tension in millivolts
- */
AsAdc::AsAdc(const char *aAdcType, int aDeviceNum, int aVRef)
{
mDev = as_adc_open(aAdcType, aDeviceNum, aVRef);
@@ -51,14 +45,7 @@ AsAdc::~AsAdc()
std::cerr<<"AsAdc device structure not allocated"<<std::endl;
}
}
-
-/** @brief get value in millivolts
- *
- * @param aChannel channel number
- *
- * @return value in millivolts ; error if negative millivolts
- */
long AsAdc::getValueInMillivolts(int aChannel) const
{
if (mDev != NULL)
diff --git a/target/packages/as_devices/cpp/as_adc.hpp b/target/packages/as_devices/cpp/as_adc.hpp
index bda14d1..d92bed8 100644
--- a/target/packages/as_devices/cpp/as_adc.hpp
+++ b/target/packages/as_devices/cpp/as_adc.hpp
@@ -20,20 +20,46 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for ADC device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_ADC__HPP__
#define AS_ADC__HPP__
#include "as_adc.h"
+/**
+ * C++ wrapper for ADC device
+ *
+ * @ingroup cpp_wrappers
+ */
class AsAdc
{
public:
+ /** @brief Constructor: Initialize port access
+ *
+ * @param aDeviceNum device number
+ * @param aAdcType ADC type 0:max1027 1:as1531
+ * @param aVRef reference tension in millivolts
+ */
AsAdc(const char *aAdcType, int aDeviceNum, int aVRef);
virtual ~AsAdc();
+ /** @brief get value in millivolts
+ *
+ * @param aChannel channel number
+ *
+ * @return value in millivolts ; error if negative millivolts
+ */
long getValueInMillivolts(int aChannel) const;
protected:
+ /**
+ * ADC device C structure
+ */
mutable struct as_adc_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_backlight.hpp b/target/packages/as_devices/cpp/as_backlight.hpp
index 79a4e43..faacf64 100644
--- a/target/packages/as_devices/cpp/as_backlight.hpp
+++ b/target/packages/as_devices/cpp/as_backlight.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for backlight device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_BACKLIGHT__HPP__
#define AS_BACKLIGHT__HPP__
@@ -27,14 +33,22 @@
/**
* C++ wrapper for Backlight device
+ *
+ * @ingroup cpp_wrappers
*/
class AsBacklight
{
public:
/**
- * Constructor
+ * @brief Constructor
*/
AsBacklight();
+
+ /**
+ * @brief Constructor
+ *
+ * @param aBacklightName backlight device name
+ */
AsBacklight(char *aBacklightName);
virtual ~AsBacklight();
@@ -50,7 +64,7 @@ public:
*/
long getMaxBrightness() const;
- /** @bief Set brightness
+ /** @brief Set brightness
*
* @param aBrightness backlight brightness
*
@@ -59,6 +73,9 @@ public:
long setBrightness(int aBrightness);
protected:
+ /**
+ * Backlight device C structure
+ */
mutable struct as_backlight_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_dac.cpp b/target/packages/as_devices/cpp/as_dac.cpp
index c022e6d..e627556 100644
--- a/target/packages/as_devices/cpp/as_dac.cpp
+++ b/target/packages/as_devices/cpp/as_dac.cpp
@@ -23,14 +23,6 @@
#include "as_dac.hpp"
#include <iostream>
-/** @brief Constructor: Open DAC
- *
- * @param aDacType type name of adc ("max5821" or "mcp4912")
- * @param aBusNumber bus number used
- * @param aAddress i2c address for i2c chip, and CS number for SPI chip
- * @param aVRef voltage reference in milivolt
- * @param aVDefault default voltage value at open
- */
AsDac::AsDac(const char *aDacType, int aBusNumber, int aAddress, int aVRef)
{
mDev = as_dac_open(aDacType, aBusNumber, aAddress, aVRef);
@@ -53,14 +45,7 @@ AsDac::~AsDac()
std::cerr<<"AsDac device structure not allocated"<<std::endl;
}
}
-
-/** @brief set a channel value.
- *
- * @param aChannel channel number (A:0, B:1,...)
- * @param aValue channel value in milivolt
- *
- * @return negative value on error
- */
+
long AsDac::setValueInMillivolts(int aChannel, int aValue)
{
if (mDev != NULL)
diff --git a/target/packages/as_devices/cpp/as_dac.hpp b/target/packages/as_devices/cpp/as_dac.hpp
index 3c0a657..202b0e1 100644
--- a/target/packages/as_devices/cpp/as_dac.hpp
+++ b/target/packages/as_devices/cpp/as_dac.hpp
@@ -20,20 +20,48 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for DAC device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_DAC__HPP__
#define AS_DAC__HPP__
#include "as_dac.h"
+/**
+ * C++ wrapper for DAC device
+ *
+ * @ingroup cpp_wrappers
+ */
class AsDac
{
public:
+ /** @brief Constructor: Open DAC
+ *
+ * @param aDacType type name of adc ("max5821" or "mcp4912")
+ * @param aBusNumber bus number used
+ * @param aAddress i2c address for i2c chip, and CS number for SPI chip
+ * @param aVRef voltage reference in milivolt
+ */
AsDac(const char *aDacType, int aBusNumber, int aAddress, int aVRef);
virtual ~AsDac();
+ /** @brief set a channel value.
+ *
+ * @param aChannel channel number (A:0, B:1,...)
+ * @param aValue channel value in milivolt
+ *
+ * @return negative value on error
+ */
long setValueInMillivolts(int aChannel, int aValue);
protected:
+ /**
+ * DAC device C structure
+ */
mutable struct as_dac_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_gpio.cpp b/target/packages/as_devices/cpp/as_gpio.cpp
index 385d1cd..81b1fa2 100644
--- a/target/packages/as_devices/cpp/as_gpio.cpp
+++ b/target/packages/as_devices/cpp/as_gpio.cpp
@@ -23,11 +23,6 @@
#include "as_gpio.hpp"
#include <iostream>
-/** @brief Constructor: Initialize port access
- *
- * @param aGpioNum gpio number
- *
- */
AsGpio::AsGpio(int aGpioNum)
{
mDev = as_gpio_open(aGpioNum);
@@ -51,12 +46,6 @@ AsGpio::~AsGpio()
}
}
-/** @brief Set pin direction
- *
- * @param aDirection direction 0:input 1:output
- *
- * @return error if negative value
- */
long AsGpio::setPinDirection(char *aDirection)
{
if (mDev != NULL)
@@ -70,10 +59,6 @@ long AsGpio::setPinDirection(char *aDirection)
}
}
-/** @brief Get pin direction
- *
- * @return pin direction if positive or null, error if negative
- */
const char* AsGpio::getPinDirection() const
{
if (mDev != NULL)
@@ -87,12 +72,6 @@ const char* AsGpio::getPinDirection() const
}
}
-/** @brief Set pin value
- *
- * @param aValue value of pin (1 or 0)
- *
- * @return error if negative
- */
long AsGpio::setPinValue(int aValue)
{
if (mDev != NULL)
@@ -106,10 +85,6 @@ long AsGpio::setPinValue(int aValue)
}
}
-/** @brief Get pin value
- *
- * @return pin value if positive or null, error if negative
- */
long AsGpio::getPinValue() const
{
if (mDev != NULL)
@@ -123,12 +98,6 @@ long AsGpio::getPinValue() const
}
}
-/** @brief Get pin value, blocking until an interrupt/event occurs
- *
- * @param aDelay_ms waiting delay in milliseconds
- *
- * @return pin value if positive or null, read error if -1, timeout if -10
- */
long AsGpio::waitEvent(int aDelay_ms) const
{
if (mDev != NULL)
@@ -141,13 +110,7 @@ long AsGpio::waitEvent(int aDelay_ms) const
return -1;
}
}
-
-/** @brief Set pin irq mode
- *
- * @param aMode irq mode
- *
- * @return error if negative
- */
+
long AsGpio::setIrqMode(char* aMode)
{
if (mDev != NULL)
@@ -161,10 +124,6 @@ long AsGpio::setIrqMode(char* aMode)
}
}
-/** @brief Get pin irq mode value
- *
- * @return none/rising/falling/both
- */
const char* AsGpio::getIrqMode() const
{
if (mDev != NULL)
@@ -178,10 +137,6 @@ const char* AsGpio::getIrqMode() const
}
}
-/** @brief Get pin number value
- *
- * @return pin number, error if negative
- */
long AsGpio::getPinNum() const
{
if (mDev != NULL)
diff --git a/target/packages/as_devices/cpp/as_gpio.hpp b/target/packages/as_devices/cpp/as_gpio.hpp
index d92f701..139316a 100644
--- a/target/packages/as_devices/cpp/as_gpio.hpp
+++ b/target/packages/as_devices/cpp/as_gpio.hpp
@@ -20,30 +20,93 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for GPIOs
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_GPIO__HPP__
#define AS_GPIO__HPP__
#include "as_gpio.h"
+/**
+ * C++ wrapper for GPIO device
+ *
+ * @ingroup cpp_wrappers
+ */
class AsGpio
{
public:
+ /** @brief Constructor: Initialize port access
+ *
+ * @param aGpioNum gpio number
+ *
+ */
AsGpio(int aGpioNum);
virtual ~AsGpio();
+ /** @brief Set pin direction
+ *
+ * @param aDirection direction 0:input 1:output
+ *
+ * @return error if negative value
+ */
long setPinDirection(char* aDirection);
+
+ /** @brief Get pin direction
+ *
+ * @return pin direction if positive or null, error if negative
+ */
const char* getPinDirection() const;
+ /** @brief Set pin value
+ *
+ * @param aValue value of pin (1 or 0)
+ *
+ * @return error if negative
+ */
long setPinValue(int aValue);
+
+ /** @brief Get pin value
+ *
+ * @return pin value if positive or null, error if negative
+ */
long getPinValue() const;
+
+ /** @brief Get pin value, blocking until an interrupt/event occurs
+ *
+ * @param aDelay_ms waiting delay in milliseconds
+ *
+ * @return pin value if positive or null, read error if -1, timeout if -10
+ */
long waitEvent(int aDelay_ms) const;
+ /** @brief Set pin irq mode
+ *
+ * @param aMode irq mode
+ *
+ * @return error if negative
+ */
long setIrqMode(char* aMode);
+
+ /** @brief Get pin irq mode value
+ *
+ * @return none/rising/falling/both
+ */
const char* getIrqMode() const;
+ /** @brief Get pin number value
+ *
+ * @return pin number, error if negative
+ */
long getPinNum() const;
protected:
+ /**
+ * GPIO device C structure
+ */
mutable struct as_gpio_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_i2c.cpp b/target/packages/as_devices/cpp/as_i2c.cpp
index 919fa8b..1812058 100644
--- a/target/packages/as_devices/cpp/as_i2c.cpp
+++ b/target/packages/as_devices/cpp/as_i2c.cpp
@@ -23,10 +23,7 @@
#include "as_i2c.hpp"
#include <iostream>
-/** @brief Constructor: Open an I2C bus.
- *
- * @param aBusNumber bus to open
- */
+
AsI2c::AsI2c(int aBusNumber)
{
mDev = as_i2c_open(aBusNumber);
@@ -50,12 +47,6 @@ AsI2c::~AsI2c()
}
}
-/** @brief Set chip's I2C slave address
- *
- * @param aAddr slave's address
- *
- * @return error if negative
- */
long AsI2c::setSlaveAddr(unsigned char aAddr)
{
if (mDev != NULL)
@@ -69,10 +60,6 @@ long AsI2c::setSlaveAddr(unsigned char aAddr)
}
}
-/** @brief Get chip's I2C slave address
- *
- * @return slave's address
- */
long AsI2c::getSlaveAddr() const
{
if (mDev != NULL)
@@ -86,13 +73,6 @@ long AsI2c::getSlaveAddr() const
}
}
-/** @brief Read several bytes (ioctl() method) from given chip.
- *
- * @param aData read data
- * @param aSize data size
- *
- * @return error if negative
- */
long AsI2c::read(unsigned char *aData, size_t aSize) const
{
if (mDev != NULL)
@@ -106,13 +86,6 @@ long AsI2c::read(unsigned char *aData, size_t aSize) const
}
}
-/** @brief Write several bytes (ioctl() method) to given chip.
- *
- * @param aData data to write
- * @param aSize data size
- *
- * @return error if negative
- */
long AsI2c::write(unsigned char *aData, size_t aSize)
{
if (mDev != NULL)
@@ -126,14 +99,6 @@ long AsI2c::write(unsigned char *aData, size_t aSize)
}
}
-/** @brief Read from given chip at a given register address (ioctl() method).
- *
- * @param aReg register address
- * @param aData read data
- * @param aSize data size
- *
- * @return error if negative
- */
long AsI2c::readReg(unsigned char aReg, unsigned char *aData, size_t aSize) const
{
if (mDev != NULL)
@@ -147,14 +112,6 @@ long AsI2c::readReg(unsigned char aReg, unsigned char *aData, size_t aSize) cons
}
}
-/** @brief Write to given chip at a given register address (ioctl() method).
- *
- * @param aReg register address
- * @param aData data to write
- * @param aSize data size
- *
- * @return error if negative
- */
long AsI2c::writeReg(unsigned char aReg, unsigned char *aData, size_t aSize)
{
if (mDev != NULL)
@@ -168,16 +125,6 @@ long AsI2c::writeReg(unsigned char aReg, unsigned char *aData, size_t aSize)
}
}
-/** @brief forge a read message like this:
- * S Addr[W] wdata0 [A] wdata1 [A] ... RS Addr R [rdata0] A [rdata1] A ... P
- *
- * @param aWData data to write
- * @param aSize written data size
- * @param aRData read data
- * @param aReadSize read data size
- *
- * @return error if negative
- */
long AsI2c::readMsg(unsigned char *aWData, unsigned char aWriteSize, unsigned char *aRData, size_t aReadSize)
{
if (mDev != NULL)
@@ -191,12 +138,6 @@ long AsI2c::readMsg(unsigned char *aWData, unsigned char aWriteSize, unsigned ch
}
}
-/** @brief Read a byte from the given register.
- *
- * @param aReg register address
- *
- * @return read byte
- */
long AsI2c::readRegByte(unsigned char aReg) const
{
if (mDev != NULL)
@@ -210,13 +151,6 @@ long AsI2c::readRegByte(unsigned char aReg) const
}
}
-/** @brief Write a byte to the given register.
- *
- * @param aReg register address
- * @param aVal byte to write
- *
- * @return error if negative
- */
long AsI2c::writeRegByte(unsigned char aReg, unsigned char aVal)
{
if (mDev != NULL)
diff --git a/target/packages/as_devices/cpp/as_i2c.hpp b/target/packages/as_devices/cpp/as_i2c.hpp
index 84ea901..f729b98 100644
--- a/target/packages/as_devices/cpp/as_i2c.hpp
+++ b/target/packages/as_devices/cpp/as_i2c.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for I2C device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_I2C__HPP__
#define AS_I2C__HPP__
@@ -27,27 +33,106 @@
#include "as_i2c.h"
+/**
+ * C++ wrapper for I2C bus device
+ *
+ * @ingroup cpp_wrappers
+ */
class AsI2c
{
public:
+ /** @brief Constructor: Open an I2C bus.
+ *
+ * @param aBusNumber bus to open
+ */
AsI2c(int aBusNumber);
virtual ~AsI2c();
+ /** @brief Set chip's I2C slave address
+ *
+ * @param aAddr slave's address
+ *
+ * @return error if negative
+ */
long setSlaveAddr(unsigned char aAddr);
+
+ /** @brief Get chip's I2C slave address
+ *
+ * @return slave's address
+ */
long getSlaveAddr() const;
+ /** @brief Read several bytes (ioctl() method) from given chip.
+ *
+ * @param aData read data
+ * @param aSize data size
+ *
+ * @return error if negative
+ */
long read(unsigned char *aData, size_t aSize) const;
+
+ /** @brief Write several bytes (ioctl() method) to given chip.
+ *
+ * @param aData data to write
+ * @param aSize data size
+ *
+ * @return error if negative
+ */
long write(unsigned char *aData, size_t aSize);
+ /** @brief Read from given chip at a given register address (ioctl() method).
+ *
+ * @param aReg register address
+ * @param aData read data
+ * @param aSize data size
+ *
+ * @return error if negative
+ */
long readReg(unsigned char aReg, unsigned char *aData, size_t aSize) const;
+
+ /** @brief Write to given chip at a given register address (ioctl() method).
+ *
+ * @param aReg register address
+ * @param aData data to write
+ * @param aSize data size
+ *
+ * @return error if negative
+ */
long writeReg(unsigned char aReg, unsigned char *aData, size_t aSize);
+ /** @brief forge a read message like this:
+ * S Addr[W] wdata0 [A] wdata1 [A] ... RS Addr R [rdata0] A [rdata1] A ... P
+ *
+ * @param aWData data to write
+ * @param aWriteSize written data size
+ * @param aRData read data
+ * @param aReadSize read data size
+ *
+ * @return error if negative
+ */
long readMsg(unsigned char *aWData, unsigned char aWriteSize, unsigned char *aRData, size_t aReadSize);
+ /** @brief Read a byte from the given register.
+ *
+ * @param aReg register address
+ *
+ * @return read byte
+ */
long readRegByte(unsigned char aReg) const;
+
+ /** @brief Write a byte to the given register.
+ *
+ * @param aReg register address
+ * @param aVal byte to write
+ *
+ * @return error if negative
+ */
long writeRegByte(unsigned char aReg, unsigned char aVal);
protected:
+ /**
+ * I2C bus device C structure
+ */
mutable struct as_i2c_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_i2c_eeprom.hpp b/target/packages/as_devices/cpp/as_i2c_eeprom.hpp
index b47bb06..8643337 100644
--- a/target/packages/as_devices/cpp/as_i2c_eeprom.hpp
+++ b/target/packages/as_devices/cpp/as_i2c_eeprom.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for I2C eeprom device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_I2C_EEPROM__HPP__
#define AS_I2C_EEPROM__HPP___
@@ -27,6 +33,8 @@
/**
* C++ wrapper for I2C EEPROM device
+ *
+ * @ingroup cpp_wrappers
*/
class AsI2CEeprom
{
@@ -69,13 +77,16 @@ unsigned long aPageBufferSize, unsigned int aNumberPages, unsigned int aPageSize
/** @brief Write on an EEPROM non sequential
*
- * @param aAddress address to start read
+ * @param anAddress address to start read
* @param aLength length of data to read
* @param aBuffer buffer receiving data
*/
long write_mid(unsigned int anAddress, unsigned int aLength, unsigned char* aBuffer);
protected:
+ /**
+ * I2C eeprom device C structure
+ */
mutable struct as_i2c_eeprom_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_pwm.hpp b/target/packages/as_devices/cpp/as_pwm.hpp
index dbb394a..3f46b1e 100644
--- a/target/packages/as_devices/cpp/as_pwm.hpp
+++ b/target/packages/as_devices/cpp/as_pwm.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for PWM device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_PWM__HPP__
#define AS_PWM__HPP__
@@ -27,6 +33,8 @@
/**
* C++ wrapper for PWM device
+ *
+ * @ingroup cpp_wrappers
*/
class AsPwm
{
@@ -53,7 +61,7 @@ public:
*/
long getFrequency() const;
- /** @bief set period
+ /** @brief set period
*
* @param aPeriod period in uS
*
@@ -96,6 +104,9 @@ public:
long getState() const;
protected:
+ /**
+ * PWM device C structure
+ */
mutable struct as_pwm_device *mDev;
};
diff --git a/target/packages/as_devices/cpp/as_spi.cpp b/target/packages/as_devices/cpp/as_spi.cpp
index 538ca5e..31404d8 100644
--- a/target/packages/as_devices/cpp/as_spi.cpp
+++ b/target/packages/as_devices/cpp/as_spi.cpp
@@ -23,10 +23,6 @@
#include "as_spi.hpp"
#include <iostream>
-/** @brief Constructor: Open a SPI bus.
- *
- * @param aSpidev_name path name
- */
AsSpi::AsSpi(const unsigned char *aSpidev_name)
{
mFd = as_spi_open(aSpidev_name);
@@ -44,12 +40,6 @@ AsSpi::~AsSpi()
}
}
-/** @brief Set bits order
- *
- * @param aLsb if 1 lsb first, else msb first
- *
- * @return lsb first if positive, msb first if 0, negative value on error
- */
int AsSpi::setLsb(unsigned char aLsb)
{
if (mFd != 0)
@@ -63,10 +53,6 @@ int AsSpi::setLsb(unsigned char aLsb)
}
}
-/** @brief Get bits order
- *
- * @return lsb first if positive, msb first if 0, negative value on error
- */
int AsSpi::getLsb() const
{
if (mFd != 0)
@@ -80,12 +66,6 @@ int AsSpi::getLsb() const
}
}
-/** @brief Set spi bus mode
- *
- * @param aMode spi's bus mode
- *
- * @return mode if positive value, negative value on error
- */
int AsSpi::setMode(unsigned char aMode)
{
if (mFd != 0)
@@ -99,10 +79,6 @@ int AsSpi::setMode(unsigned char aMode)
}
}
-/** @brief Get spi bus mode
- *
- * @return mode if positive value, negative value on error
- */
int AsSpi::getMode() const
{
if (mFd != 0)
@@ -116,12 +92,6 @@ int AsSpi::getMode() const
}
}
-/** @brief Set clock bus speed
- *
- * @param aSpeed clock speed
- *
- * @return speed in Hz, negative value on error
- */
int AsSpi::setSpeed(unsigned char aSpeed)
{
if (mFd != 0)
@@ -135,10 +105,6 @@ int AsSpi::setSpeed(unsigned char aSpeed)
}
}
-/** @brief Get clock bus speed
- *
- * @return speed in Hz
- */
int AsSpi::getSpeed() const
{
if (mFd != 0)
@@ -152,10 +118,6 @@ int AsSpi::getSpeed() const
}
}
-/** @brief Get bits per word
- *
- * @return bit per word if positive value, negative value on error
- */
int AsSpi::getBitsPerWord() const
{
if (mFd != 0)
@@ -169,12 +131,6 @@ int AsSpi::getBitsPerWord() const
}
}
-/** @brief Set bits per word
- *
- * @param aBits number of bits per word
- *
- * @return bit per word if positive value, negative value on error
- */
int AsSpi::setBitsPerWord(unsigned char aBits)
{
if (mFd != 0)
@@ -188,14 +144,6 @@ int AsSpi::setBitsPerWord(unsigned char aBits)
}
}
-/** @brief Forge arbitrary length message (31bits max) and send it
- *
- * @param aMsg right adjusted message
- * @param aLen lenght of the message
- * @param aSpeed clock speed in Hz
- *
- * @return message read
- */
unsigned long long AsSpi::msg(unsigned long long aMsg, size_t aLen, unsigned long aSpeed)
{
if (mFd != 0)
diff --git a/target/packages/as_devices/cpp/as_spi.hpp b/target/packages/as_devices/cpp/as_spi.hpp
index 47d8fd0..ca53145 100644
--- a/target/packages/as_devices/cpp/as_spi.hpp
+++ b/target/packages/as_devices/cpp/as_spi.hpp
@@ -20,6 +20,12 @@
**
*/
+/** @file
+ * @brief Provide C++ wrapper for SPI device
+ *
+ * @ingroup cpp_wrappers
+ */
+
#ifndef AS_SPI__HPP__
#define AS_SPI__HPP__
@@ -27,26 +33,90 @@
#include "as_spi.h"
+/**
+ * C++ wrapper for SPI bus device
+ *
+ * @ingroup cpp_wrappers
+ */
class AsSpi
{
+ /** @brief Constructor: Open a SPI bus.
+ *
+ * @param aSpidev_name path name
+ */
AsSpi(const unsigned char *aSpidev_name);
virtual ~AsSpi();
+ /** @brief Set bits order
+ *
+ * @param aLsb if 1 lsb first, else msb first
+ *
+ * @return lsb first if positive, msb first if 0, negative value on error
+ */
int setLsb(unsigned char aLsb);
+
+ /** @brief Get bits order
+ *
+ * @return lsb first if positive, msb first if 0, negative value on error
+ */
int getLsb() const;
+ /** @brief Set spi bus mode
+ *
+ * @param aMode spi's bus mode
+ *
+ * @return mode if positive value, negative value on error
+ */
int setMode(unsigned char aMode);
+
+ /** @brief Get spi bus mode
+ *
+ * @return mode if positive value, negative value on error
+ */
int getMode() const;
+ /** @brief Set clock bus speed
+ *
+ * @param aSpeed clock speed
+ *
+ * @return speed in Hz, negative value on error
+ */
int setSpeed(unsigned char aSpeed);
+
+ /** @brief Get clock bus speed
+ *
+ * @return speed in Hz
+ */
int getSpeed() const;
+ /** @brief Get bits per word
+ *
+ * @return bit per word if positive value, negative value on error
+ */
int getBitsPerWord() const;
+
+ /** @brief Set bits per word
+ *
+ * @param aBits number of bits per word
+ *
+ * @return bit per word if positive value, negative value on error
+ */
int setBitsPerWord(unsigned char aBits);
+ /** @brief Forge arbitrary length message (31bits max) and send it
+ *
+ * @param aMsg right adjusted message
+ * @param aLen lenght of the message
+ * @param aSpeed clock speed in Hz
+ *
+ * @return message read
+ */
unsigned long long msg(unsigned long long aMsg, size_t aLen, unsigned long aSpeed);
protected:
+ /**
+ * SPI device file descriptor
+ */
int mFd;
};
diff --git a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
index 70284a3..09c0059 100644
--- a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
+++ b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
@@ -29,6 +29,12 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for APF27 PWM
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drive pwm under apf27."
__version__ = "1.0.0"
__versionTime__ = "08/10/2009"
@@ -36,12 +42,22 @@ __author__ = "Fabien Marteau <fab...@ar...>"
import wrappers
+##
+# @brief Error class for APF27 PWM wrapper
+#
+# @ingroup python_wrappers
+#
class Apf27PwmError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
+##
+# @brief Python wrapper for APF27 PWM
+#
+# @ingroup python_wrappers
+#
class Apf27Pwm:
""" Drive pwm on apf27
"""
diff --git a/target/packages/as_devices/python/AsDevices/AsAdc.py b/target/packages/as_devices/python/AsDevices/AsAdc.py
index 7f56c2e..cd9de96 100644
--- a/target/packages/as_devices/python/AsDevices/AsAdc.py
+++ b/target/packages/as_devices/python/AsDevices/AsAdc.py
@@ -30,18 +30,34 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for ADC
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drives Armadeus boards ADCs"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
import wrappers.AsAdc_wrap as wrapper
+##
+# @brief Error class for ADC wrapper
+#
+# @ingroup python_wrappers
+#
class AsAdcError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
+##
+# @brief Python wrapper for ADC
+#
+# @ingroup python_wrappers
+#
class AsAdc:
""" Drive adc
"""
diff --git a/target/packages/as_devices/python/AsDevices/AsDac.py b/target/packages/as_devices/python/AsDevices/AsDac.py
index d235663..091475d 100644
--- a/target/packages/as_devices/python/AsDevices/AsDac.py
+++ b/target/packages/as_devices/python/AsDevices/AsDac.py
@@ -24,12 +24,23 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for DAC
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drive ARMadeus boards DACs"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
import wrappers.AsDac_wrap as wrapper
+##
+# @brief Python wrapper for DAC
+#
+# @ingroup python_wrappers
+#
class AsDacError(Exception):
def __init__(self, value):
self.value = value
diff --git a/target/packages/as_devices/python/AsDevices/AsGpio.py b/target/packages/as_devices/python/AsDevices/AsGpio.py
index 6b61efc..38f0a75 100644
--- a/target/packages/as_devices/python/AsDevices/AsGpio.py
+++ b/target/packages/as_devices/python/AsDevices/AsGpio.py
@@ -28,6 +28,12 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for GPIOs
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drive ARMadeus board GPIO"
__version__ = "1.0.0"
__versionTime__ = "23/03/2010"
@@ -35,6 +41,11 @@ __author__ = "Fabien Marteau <fab...@ar...>"
import wrappers.AsGpio_wrap as wrapper
+##
+# @brief Python wrapper for GPIOs
+#
+# @ingroup python_wrappers
+#
class AsGpioError(Exception):
def __init__(self, value):
self.value = value
diff --git a/target/packages/as_devices/python/AsDevices/AsI2c.py b/target/packages/as_devices/python/AsDevices/AsI2c.py
index 809e31f..d1c9ad6 100644
--- a/target/packages/as_devices/python/AsDevices/AsI2c.py
+++ b/target/packages/as_devices/python/AsDevices/AsI2c.py
@@ -24,12 +24,23 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for I2C
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drive ARMadeus Board I²C"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
import wrappers.AsI2c_wrap as wrapper
+##
+# @brief Python wrapper for I2C
+#
+# @ingroup python_wrappers
+#
class AsI2cError(Exception):
def __init__(self, value):
self.value = value
diff --git a/target/packages/as_devices/python/AsDevices/AsSpi.py b/target/packages/as_devices/python/AsDevices/AsSpi.py
index 16eb69b..6e85f9e 100644
--- a/target/packages/as_devices/python/AsDevices/AsSpi.py
+++ b/target/packages/as_devices/python/AsDevices/AsSpi.py
@@ -24,12 +24,23 @@
#
#-----------------------------------------------------------------------------
+## @file
+# @brief Provide Python wrapper for SPI
+#
+# @ingroup python_wrappers
+#
+
__doc__ = "This class drive ARMadeus Board SPI"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
import wrappers.AsSpi_wrap as wrapper
+##
+# @brief Python wrapper for SPI
+#
+# @ingroup python_wrappers
+#
class AsSpiError(Exception):
def __init__(self, value):
self.value = value
diff --git a/target/packages/as_devices/python/src/Apf27Pwm_wrap.c b/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
index f226cc5..fbd5cf2 100644
--- a/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
+++ b/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
@@ -5,224 +5,247 @@
* @param aPwmNumber The pwm number used
* @return PyObject
*/
-static PyObject *init(PyObject * self, PyObject * args)
+static PyObject * init(PyObject *self, PyObject *args)
{
- int aPwmNumber;
- int ret = 1;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
-
- ret = as_apf27_pwm_init(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Initialization error. Is kernel module loaded ?");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ int aPwmNumber;
+ int ret=1;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
+
+ ret = as_apf27_pwm_init(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Initialization error. Is kernel module loaded ?");
+ return NULL;
+ }
+
+ return Py_BuildValue("i",ret);
}
/** Set frequency
* @param aPwmNumber the pwm number used
* @param aFrequency frequency to set in Hz
*/
-static PyObject *setFrequency(PyObject * self, PyObject * args)
+static PyObject * setFrequency(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
- int aFrequency;
-
- int ret = 0;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aFrequency)) {
- return NULL;
- }
-
- ret = as_apf27_pwm_setFrequency(aPwmNumber, aFrequency);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't set frequency");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ int aPwmNumber;
+ int aFrequency;
+
+ int ret=0;
+
+ /* Get arguments */
+ if(!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aFrequency))
+ {
+ return NULL;
+ }
+
+ ret = as_apf27_pwm_setFrequency(aPwmNumber, aFrequency);
+ if(ret<0)
+ {
+ PyErr_SetString(PyExc_Exception,"Can't set frequency");
+ return NULL;
+ }
+
+ return Py_BuildValue("i",ret);
}
/** Get Frequency
* @param aPwmNumber the pwm number used
*/
-static PyObject *getFrequency(PyObject * self, PyObject * args)
+static PyObject * getFrequency(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
+ /* parameters */
+ int aPwmNumber;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
- ret = as_apf27_pwm_getFrequency(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't get frequency");
- return NULL;
- }
+ ret = as_apf27_pwm_getFrequency(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't get frequency");
+ return NULL;
+ }
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("i",ret);
}
-static PyObject *setPeriod(PyObject * self, PyObject * args)
+static PyObject * setPeriod(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
- int aPeriod;
-
- int ret = 0;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aPeriod)) {
- return NULL;
- }
-
- ret = as_apf27_pwm_setPeriod(aPwmNumber, aPeriod);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't set period");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ int aPwmNumber;
+ int aPeriod;
+
+ int ret=0;
+
+ /* Get arguments */
+ if(!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aPeriod))
+ {
+ return NULL;
+ }
+
+ ret = as_apf27_pwm_setPeriod(aPwmNumber, aPeriod);
+ if(ret<0)
+ {
+ PyErr_SetString(PyExc_Exception,"Can't set period");
+ return NULL;
+ }
+
+ return Py_BuildValue("i",ret);
}
-static PyObject *getPeriod(PyObject * self, PyObject * args)
+static PyObject * getPeriod(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
+ /* parameters */
+ int aPwmNumber;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
- ret = as_apf27_pwm_getPeriod(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't get period");
- return NULL;
- }
+ ret = as_apf27_pwm_getPeriod(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't get period");
+ return NULL;
+ }
+
+ return Py_BuildValue("i",ret);
- return Py_BuildValue("i", ret);
}
-static PyObject *setDuty(PyObject * self, PyObject * args)
+static PyObject * setDuty(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
- int aDuty;
-
- int ret = 0;
+ /* parameters */
+ int aPwmNumber;
+ int aDuty;
+
+ int ret=0;
+
+ /* Get arguments */
+ if(!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aDuty))
+ {
+ return NULL;
+ }
+
+ ret = as_apf27_pwm_setDuty(aPwmNumber, aDuty);
+ if(ret<0)
+ {
+ PyErr_SetString(PyExc_Exception,"Can't set duty");
+ return NULL;
+ }
+
+ return Py_BuildValue("i",ret);
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aDuty)) {
- return NULL;
- }
-
- ret = as_apf27_pwm_setDuty(aPwmNumber, aDuty);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't set duty");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
}
-static PyObject *getDuty(PyObject * self, PyObject * args)
+static PyObject * getDuty(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
+ /* parameters */
+ int aPwmNumber;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
- ret = as_apf27_pwm_getDuty(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't get duty");
- return NULL;
- }
+ ret = as_apf27_pwm_getDuty(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't get duty");
+ return NULL;
+ }
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("i",ret);
}
-static PyObject *activate(PyObject * self, PyObject * args)
+static PyObject * activate(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
- int aEnable;
+ /* parameters */
+ int aPwmNumber;
+ int aEnable;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ii", &aPwmNumber, &aEnable))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "ii", &aPwmNumber,&aEnable))
+ return NULL;
- ret = as_apf27_pwm_activate(aPwmNumber, aEnable);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't activate pwm");
- return NULL;
- }
+ ret = as_apf27_pwm_activate(aPwmNumber,aEnable);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't activate pwm");
+ return NULL;
+ }
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("i",ret);
}
-static PyObject *getState(PyObject * self, PyObject * args)
+static PyObject * getState(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
+ /* parameters */
+ int aPwmNumber;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
- ret = as_apf27_pwm_getState(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't get state");
- return NULL;
- }
+ ret = as_apf27_pwm_getState(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't get state");
+ return NULL;
+ }
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("i",ret);
}
-static PyObject *pwm_close(PyObject * self, PyObject * args)
+static PyObject * pwm_close(PyObject *self, PyObject *args)
{
- /* parameters */
- int aPwmNumber;
+ /* parameters */
+ int aPwmNumber;
- int ret = 1;
+ int ret=1;
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
- return NULL;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aPwmNumber))
+ return NULL;
- ret = as_apf27_pwm_close(aPwmNumber);
- if (ret < 0) {
- PyErr_SetString(PyExc_Exception, "Can't close");
- return NULL;
- }
+ ret = as_apf27_pwm_close(aPwmNumber);
+ if(ret < 0)
+ {
+ PyErr_SetString(PyExc_Exception,
+ "Can't close");
+ return NULL;
+ }
- return Py_BuildValue("i", ret);
+ return Py_BuildValue("i",ret);
}
void initApf27Pwm_wrap()
{
- PyObject *m;
+ PyObject *m;
+
+ m = Py_InitModule("Apf27Pwm_wrap", Apf27Pwm_wrap_Methods);
+ if (m == NULL)
+ return;
- m = Py_InitModule("Apf27Pwm_wrap", Apf27Pwm_wrap_Methods);
- if (m == NULL)
- return;
}
+
diff --git a/target/packages/as_devices/python/src/Apf27Pwm_wrap.h b/target/packages/as_devices/python/src/Apf27Pwm_wrap.h
index 6aad8ed..e63787b 100644
--- a/target/packages/as_devices/python/src/Apf27Pwm_wrap.h
+++ b/target/packages/as_devices/python/src/Apf27Pwm_wrap.h
@@ -1,39 +1,47 @@
+/** @file
+ * @brief Provide Python wrapper for PWM
+ *
+ * @ingroup python_wrappers
+ */
+
#include <Python.h>
+
/* init module */
void initApf27Pwm();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject *init(PyObject * self, PyObject * args);
+static PyObject * init(PyObject *self, PyObject *args);
-static PyObject *setFrequency(PyObject * self, PyObject * args);
-static PyObject *getFrequency(PyObject * self, PyObject * args);
+static PyObject * setFrequency(PyObject *self, PyObject *args);
+static PyObject * getFrequency(PyObject *self, PyObject *args);
-static PyObject *setPeriod(PyObject * self, PyObject * args);
-static PyObject *getPeriod(PyObject * self, PyObject * args);
+static PyObject * setPeriod(PyObject *self, PyObject *args);
+static PyObject * getPeriod(PyObject *self, PyObject *args);
-static PyObject *setDuty(PyObject * self, PyObject * args);
-static PyObject *getDuty(PyObject * self, PyObject * args);
+static PyObject * setDuty(PyObject *self, PyObject *args);
+static PyObject * getDuty(PyObject *self, PyObject *args);
-static PyObject *activate(PyObject * self, PyObject * args);
-static PyObject *getState(PyObject * self, PyObject * args);
+static PyObject * activate(PyObject *self, PyObject *args);
+static PyObject * getState(PyObject *self, PyObject *args);
-static PyObject *pwm_close(PyObject * self, PyObject * args);
+static PyObject * pwm_close(PyObject *self, PyObject *args);
/* Methods definition */
static PyMethodDef Apf27Pwm_wrap_Methods[] = {
- {"init", init, METH_VARARGS, "Initialize PWM"},
- {"setFrequency", setFrequency, METH_VARARGS, "Set frequency in Hz"},
- {"getFrequency", getFrequency, METH_VARARGS, "Get frequency in Hz"},
- {"setPeriod", setPeriod, METH_VARARGS, "Set period in us"},
- {"getPeriod", getPeriod, METH_VARARGS, "Get period in us"},
- {"setDuty", setDuty, METH_VARARGS, "Set duty in 1/1000"},
- {"getDuty", getDuty, METH_VARARGS, "Get duty in 1/1000"},
- {"activate", activate, METH_VARARGS, "Activate or desactivate PWM"},
- {"getState", getState, METH_VARARGS,
- "Get state of PWM (activated or not)"},
- {"pwm_close", pwm_close, METH_VARARGS, "Close PWM"},
- {NULL, NULL, 0, NULL} /* Sentinel */
+ {"init", init , METH_VARARGS, "Initialize pwm"},
+ {"setFrequency", setFrequency , METH_VARARGS, "Set frequency in Hz"},
+ {"getFrequency", getFrequency , METH_VARARGS, "Get frequency in Hz"},
+ {"setPeriod" , setPeriod , METH_VARARGS, "Set period in us"},
+ {"getPeriod" , getPeriod , METH_VARARGS, "Get period in us"},
+ {"setDuty" , setDuty , METH_VARARGS, "Set duty in 1/1000"},
+ {"getDuty" , getDuty , METH_VARARGS, "Get duty in 1/1000"},
+ {"activate" , activate , METH_VARARGS, "Activate or desactivate pwm"},
+ {"getState" , getState , METH_VARARGS, "Get state of pwm (activated or not"},
+ {"pwm_close" , pwm_close , METH_VARARGS, "Close pwm"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
};
+
+
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.c b/target/packages/as_devices/python/src/AsAdc_wrap.c
index c45ac19..6179052 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.c
+++ b/target/packages/as_devices/python/src/AsAdc_wrap.c
@@ -18,98 +18,110 @@
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include "AsAdc_wrap.h"
#include "as_adc.h"
+
/* Methods definitions */
static PyMethodDef AsAdc_wrap_methods[] = {
- {"adc_open", adc_open, METH_VARARGS, "Initialize adc"},
- {"getValueInMillivolts", getValueInMillivolts, METH_VARARGS,
- "Get Channel value in millivolts"},
- {"adc_close", adc_close, METH_VARARGS, "Close adc"},
- {NULL, NULL, 0, NULL} /* Sentinel */
+ {"adc_open", adc_open, METH_VARARGS, "Initialize adc"},
+ {"getValueInMillivolts", getValueInMillivolts, METH_VARARGS, "Get Channel value in millivolts"},
+ {"adc_close", adc_close, METH_VARARGS, "Close adc"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
};
/* Init module */
-void initAsAdc_wrap()
-{ /* called on first import *//* name matter if called dynamically */
- (void)Py_...
[truncated message content] |