armadeus-commitlog Mailing List for armadeus (Page 44)
Brought to you by:
sszy
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(43) |
Feb
(8) |
Mar
(7) |
Apr
(8) |
May
(14) |
Jun
(6) |
Jul
(4) |
Aug
(17) |
Sep
(18) |
Oct
(19) |
Nov
(52) |
Dec
(30) |
| 2008 |
Jan
(6) |
Feb
(6) |
Mar
(15) |
Apr
(22) |
May
(13) |
Jun
(11) |
Jul
(41) |
Aug
(10) |
Sep
(14) |
Oct
(21) |
Nov
(4) |
Dec
(66) |
| 2009 |
Jan
(67) |
Feb
(57) |
Mar
(90) |
Apr
(54) |
May
(64) |
Jun
(76) |
Jul
(14) |
Aug
(18) |
Sep
(18) |
Oct
(20) |
Nov
(15) |
Dec
(36) |
| 2010 |
Jan
(28) |
Feb
(25) |
Mar
(32) |
Apr
(23) |
May
(22) |
Jun
(62) |
Jul
(36) |
Aug
(16) |
Sep
(12) |
Oct
(20) |
Nov
(44) |
Dec
(25) |
| 2011 |
Jan
(36) |
Feb
(49) |
Mar
(28) |
Apr
(38) |
May
(26) |
Jun
(52) |
Jul
(33) |
Aug
(32) |
Sep
(19) |
Oct
(26) |
Nov
(13) |
Dec
(32) |
| 2012 |
Jan
(38) |
Feb
(34) |
Mar
(91) |
Apr
(35) |
May
(31) |
Jun
(72) |
Jul
(23) |
Aug
(13) |
Sep
(33) |
Oct
(47) |
Nov
(18) |
Dec
(22) |
| 2013 |
Jan
(31) |
Feb
(22) |
Mar
(26) |
Apr
(11) |
May
(38) |
Jun
(15) |
Jul
(37) |
Aug
(68) |
Sep
(34) |
Oct
(11) |
Nov
(26) |
Dec
(31) |
| 2014 |
Jan
(60) |
Feb
(55) |
Mar
(21) |
Apr
(31) |
May
(17) |
Jun
(35) |
Jul
(24) |
Aug
(17) |
Sep
(11) |
Oct
(23) |
Nov
(10) |
Dec
(23) |
| 2015 |
Jan
(15) |
Feb
(34) |
Mar
(46) |
Apr
(23) |
May
(12) |
Jun
(14) |
Jul
(18) |
Aug
(22) |
Sep
(6) |
Oct
(2) |
Nov
(1) |
Dec
(6) |
| 2016 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
(10) |
May
(17) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
(22) |
Oct
(8) |
Nov
(9) |
Dec
(5) |
| 2017 |
Jan
(11) |
Feb
(12) |
Mar
(27) |
Apr
(9) |
May
(1) |
Jun
(5) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
(10) |
Nov
(4) |
Dec
(6) |
| 2018 |
Jan
(6) |
Feb
(13) |
Mar
(9) |
Apr
(7) |
May
(10) |
Jun
(9) |
Jul
(21) |
Aug
(13) |
Sep
(10) |
Oct
(4) |
Nov
(6) |
Dec
(1) |
| 2019 |
Jan
(6) |
Feb
(2) |
Mar
(5) |
Apr
(6) |
May
(19) |
Jun
(14) |
Jul
(18) |
Aug
(3) |
Sep
(5) |
Oct
(7) |
Nov
(8) |
Dec
(4) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(9) |
Apr
(7) |
May
(2) |
Jun
(18) |
Jul
(3) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
| 2021 |
Jan
(9) |
Feb
(6) |
Mar
(4) |
Apr
(11) |
May
(7) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(10) |
Oct
(9) |
Nov
(5) |
Dec
|
| 2022 |
Jan
(2) |
Feb
(12) |
Mar
(3) |
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(4) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2023 |
Jan
(5) |
Feb
(3) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(1) |
Jun
(13) |
Jul
(7) |
Aug
(1) |
Sep
(6) |
Oct
(5) |
Nov
(11) |
Dec
(7) |
| 2025 |
Jan
(3) |
Feb
(1) |
Mar
(6) |
Apr
(4) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(4) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2026 |
Jan
(3) |
Feb
(7) |
Mar
(3) |
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-25 08:54:23
|
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 16f3bee792ed6af559b21b1855b12112c3e02b36 (commit)
from 7b32b10cf1143a8e8ff8570432369823f521fcc2 (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 16f3bee792ed6af559b21b1855b12112c3e02b36
Author: Julien Boibessot <jul...@ar...>
Date: Wed Jun 25 10:52:04 2014 +0200
[ASDEVICES] Lindent all C modules sources... again...
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_93lcxx.c | 378 +++++++++----------
target/packages/as_devices/c/as_93lcxx.h | 45 +--
target/packages/as_devices/c/as_adc.h | 8 +-
target/packages/as_devices/c/as_adc_iio.c | 161 ++++----
target/packages/as_devices/c/as_adc_iio.h | 7 +-
target/packages/as_devices/c/as_as1531.c | 111 +++---
target/packages/as_devices/c/as_as1531.h | 9 +-
target/packages/as_devices/c/as_backlight.c | 211 ++++++-----
target/packages/as_devices/c/as_backlight.h | 22 +-
target/packages/as_devices/c/as_dac.c | 2 +-
target/packages/as_devices/c/as_dac.h | 2 +-
target/packages/as_devices/c/as_gpio.c | 484 ++++++++++++------------
target/packages/as_devices/c/as_gpio.h | 27 +-
target/packages/as_devices/c/as_gpio_2_6_29.c | 348 +++++++++---------
target/packages/as_devices/c/as_helpers.c | 2 +-
target/packages/as_devices/c/as_i2c.c | 447 +++++++++++-----------
target/packages/as_devices/c/as_i2c.h | 31 +-
target/packages/as_devices/c/as_i2c_eeprom.c | 442 ++++++++++++----------
target/packages/as_devices/c/as_i2c_eeprom.h | 53 ++--
target/packages/as_devices/c/as_led.c | 201 +++++-----
target/packages/as_devices/c/as_led.h | 21 +-
target/packages/as_devices/c/as_max1027.c | 340 +++++++++--------
target/packages/as_devices/c/as_max1027.h | 22 +-
target/packages/as_devices/c/as_max5821.c | 279 +++++++-------
target/packages/as_devices/c/as_max5821.h | 29 +-
target/packages/as_devices/c/as_power_supply.c | 198 +++++-----
target/packages/as_devices/c/as_power_supply.h | 33 +-
target/packages/as_devices/c/as_pwm.c | 313 ++++++++--------
target/packages/as_devices/c/as_pwm.h | 20 +-
target/packages/as_devices/c/as_spi.c | 206 +++++-----
target/packages/as_devices/c/as_spi.h | 13 +-
31 files changed, 2249 insertions(+), 2216 deletions(-)
diff --git a/target/packages/as_devices/c/as_93lcxx.c b/target/packages/as_devices/c/as_93lcxx.c
index a1d17b9..69188fb 100644
--- a/target/packages/as_devices/c/as_93lcxx.c
+++ b/target/packages/as_devices/c/as_93lcxx.c
@@ -29,7 +29,7 @@
/* define start bits + opcode */
#define READ (6)
#define EWEN (4)
-#define EWEN_ADDR (3)
+#define EWEN_ADDR (3)
#define ERASE (7)
#define ERAL (4)
#define ERAL_ADDR (2)
@@ -48,9 +48,9 @@
//#define DEBUG
#ifdef DEBUG
-# define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
-# define ERROR(fmt, ...) /*fmt, ##__VA_ARGS__*/
+#define ERROR(fmt, ...) /*fmt, ##__VA_ARGS__ */
#endif
/** @brief Private functions to ease making spi instructions
@@ -58,262 +58,246 @@
*/
static uint8_t address_len(uint8_t aType, uint8_t aWord_size)
{
- switch (aType)
- {
- case 46:
- if (aWord_size == 16)
- return 6;
- else
- return 7;
- case 56:
- case 66:
- if (aWord_size == 16)
- return 8;
- else
- return 9;
- default:
- return 0;
- }
+ switch (aType) {
+ case 46:
+ if (aWord_size == 16)
+ return 6;
+ else
+ return 7;
+ case 56:
+ case 66:
+ if (aWord_size == 16)
+ return 8;
+ else
+ return 9;
+ default:
+ return 0;
+ }
}
/*------------------------------------------------------------------------------*/
-struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
- uint8_t aType,
- uint32_t aSpeed,
- uint8_t aWord_size)
+struct as_93lcxx_device *as_93lcxx_open(unsigned char *aSpidev_filename,
+ uint8_t aType,
+ uint32_t aSpeed, uint8_t aWord_size)
{
- int fd=-1;
- struct as_93lcxx_device *dev;
-
- /* open spidev bus */
- fd = as_spi_open(aSpidev_filename);
- if (fd < 0) {
- ERROR("Can't open spi device");
- return NULL;
- }
-
- /* verify datas */
- if (!( (aType == 46) || (aType == 56) || (aType == 66)))
- return NULL;
- if ((aWord_size < 1) || (aWord_size > 16))
- return NULL;
-
- dev = (struct as_93lcxx_device *)malloc(sizeof(struct as_93lcxx_device));
- if (dev == NULL) {
- ERROR("Can't allocate memory for eeprom structure device\n");
- return NULL;
- }
-
- /* fill in spidev structure */
- dev->spidev_filename = aSpidev_filename;
- dev->type = aType;
- dev->speed = aSpeed;
- dev->word_size = aWord_size;
- dev->fd = fd;
-
- return dev;
+ int fd;
+ struct as_93lcxx_device *dev;
+
+ /* open spidev bus */
+ fd = as_spi_open(aSpidev_filename);
+ if (fd < 0) {
+ ERROR("Can't open spi device");
+ return NULL;
+ }
+
+ /* verify datas */
+ if (!((aType == 46) || (aType == 56) || (aType == 66)))
+ return NULL;
+ if ((aWord_size < 1) || (aWord_size > 16))
+ return NULL;
+
+ dev =
+ (struct as_93lcxx_device *)malloc(sizeof(struct as_93lcxx_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for eeprom structure device\n");
+ return NULL;
+ }
+
+ /* fill in spidev structure */
+ dev->spidev_filename = aSpidev_filename;
+ dev->type = aType;
+ dev->speed = aSpeed;
+ dev->word_size = aWord_size;
+ dev->fd = fd;
+
+ return dev;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_read(struct as_93lcxx_device *aDev, uint16_t aAddress)
+int32_t as_93lcxx_read(struct as_93lcxx_device * aDev, uint16_t aAddress)
{
- uint32_t data_out,msg=0;
- int add_length;
-
- add_length = address_len(aDev->type, aDev->word_size);
-
- /* forge message */
- msg = ((READ << (add_length+ (aDev->word_size)))
- | (aAddress << (aDev->word_size)));
-
- data_out = as_spi_msg(aDev->fd, msg,
- 3 + add_length + aDev->word_size,
- aDev->speed);
- if (data_out < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
-
- if (aDev->word_size == 8)
- return data_out & 0xff;
- else
- return data_out & 0xffff;
+ uint32_t data_out, msg = 0;
+ int add_length;
+
+ add_length = address_len(aDev->type, aDev->word_size);
+
+ /* forge message */
+ msg = ((READ << (add_length + (aDev->word_size)))
+ | (aAddress << (aDev->word_size)));
+
+ data_out = as_spi_msg(aDev->fd, msg,
+ 3 + add_length + aDev->word_size, aDev->speed);
+ if (data_out < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
+
+ if (aDev->word_size == 8)
+ return data_out & 0xff;
+ else
+ return data_out & 0xffff;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_ewen(struct as_93lcxx_device *aDev)
+int32_t as_93lcxx_ewen(struct as_93lcxx_device * aDev)
{
- uint32_t msg=0;
- int add_length;
- int ret;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
- add_length = address_len(aDev->type, aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
- /* forge message */
- msg = ((EWEN << add_length) |(EWEN_ADDR << (add_length-2)));
+ /* forge message */
+ msg = ((EWEN << add_length) | (EWEN_ADDR << (add_length - 2)));
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
+ ret = as_spi_msg(aDev->fd, msg, 3 + add_length, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
- return 0;
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev, uint16_t aAddress)
+int32_t as_93lcxx_erase(struct as_93lcxx_device * aDev, uint16_t aAddress)
{
- uint32_t msg=0;
- int add_length;
- int ret;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
- add_length = address_len(aDev->type, aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
- /* forge message */
- msg = ((ERASE << (add_length + aDev->word_size))
- | (aAddress << (aDev->word_size)));
+ /* forge message */
+ msg = ((ERASE << (add_length + aDev->word_size))
+ | (aAddress << (aDev->word_size)));
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length + aDev->word_size,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
+ ret = as_spi_msg(aDev->fd, msg,
+ 3 + add_length + aDev->word_size, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
- usleep(TWC);
+ usleep(TWC);
- return 0;
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_erase_all(struct as_93lcxx_device *aDev)
+int32_t as_93lcxx_erase_all(struct as_93lcxx_device * aDev)
{
- uint32_t msg=0;
- int add_length;
- int ret;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
- add_length = address_len(aDev->type, aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
- /* forge message */
- msg = ((ERAL << add_length)
- |(ERAL_ADDR << (add_length-2))
- );
+ /* forge message */
+ msg = ((ERAL << add_length)
+ | (ERAL_ADDR << (add_length - 2))
+ );
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
+ ret = as_spi_msg(aDev->fd, msg, 3 + add_length, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
- /* wait for end of erase all */
- usleep(TEC);
+ /* wait for end of erase all */
+ usleep(TEC);
- return 0;
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
- uint16_t aAddress,
- uint16_t aValue)
+int32_t as_93lcxx_write(struct as_93lcxx_device * aDev,
+ uint16_t aAddress, uint16_t aValue)
{
- uint32_t msg=0;
- int add_length;
- int ret;
-
- add_length = address_len(aDev->type, aDev->word_size);
-
- /* forge message */
- msg = ((WRITE << (add_length+ (aDev->word_size)))
- | (aAddress << (aDev->word_size))
- | aValue
- );
-
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length + aDev->word_size,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
-
- /* Wait for end of writing */
- usleep(TWC);
-
- return 0;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
+
+ add_length = address_len(aDev->type, aDev->word_size);
+
+ /* forge message */
+ msg = ((WRITE << (add_length + (aDev->word_size)))
+ | (aAddress << (aDev->word_size))
+ | aValue);
+
+ ret = as_spi_msg(aDev->fd, msg,
+ 3 + add_length + aDev->word_size, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
+
+ /* Wait for end of writing */
+ usleep(TWC);
+
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
- uint16_t aValue)
+int32_t as_93lcxx_write_all(struct as_93lcxx_device * aDev, uint16_t aValue)
{
- uint32_t msg=0;
- int add_length;
- int ret;
-
- add_length = address_len(aDev->type, aDev->word_size);
-
- /* forge message */
- msg = ((WRAL << (add_length+ (aDev->word_size)))
- |(WRAL_ADDR << ((aDev->word_size) + (add_length-2)))
- |aValue
- );
-
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length + aDev->word_size,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
-
- /* Wait for end of write all */
- usleep(TWL);
-
- return 0;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
+
+ add_length = address_len(aDev->type, aDev->word_size);
+
+ /* forge message */
+ msg = ((WRAL << (add_length + (aDev->word_size)))
+ | (WRAL_ADDR << ((aDev->word_size) + (add_length - 2)))
+ | aValue);
+
+ ret = as_spi_msg(aDev->fd, msg,
+ 3 + add_length + aDev->word_size, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
+
+ /* Wait for end of write all */
+ usleep(TWL);
+
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev)
+int32_t as_93lcxx_ewds(struct as_93lcxx_device * aDev)
{
- uint32_t msg=0;
- int add_length;
- int ret;
+ uint32_t msg = 0;
+ int add_length;
+ int ret;
- add_length = address_len(aDev->type, aDev->word_size);
+ add_length = address_len(aDev->type, aDev->word_size);
- /* forge message */
- msg = ((EWDS << add_length) |(EWDS_ADDR << (add_length-2)));
+ /* forge message */
+ msg = ((EWDS << add_length) | (EWDS_ADDR << (add_length - 2)));
- ret = as_spi_msg(aDev->fd, msg,
- 3 + add_length,
- aDev->speed);
- if (ret < 0) {
- ERROR("Error on forging spi message\n");
- return -1;
- }
+ ret = as_spi_msg(aDev->fd, msg, 3 + add_length, aDev->speed);
+ if (ret < 0) {
+ ERROR("Error on forging spi message\n");
+ return -1;
+ }
- return 0;
+ return 0;
}
/*------------------------------------------------------------------------------*/
void as_93lcxx_close(struct as_93lcxx_device *aDev)
{
- as_spi_close(aDev->fd);
- free(aDev);
+ as_spi_close(aDev->fd);
+ free(aDev);
}
-
diff --git a/target/packages/as_devices/c/as_93lcxx.h b/target/packages/as_devices/c/as_93lcxx.h
index 84b87e0..caae3bc 100644
--- a/target/packages/as_devices/c/as_93lcxx.h
+++ b/target/packages/as_devices/c/as_93lcxx.h
@@ -18,11 +18,9 @@
*
*/
-
#ifndef AS_93LCXX_H_
#define AS_93LCXX_H_
-
/** @file
* @brief Provide standard commands to drive 93LCxx eeprom (from microchip)
*
@@ -42,12 +40,12 @@ extern "C" {
*
* @ingroup c_files
*/
-struct as_93lcxx_device {
- unsigned char *spidev_filename; /**< filename of the spidev /dev file */
- uint8_t type; /**< type of the eeprom : 46, 56 or 66 (see DS) */
- uint32_t speed; /**< SCLK speed, in Hz */
- uint8_t word_size; /**< word size for transaction, 8 or 16 */
- int fd; /**< File handler for spidev bus */
+struct as_93lcxx_device {
+ unsigned char *spidev_filename; /**< filename of the spidev /dev file */
+ uint8_t type; /**< type of the eeprom : 46, 56 or 66 (see DS) */
+ uint32_t speed; /**< SCLK speed, in Hz */
+ uint8_t word_size; /**< word size for transaction, 8 or 16 */
+ int fd; /**< File handler for spidev bus */
};
/** @brief open the device
@@ -59,10 +57,10 @@ struct as_93lcxx_device {
*
* @return as_93lcxx_device struct pointer on success, NULL on error
*/
-struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
- uint8_t aType,
- uint32_t aSpeed,
- uint8_t aWord_size);
+struct as_93lcxx_device *as_93lcxx_open(unsigned char *aSpidev_filename,
+ uint8_t aType,
+ uint32_t aSpeed,
+ uint8_t aWord_size);
/** @brief close the device
*
@@ -78,8 +76,8 @@ void as_93lcxx_close(struct as_93lcxx_device *aDev);
*
* @return positive register value on success, negative value on error.
*/
-int32_t as_93lcxx_read(struct as_93lcxx_device *aDev,
- uint16_t aAddress);
+int32_t as_93lcxx_read(struct as_93lcxx_device *aDev,
+ uint16_t aAddress);
/** @brief enable write on eeprom
*
@@ -96,8 +94,8 @@ int32_t as_93lcxx_ewen(struct as_93lcxx_device *aDev);
*
* @return positive register value on success, negative value on error.
*/
-int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev,
- uint16_t aAddress);
+int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev,
+ uint16_t aAddress);
/** @brief Force all bits in eeprom to 1
*
@@ -115,9 +113,8 @@ int32_t as_93lcxx_erase_all(struct as_93lcxx_device *aDev);
*
* @return positive register value on success, negative value on error.
*/
-int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
- uint16_t aAddress,
- uint16_t aValue);
+int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
+ uint16_t aAddress, uint16_t aValue);
/** @brief write the entire memory array with value given
*
@@ -126,8 +123,8 @@ int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
*
* @return positive register value on success, negative value on error.
*/
-int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
- uint16_t aValue);
+int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
+ uint16_t aValue);
/** @brief disable write on eeprom
*
@@ -137,9 +134,7 @@ int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
*/
int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev);
-
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* AS_93LCXX_H_ */
+#endif /* __cplusplus */
+#endif /* AS_93LCXX_H_ */
diff --git a/target/packages/as_devices/c/as_adc.h b/target/packages/as_devices/c/as_adc.h
index 4cab58a..e87f875 100644
--- a/target/packages/as_devices/c/as_adc.h
+++ b/target/packages/as_devices/c/as_adc.h
@@ -44,8 +44,8 @@ extern const char AS_IIO_NAME[];
*/
struct as_adc_device {
const char *device_type; /*!< device type: "as1531" or "max1027" */
- int device_num; /*!< device id on bus */
- int vref; /*!< reference voltage in millivolts */
+ int device_num; /*!< device id on bus */
+ int vref; /*!< reference voltage in millivolts */
void *chip_param; /*!< private data for chip handler */
};
@@ -80,5 +80,5 @@ int32_t as_adc_close(struct as_adc_device *adc);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-#endif /* __AS_ADC_H__ */
+#endif /* __cplusplus */
+#endif /* __AS_ADC_H__ */
diff --git a/target/packages/as_devices/c/as_adc_iio.c b/target/packages/as_devices/c/as_adc_iio.c
index 78966b3..b6d87e8 100644
--- a/target/packages/as_devices/c/as_adc_iio.c
+++ b/target/packages/as_devices/c/as_adc_iio.c
@@ -40,103 +40,106 @@
#define IIO_DEVICE_MAX_CHANNELS 32
struct as_adc_iio_device {
- int channelDesc[IIO_DEVICE_MAX_CHANNELS];
+ int channelDesc[IIO_DEVICE_MAX_CHANNELS];
};
static int open_channels(struct as_adc_iio_device *aDev, int aDeviceNum)
{
- char buffer[128];
- int i;
- int count;
-
- count = 0;
- for (i=0; i<IIO_DEVICE_MAX_CHANNELS; i++) {
- snprintf(buffer, sizeof(buffer),
- "/sys/bus/iio/devices/iio:device%d/in_voltage%d_raw",
- aDeviceNum, i);
- aDev->channelDesc[i] = open(buffer, O_RDONLY);
- if (aDev->channelDesc[i] >= 0) {
- count++;
- }
- }
- return count;
+ char buffer[128];
+ int i;
+ int count;
+
+ count = 0;
+ for (i = 0; i < IIO_DEVICE_MAX_CHANNELS; i++) {
+ snprintf(buffer, sizeof(buffer),
+ "/sys/bus/iio/devices/iio:device%d/in_voltage%d_raw",
+ aDeviceNum, i);
+ aDev->channelDesc[i] = open(buffer, O_RDONLY);
+ if (aDev->channelDesc[i] >= 0) {
+ count++;
+ }
+ }
+ return count;
}
static void close_channels(struct as_adc_iio_device *aDev)
{
- int i;
+ int i;
- for (i=0; i<IIO_DEVICE_MAX_CHANNELS; i++) {
- if (aDev->channelDesc[i] >= 0) {
- close(aDev->channelDesc[i]);
- }
- }
+ for (i = 0; i < IIO_DEVICE_MAX_CHANNELS; i++) {
+ if (aDev->channelDesc[i] >= 0) {
+ close(aDev->channelDesc[i]);
+ }
+ }
}
struct as_adc_device *as_adc_open_iio(int aDeviceNum, int aVRef)
{
- struct as_adc_device *adc_dev;
- struct as_adc_iio_device *dev;
-
- dev = (struct as_adc_iio_device *)malloc(sizeof(struct as_adc_iio_device));
- if (dev == NULL) {
- ERROR("Error during memory allocation\n");
- return NULL;
- }
-
- if (open_channels(dev, aDeviceNum) == 0) {
- ERROR("No in voltage channel found\n");
- goto err;
- }
-
- adc_dev = (struct as_adc_device *)malloc(sizeof(struct as_adc_device));
- if (dev == NULL) {
- close_channels(dev);
- ERROR("Error during memory allocation\n");
- goto err;
- }
-
- adc_dev->chip_param = (void*)dev;
- adc_dev->device_type = AS_IIO_NAME;
- adc_dev->device_num = aDeviceNum;
- adc_dev->vref = aVRef; /* NOT USED */
-
- return adc_dev;
+ struct as_adc_device *adc_dev;
+ struct as_adc_iio_device *dev;
+
+ dev = (struct as_adc_iio_device *)
+ malloc(sizeof(struct as_adc_iio_device));
+ if (dev == NULL) {
+ ERROR("Error during memory allocation\n");
+ return NULL;
+ }
+
+ if (open_channels(dev, aDeviceNum) == 0) {
+ ERROR("No in voltage channel found\n");
+ goto err;
+ }
+
+ adc_dev = (struct as_adc_device *)malloc(sizeof(struct as_adc_device));
+ if (dev == NULL) {
+ close_channels(dev);
+ ERROR("Error during memory allocation\n");
+ goto err;
+ }
+
+ adc_dev->chip_param = (void *)dev;
+ adc_dev->device_type = AS_IIO_NAME;
+ adc_dev->device_num = aDeviceNum;
+ adc_dev->vref = aVRef; /* NOT USED */
+
+ return adc_dev;
err:
- free(dev);
- return NULL;
+ free(dev);
+ return NULL;
}
-int32_t as_adc_get_value_in_millivolts_iio(struct as_adc_device *aDev, int aChannel) {
- struct as_adc_iio_device *dev;
- int32_t value;
- int32_t ret;
-
- dev = (struct as_adc_iio_device *)aDev->chip_param;
-
- if ((aChannel >= IIO_DEVICE_MAX_CHANNELS) || (aChannel < 0)) {
- ERROR("Wrong num channel\n");
- return -1;
- }
-
- if (dev->channelDesc[aChannel] != -1) {
- ret = as_read_int(dev->channelDesc[aChannel], &value);
- if (ret < 0) {
- ERROR("Can't read input file\n");
- return -1;
- }
- }
-
- return value;
+int32_t as_adc_get_value_in_millivolts_iio(struct as_adc_device * aDev,
+ int aChannel)
+{
+ struct as_adc_iio_device *dev;
+ int32_t value;
+ int32_t ret;
+
+ dev = (struct as_adc_iio_device *)aDev->chip_param;
+
+ if ((aChannel >= IIO_DEVICE_MAX_CHANNELS) || (aChannel < 0)) {
+ ERROR("Wrong num channel\n");
+ return -1;
+ }
+
+ if (dev->channelDesc[aChannel] != -1) {
+ ret = as_read_int(dev->channelDesc[aChannel], &value);
+ if (ret < 0) {
+ ERROR("Can't read input file\n");
+ return -1;
+ }
+ }
+
+ return value;
}
-int32_t as_adc_close_iio(struct as_adc_device *aDev) {
- struct as_adc_iio_device *dev =
- (struct as_adc_iio_device *)aDev->chip_param;
+int32_t as_adc_close_iio(struct as_adc_device * aDev)
+{
+ struct as_adc_iio_device *dev =
+ (struct as_adc_iio_device *)aDev->chip_param;
- close_channels(dev);
- free(dev);
- return 0;
+ close_channels(dev);
+ free(dev);
+ return 0;
}
-
diff --git a/target/packages/as_devices/c/as_adc_iio.h b/target/packages/as_devices/c/as_adc_iio.h
index 2ac2fa8..42f516e 100644
--- a/target/packages/as_devices/c/as_adc_iio.h
+++ b/target/packages/as_devices/c/as_adc_iio.h
@@ -46,7 +46,7 @@ struct as_adc_device *as_adc_open_iio(int dev_num, int vref);
* @param channel channel to sample
*/
int32_t as_adc_get_value_in_millivolts_iio(struct as_adc_device *adc,
- int channel);
+ int channel);
/** @brief Close ADC access
*
@@ -56,6 +56,5 @@ int32_t as_adc_close_iio(struct as_adc_device *adc);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* __AS_ADC_IIO_H__ */
+#endif /* __cplusplus */
+#endif /* __AS_ADC_IIO_H__ */
diff --git a/target/packages/as_devices/c/as_as1531.c b/target/packages/as_devices/c/as_as1531.c
index 8a83bf4..a673562 100644
--- a/target/packages/as_devices/c/as_as1531.c
+++ b/target/packages/as_devices/c/as_as1531.c
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h> /* for close() */
+#include <unistd.h> /* for close() */
#define AS_AS1531_MAX_VALUE 2500
#define BUFF_SIZE (300)
@@ -14,73 +14,76 @@
struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef)
{
- struct as_adc_device *dev;
- int ret;
- int fname;
- char buf[BUFF_SIZE];
+ struct as_adc_device *dev;
+ int ret;
+ int fname;
+ char buf[BUFF_SIZE];
- snprintf(buf, BUFF_SIZE, "/sys/class/hwmon/hwmon%d/device/name", aDeviceNum);
- fname = open(buf, O_RDONLY);
- if (fname < 0) {
- ERROR("Can't open file %s, is as1531 modprobed ?\n", buf);
- return NULL;
- }
+ snprintf(buf, BUFF_SIZE, "/sys/class/hwmon/hwmon%d/device/name",
+ aDeviceNum);
+ fname = open(buf, O_RDONLY);
+ if (fname < 0) {
+ ERROR("Can't open file %s, is as1531 modprobed ?\n", buf);
+ return NULL;
+ }
- ret = read(fname, buf, BUFF_SIZE);
- if (ret <= 0) {
- ERROR("Can't read name\n");
- return NULL;
- }
+ ret = read(fname, buf, BUFF_SIZE);
+ if (ret <= 0) {
+ ERROR("Can't read name\n");
+ return NULL;
+ }
- ret = strncmp(AS_AS1531_NAME, buf, strlen(AS_AS1531_NAME));
- if (ret != 0) {
- ERROR("Wrong driver name %s\n",buf);
- return NULL;
- }
+ ret = strncmp(AS_AS1531_NAME, buf, strlen(AS_AS1531_NAME));
+ if (ret != 0) {
+ ERROR("Wrong driver name %s\n", buf);
+ return NULL;
+ }
- close(fname);
+ close(fname);
- dev = malloc(sizeof(struct as_adc_device));
- if (dev == NULL) {
- ERROR("Can't allocate memory for as_adc structure\n");
- return NULL;
- }
+ dev = malloc(sizeof(struct as_adc_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for as_adc structure\n");
+ return NULL;
+ }
- dev->device_type = AS_AS1531_NAME;
- dev->device_num = aDeviceNum;
- dev->vref = aVRef;
- return dev;
+ dev->device_type = AS_AS1531_NAME;
+ dev->device_num = aDeviceNum;
+ dev->vref = aVRef;
+ return dev;
}
-int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel)
+int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device * aDev,
+ int aChannel)
{
- int ret;
- int finput;
- int value;
- char buf[BUFF_SIZE];
+ int ret;
+ int finput;
+ int value;
+ char buf[BUFF_SIZE];
- snprintf(buf, BUFF_SIZE,
- "/sys/class/hwmon/hwmon%d/device/in%d_input",
- aDev->device_num, aChannel);
- finput = open(buf, O_RDONLY);
- if (finput < 0) {
- ERROR("Can't open file %s.\n", buf);
- return -1;
- }
+ snprintf(buf, BUFF_SIZE,
+ "/sys/class/hwmon/hwmon%d/device/in%d_input",
+ aDev->device_num, aChannel);
+ finput = open(buf, O_RDONLY);
+ if (finput < 0) {
+ ERROR("Can't open file %s.\n", buf);
+ return -1;
+ }
- ret = as_read_int(finput, &value);
- if (ret < 0) {
- ERROR("Can't read value on channel %d\n", aChannel);
- return -1;
- }
- close(finput);
+ ret = as_read_int(finput, &value);
+ if (ret < 0) {
+ ERROR("Can't read value on channel %d\n", aChannel);
+ return -1;
+ }
+ close(finput);
- if (AS_AS1531_MAX_VALUE == aDev->vref) return value;
+ if (AS_AS1531_MAX_VALUE == aDev->vref)
+ return value;
- return (value*aDev->vref)/AS_AS1531_MAX_VALUE;
+ return (value * aDev->vref) / AS_AS1531_MAX_VALUE;
}
-int32_t as_adc_close_as1531(struct as_adc_device *aDev)
+int32_t as_adc_close_as1531(struct as_adc_device * aDev)
{
- return 0;
+ return 0;
}
diff --git a/target/packages/as_devices/c/as_as1531.h b/target/packages/as_devices/c/as_as1531.h
index e818b41..743f8dc 100644
--- a/target/packages/as_devices/c/as_as1531.h
+++ b/target/packages/as_devices/c/as_as1531.h
@@ -30,17 +30,18 @@
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
#include "as_adc.h"
struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef);
-int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel);
+int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device
+ *aDev, int aChannel);
int32_t as_adc_close_as1531(struct as_adc_device *aDev);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-#endif /* __ASAS1531_H__ */
+#endif /* __cplusplus */
+#endif /* __ASAS1531_H__ */
diff --git a/target/packages/as_devices/c/as_backlight.c b/target/packages/as_devices/c/as_backlight.c
index 3eaf036..5216002 100644
--- a/target/packages/as_devices/c/as_backlight.c
+++ b/target/packages/as_devices/c/as_backlight.c
@@ -22,15 +22,14 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h> /* for open() */
-#include <unistd.h> /* for write() */
+#include <fcntl.h> /* for open() */
+#include <unistd.h> /* for write() */
#include <limits.h>
#define DEBUG
#include "as_helpers.h"
#include "as_backlight.h"
-
#define BACKLIGHT_SYS_PATH "/sys/class/backlight"
#define BACKLIGHT_DEFAULT "imx-bl"
#define ACTUAL_BRIGHTNESS_PATH "actual_brightness"
@@ -41,133 +40,137 @@
struct as_backlight_device *as_backlight_open2(char *aBacklightName)
{
- char buffer[PATH_MAX];
- struct as_backlight_device *dev;
- char *fake_root;
-
- fake_root = as_helpers_get_root();
-
- if (aBacklightName == NULL) {
- aBacklightName = BACKLIGHT_DEFAULT;
- }
-
- dev = (struct as_backlight_device *)malloc(sizeof(struct as_backlight_device));
- if (dev == NULL) {
- ERROR("Can't allocate memory for backlight device structure\n");
- return NULL;
- }
-
- /* open backlight management files */
- snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root, BACKLIGHT_SYS_PATH,
- aBacklightName, ACTUAL_BRIGHTNESS_PATH);
- if ((dev->fileActualBrightness = open(buffer, O_RDONLY)) < 0) {
- ERROR("Can't open %s file\n", buffer);
- return NULL;
- }
- snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root, BACKLIGHT_SYS_PATH,
- aBacklightName, MAX_BRIGHTNESS_PATH);
- if ((dev->fileMaxBrightness = open(buffer, O_RDONLY)) < 0) {
- ERROR("Can't open %s file\n", buffer);
- return NULL;
- }
- snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root, BACKLIGHT_SYS_PATH,
- aBacklightName, BRIGHTNESS_PATH);
- if((dev->fileBrightness = open(buffer, O_RDWR)) < 0) {
- ERROR("Can't open %s file\n", buffer);
- return NULL;
- }
-
- return dev;
+ char buffer[PATH_MAX];
+ struct as_backlight_device *dev;
+ char *fake_root;
+
+ fake_root = as_helpers_get_root();
+
+ if (aBacklightName == NULL) {
+ aBacklightName = BACKLIGHT_DEFAULT;
+ }
+
+ dev =
+ (struct as_backlight_device *)
+ malloc(sizeof(struct as_backlight_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for backlight device structure\n");
+ return NULL;
+ }
+
+ /* open backlight management files */
+ snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root,
+ BACKLIGHT_SYS_PATH, aBacklightName, ACTUAL_BRIGHTNESS_PATH);
+ if ((dev->fileActualBrightness = open(buffer, O_RDONLY)) < 0) {
+ ERROR("Can't open %s file\n", buffer);
+ return NULL;
+ }
+ snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root,
+ BACKLIGHT_SYS_PATH, aBacklightName, MAX_BRIGHTNESS_PATH);
+ if ((dev->fileMaxBrightness = open(buffer, O_RDONLY)) < 0) {
+ ERROR("Can't open %s file\n", buffer);
+ return NULL;
+ }
+ snprintf(buffer, sizeof(buffer), "%s%s/%s/%s", fake_root,
+ BACKLIGHT_SYS_PATH, aBacklightName, BRIGHTNESS_PATH);
+ if ((dev->fileBrightness = open(buffer, O_RDWR)) < 0) {
+ ERROR("Can't open %s file\n", buffer);
+ return NULL;
+ }
+
+ return dev;
}
struct as_backlight_device *as_backlight_open()
{
- return as_backlight_open2(NULL);
+ return as_backlight_open2(NULL);
}
/*------------------------------------------------------------------------------*/
-int32_t as_backlight_get_actual_brightness(struct as_backlight_device *aDev)
+int32_t as_backlight_get_actual_brightness(struct as_backlight_device * aDev)
{
- char buffer[32];
- int ret;
-
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
-
- ret = as_read_buffer(aDev->fileActualBrightness, buffer, sizeof(buffer));
- if (ret < 0) {
- ERROR("Can't read actual brightness");
- return ret;
- }
-
- return atoi(buffer);
+ char buffer[32];
+ int ret;
+
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ ret =
+ as_read_buffer(aDev->fileActualBrightness, buffer, sizeof(buffer));
+ if (ret < 0) {
+ ERROR("Can't read actual brightness");
+ return ret;
+ }
+
+ return atoi(buffer);
}
/*------------------------------------------------------------------------------*/
-int32_t as_backlight_get_max_brightness(struct as_backlight_device *aDev)
+int32_t as_backlight_get_max_brightness(struct as_backlight_device * aDev)
{
- char buffer[32];
- int ret;
+ char buffer[32];
+ int ret;
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
- ret = as_read_buffer(aDev->fileMaxBrightness, buffer, sizeof(buffer));
- if (ret < 0) {
- ERROR("Can't read max brightness");
- return ret;
- }
+ ret = as_read_buffer(aDev->fileMaxBrightness, buffer, sizeof(buffer));
+ if (ret < 0) {
+ ERROR("Can't read max brightness");
+ return ret;
+ }
- return atoi(buffer);
+ return atoi(buffer);
}
/*------------------------------------------------------------------------------*/
-int32_t as_backlight_set_brightness(struct as_backlight_device *aDev, int aBrightness)
+int32_t as_backlight_set_brightness(struct as_backlight_device * aDev,
+ int aBrightness)
{
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
- return as_write_buffer(aDev->fileBrightness, aBrightness);
+ return as_write_buffer(aDev->fileBrightness, aBrightness);
}
/*------------------------------------------------------------------------------*/
-int32_t as_backlight_close(struct as_backlight_device *aDev)
+int32_t as_backlight_close(struct as_backlight_device * aDev)
{
- int ret = 0;
-
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
-
- /* Close backlight management files */
- ret = close(aDev->fileActualBrightness);
- if (ret < 0) {
- ERROR("Can't close /actual_brightness");
- return ret;
- }
- ret = close(aDev->fileMaxBrightness);
- if (ret < 0) {
- ERROR("Can't close /max_brightness");
- return ret;
- }
- ret = close(aDev->fileBrightness);
- if (ret < 0) {
- ERROR("Can't close /brightness");
- return ret;
- }
-
- free(aDev);
-
- return ret;
+ int ret = 0;
+
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ /* Close backlight management files */
+ ret = close(aDev->fileActualBrightness);
+ if (ret < 0) {
+ ERROR("Can't close /actual_brightness");
+ return ret;
+ }
+ ret = close(aDev->fileMaxBrightness);
+ if (ret < 0) {
+ ERROR("Can't close /max_brightness");
+ return ret;
+ }
+ ret = close(aDev->fileBrightness);
+ if (ret < 0) {
+ ERROR("Can't close /brightness");
+ return ret;
+ }
+
+ free(aDev);
+
+ return ret;
}
diff --git a/target/packages/as_devices/c/as_backlight.h b/target/packages/as_devices/c/as_backlight.h
index bf4c3dc..89fa693 100644
--- a/target/packages/as_devices/c/as_backlight.h
+++ b/target/packages/as_devices/c/as_backlight.h
@@ -30,7 +30,7 @@
#ifdef __cplusplus
extern "C" {
-#endif // __cplusplus
+#endif /* __cplusplus */
#include <stdint.h>
@@ -39,9 +39,9 @@ extern "C" {
* @ingroup c_files
*/
struct as_backlight_device {
- int fileActualBrightness; /*!< file descriptor to get current brightness */
- int fileMaxBrightness; /*!< file descriptor to get maximum brightness */
- int fileBrightness; /*!< file descriptor to set brightness */
+ int fileActualBrightness; /*!< file descriptor to get current brightness */
+ int fileMaxBrightness; /*!< file descriptor to get maximum brightness */
+ int fileBrightness; /*!< file descriptor to set brightness */
};
/** @brief Open Backlight device
@@ -64,7 +64,8 @@ struct as_backlight_device *as_backlight_open();
*
* @return actual brightness value, negative value on error
*/
-int32_t as_backlight_get_actual_brightness(struct as_backlight_device *aDev);
+int32_t as_backlight_get_actual_brightness(struct as_backlight_device
+ *aDev);
/** @brief Get maximum brightness
*
@@ -72,7 +73,8 @@ int32_t as_backlight_get_actual_brightness(struct as_backlight_device *aDev);
*
* @return maximum allowed brightness, negative value on error
*/
-int32_t as_backlight_get_max_brightness(struct as_backlight_device *aDev);
+int32_t as_backlight_get_max_brightness(struct as_backlight_device
+ *aDev);
/** @brief Set brightness
*
@@ -81,7 +83,8 @@ int32_t as_backlight_get_max_brightness(struct as_backlight_device *aDev);
*
* @return negative value on error
*/
-int32_t as_backlight_set_brightness(struct as_backlight_device *aDev, int aBrightness);
+int32_t as_backlight_set_brightness(struct as_backlight_device *aDev,
+ int aBrightness);
/** @brief Close backlight device
*
@@ -93,6 +96,5 @@ int32_t as_backlight_close(struct as_backlight_device *aDev);
#ifdef __cplusplus
}
-#endif // __cplusplus
-
-#endif /* __ASBACKLIGHT_H__ */
+#endif /* __cplusplus */
+#endif /* __ASBACKLIGHT_H__ */
diff --git a/target/packages/as_devices/c/as_dac.c b/target/packages/as_devices/c/as_dac.c
index a9a71c2..e24f798 100644
--- a/target/packages/as_devices/c/as_dac.c
+++ b/target/packages/as_devices/c/as_dac.c
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h> /* close() */
+#include <unistd.h> /* close() */
#include <string.h>
#include "as_dac.h"
diff --git a/target/packages/as_devices/c/as_dac.h b/target/packages/as_devices/c/as_dac.h
index 4dad9a4..e99c1bf 100644
--- a/target/packages/as_devices/c/as_dac.h
+++ b/target/packages/as_devices/c/as_dac.h
@@ -45,7 +45,7 @@ struct as_dac_device {
int bus_number; /*!< bus number */
int chip_address; /*!< chip address on bus */
int vref; /*!< reference voltage */
- const char *device_type; /*!< device type: "max5821" or "mcp4912" */
+ const char *device_type;/*!< device type: "max5821" or "mcp4912" */
void *chip_param; /*!< private data for chip handler */
};
diff --git a/target/packages/as_devices/c/as_gpio.c b/target/packages/as_devices/c/as_gpio.c
index adea8a0..11eddcd 100644
--- a/target/packages/as_devices/c/as_gpio.c
+++ b/target/packages/as_devices/c/as_gpio.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h> /* for close() */
+#include <unistd.h> /* for close() */
#include <sys/select.h>
#include <poll.h>
#include <errno.h>
@@ -41,295 +41,299 @@
struct as_gpio_device *as_gpio_open(int aGpioNum)
{
- struct as_gpio_device *dev;
- int pin_file;
- int export_file;
- int retval;
- char buf[BUFF_SIZE];
-
- export_file = open("/sys/class/gpio/export", O_WRONLY);
- if (export_file < 0) {
- ERROR("Can't open /sys/class/gpio/export\nBe sure that gpiolib is under your kernel\n");
- return NULL;
- }
-
- retval = as_write_buffer(export_file, aGpioNum);
- if (retval < 0) {
- ERROR("/sys/class/gpio/export can't be written\n");
- close(export_file);
- return NULL;
- }
- close(export_file);
-
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aGpioNum);
- pin_file = open(buf, O_RDWR);
- if (pin_file < 0) {
- ERROR("Can't export gpio number %d\n", aGpioNum);
- return NULL;
- }
- close(pin_file);
-
- dev = malloc(sizeof(struct as_gpio_device));
- if (dev == NULL) {
- ERROR("Can't allocate as_gpio_device structure\n");
- return NULL;
- }
-
- dev->port_num = aGpioNum;
-
- return dev;
+ struct as_gpio_device *dev;
+ int pin_file;
+ int export_file;
+ int retval;
+ char buf[BUFF_SIZE];
+
+ export_file = open("/sys/class/gpio/export", O_WRONLY);
+ if (export_file < 0) {
+ ERROR
+ ("Can't open /sys/class/gpio/export\nBe sure that gpiolib is under your kernel\n");
+ return NULL;
+ }
+
+ retval = as_write_buffer(export_file, aGpioNum);
+ if (retval < 0) {
+ ERROR("/sys/class/gpio/export can't be written\n");
+ close(export_file);
+ return NULL;
+ }
+ close(export_file);
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aGpioNum);
+ pin_file = open(buf, O_RDWR);
+ if (pin_file < 0) {
+ ERROR("Can't export gpio number %d\n", aGpioNum);
+ return NULL;
+ }
+ close(pin_file);
+
+ dev = malloc(sizeof(struct as_gpio_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate as_gpio_device structure\n");
+ return NULL;
+ }
+
+ dev->port_num = aGpioNum;
+
+ return dev;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_direction(struct as_gpio_device *aDev, char *direction)
+int32_t as_gpio_set_pin_direction(struct as_gpio_device * aDev, char *direction)
{
- char buf[BUFF_SIZE];
- int gpio_fd;
- int ret = 0;
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -EINVAL;
- }
-
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", aDev->port_num);
- gpio_fd = open(buf, O_WRONLY);
- if (gpio_fd < 0) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
- return -EINVAL;
- }
-
- ret = as_write_buffer_string(gpio_fd, direction);
- if (ret < 0)
- ERROR("Error writing direction\n");
-
- close(gpio_fd);
-
- return ret;
+ char buf[BUFF_SIZE];
+ int gpio_fd;
+ int ret = 0;
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction",
+ aDev->port_num);
+ gpio_fd = open(buf, O_WRONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d direction\n", aDev->port_num);
+ return -EINVAL;
+ }
+
+ ret = as_write_buffer_string(gpio_fd, direction);
+ if (ret < 0)
+ ERROR("Error writing direction\n");
+
+ close(gpio_fd);
+
+ return ret;
}
/*------------------------------------------------------------------------------*/
-const char* as_gpio_get_pin_direction(struct as_gpio_device *aDev)
+const char *as_gpio_get_pin_direction(struct as_gpio_device *aDev)
{
- char buf[BUFF_SIZE];
- static char direction[4];
- FILE *gpio_file;
- int ret = 0;
- static const char none[] = "??";
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return NULL;
- }
-
- snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/direction",
- aDev->port_num);
- gpio_file = fopen(buf, "r");
- if (!gpio_file) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
- return none;
- }
- ret = fscanf(gpio_file, "%s", direction);
- fclose(gpio_file);
- if (ret < 0) {
- ERROR("Can't get gpio%d direction\n", aDev->port_num);
- return none;
- }
-
- return direction;
+ char buf[BUFF_SIZE];
+ static char direction[4];
+ FILE *gpio_file;
+ int ret = 0;
+ static const char none[] = "??";
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return NULL;
+ }
+
+ snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/direction",
+ aDev->port_num);
+ gpio_file = fopen(buf, "r");
+ if (!gpio_file) {
+ ERROR("Can't open gpio%d direction\n", aDev->port_num);
+ return none;
+ }
+ ret = fscanf(gpio_file, "%s", direction);
+ fclose(gpio_file);
+ if (ret < 0) {
+ ERROR("Can't get gpio%d direction\n", aDev->port_num);
+ return none;
+ }
+
+ return direction;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev, int aValue)
+int32_t as_gpio_set_pin_value(struct as_gpio_device * aDev, int aValue)
{
- char buf[BUFF_SIZE];
- int pin_file;
- int retval;
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -1;
- }
-
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aDev->port_num);
- pin_file = open(buf, O_WRONLY);
- if (pin_file < 0) {
- ERROR("Can't open gpio%d direction\n", aDev->port_num);
- return -1;
- }
-
- retval = as_write_buffer(pin_file, aValue);
- if (retval < 0) {
- ERROR("Can't write value\n");
- close(pin_file);
- return -1;
- }
- close(pin_file);
-
- return aValue;
+ char buf[BUFF_SIZE];
+ int pin_file;
+ int retval;
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
+ aDev->port_num);
+ pin_file = open(buf, O_WRONLY);
+ if (pin_file < 0) {
+ ERROR("Can't open gpio%d direction\n", aDev->port_num);
+ return -1;
+ }
+
+ retval = as_write_buffer(pin_file, aValue);
+ if (retval < 0) {
+ ERROR("Can't write value\n");
+ close(pin_file);
+ return -1;
+ }
+ close(pin_file);
+
+ return aValue;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev)
+int32_t as_gpio_get_pin_value(struct as_gpio_device * aDev)
{
- char buf[BUFF_SIZE];
- int pin_file;
- int retval;
- int value;
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -1;
- }
-
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aDev->port_num);
- pin_file = open(buf, O_RDONLY);
- if (pin_file < 0) {
- ERROR("Can't open gpio%d value\n", aDev->port_num);
- return -1;
- }
-
- retval = as_read_int(pin_file, &value);
- if (retval < 0) {
- ERROR("Can't read value\n");
- close(pin_file);
- return -1;
- }
- close(pin_file);
-
- return value;
+ char buf[BUFF_SIZE];
+ int pin_file;
+ int retval;
+ int value;
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
+ aDev->port_num);
+ pin_file = open(buf, O_RDONLY);
+ if (pin_file < 0) {
+ ERROR("Can't open gpio%d value\n", aDev->port_num);
+ return -1;
+ }
+
+ retval = as_read_int(pin_file, &value);
+ if (retval < 0) {
+ ERROR("Can't read value\n");
+ close(pin_file);
+ return -1;
+ }
+ close(pin_file);
+
+ return value;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_wait_event(struct as_gpio_device *aDev, int delay_ms)
+int32_t as_gpio_wait_event(struct as_gpio_device * aDev, int delay_ms)
{
- char gpio_sys_name[BUFF_SIZE];
- int gpio_fd;
- struct pollfd poll_set[1];
- int ret;
- char tmp[16];
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -EINVAL;
- }
-
- snprintf(gpio_sys_name, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
- aDev->port_num);
- gpio_fd = open(gpio_sys_name, O_RDONLY);
- if (gpio_fd < 0) {
- ERROR("Can't open gpio%d value\n", aDev->port_num);
- return -EINVAL;
- }
-
- /* flush pending event */
- read(gpio_fd, tmp, sizeof(tmp));
-
- poll_set[0].fd = gpio_fd;
- poll_set[0].events = POLLPRI;
- poll_set[0].revents = 0;
- ret = poll(poll_set, 1, delay_ms);
- if (ret > 0) {
- ret = read(gpio_fd, tmp, sizeof(tmp));
- close(gpio_fd);
- return ret;
- } else if (ret < 0) {
- ERROR("poll()");
- close(gpio_fd);
- return ret;
- }
-
- /* if ret=0 it's a timeout */
- close(gpio_fd);
- return -ETIMEDOUT;
+ char gpio_sys_name[BUFF_SIZE];
+ int gpio_fd;
+ struct pollfd poll_set[1];
+ int ret;
+ char tmp[16];
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
+
+ snprintf(gpio_sys_name, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
+ aDev->port_num);
+ gpio_fd = open(gpio_sys_name, O_RDONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d value\n", aDev->port_num);
+ return -EINVAL;
+ }
+
+ /* flush pending event */
+ read(gpio_fd, tmp, sizeof(tmp));
+
+ poll_set[0].fd = gpio_fd;
+ poll_set[0].events = POLLPRI;
+ poll_set[0].revents = 0;
+ ret = poll(poll_set, 1, delay_ms);
+ if (ret > 0) {
+ ret = read(gpio_fd, tmp, sizeof(tmp));
+ close(gpio_fd);
+ return ret;
+ } else if (ret < 0) {
+ ERROR("poll()");
+ close(gpio_fd);
+ return ret;
+ }
+
+ /* if ret=0 it's a timeout */
+ close(gpio_fd);
+ return -ETIMEDOUT;
}
/*------------------------------------------------------------------------------*/
-const char* as_gpio_get_irq_mode(struct as_gpio_device *aDev)
+const char *as_gpio_get_irq_mode(struct as_gpio_device *aDev)
{
- char buf[BUFF_SIZE];
- static char mode[8];
- FILE *gpio_file;
- int ret = 0;
- static const char unknown[] = "??";
-
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return unknown;
- }
-
- snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/edge", aDev->port_num);
- gpio_file = fopen(buf, "r");
- if (!gpio_file) {
- ERROR("Can't open gpio%d edge\n", aDev->port_num);
- return unknown;
- }
- ret = fscanf(gpio_file, "%s", mode);
- fclose(gpio_file);
- if (ret < 0) {
- ERROR("Can't get gpio%d edge\n", aDev->port_num);
- return unknown;
- }
-
- return mode;
+ char buf[BUFF_SIZE];
+ static char mode[8];
+ FILE *gpio_file;
+ int ret = 0;
+ static const char unknown[] = "??";
+
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return unknown;
+ }
+
+ snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/edge",
+ aDev->port_num);
+ gpio_file = fopen(buf, "r");
+ if (!gpio_file) {
+ ERROR("Can't open gpio%d edge\n", aDev->port_num);
+ return unknown;
+ }
+ ret = fscanf(gpio_file, "%s", mode);
+ fclose(gpio_file);
+ if (ret < 0) {
+ ERROR("Can't get gpio%d edge\n", aDev->port_num);
+ return unknown;
+ }
+
+ return mode;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_irq_mode(struct as_gpio_device *aDev, char *mode)
+int32_t as_gpio_set_irq_mode(struct as_gpio_device * aDev, char *mode)
{
- char buf[BUFF_SIZE];
- int gpio_fd;
- int ret = 0;
+ char buf[BUFF_SIZE];
+ int gpio_fd;
+ int ret = 0;
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -EINVAL;
- }
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/edge", aDev->port_num);
- gpio_fd = open(buf, O_WRONLY);
- if (gpio_fd < 0) {
- ERROR("Can't open gpio%d edge\n", aDev->port_num);
- return -EINVAL;
- }
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/edge", aDev->port_num);
+ gpio_fd = open(buf, O_WRONLY);
+ if (gpio_fd < 0) {
+ ERROR("Can't open gpio%d edge\n", aDev->port_num);
+ return -EINVAL;
+ }
- ret = as_write_buffer_string(gpio_fd, mode);
- if (ret < 0)
- ERROR("Error writing mode\n");
+ ret = as_write_buffer_string(gpio_fd, mode);
+ if (ret < 0)
+ ERROR("Error writing mode\n");
- close(gpio_fd);
+ close(gpio_fd);
- return ret;
+ return ret;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_pin_num(struct as_gpio_device *aDev)
+int32_t as_gpio_get_pin_num(struct as_gpio_device * aDev)
{
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -1;
- }
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -1;
+ }
- return aDev->port_num;
+ return aDev->port_num;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_close(struct as_gpio_device *aDev)
+int32_t as_gpio_close(struct as_gpio_device * aDev)
{
- if(aDev == NULL){
- ERROR("device is NULL\n");
- return -1;
- }
+ if (aDev == NULL) {
+ ERROR("device is NULL\n");
+ return -1;
+ }
- return 0;
+ return 0;
}
-
diff --git a/target/packages/as_devices/c/as_gpio.h b/target/packages/as_devices/c/as_gpio.h
index a6a5d4f..594fb2b 100644
--- a/target/packages/as_devices/c/as_gpio.h
+++ b/target/packages/as_devices/c/as_gpio.h
@@ -32,7 +32,7 @@
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
#define GPIO_IRQ_MODE_NOINT "none"
#define GPIO_IRQ_MODE_RISING "rising"
@@ -47,10 +47,10 @@ extern "C" {
* @ingroup c_files
*/
struct as_gpio_device {
- int port_num;
- int pin_number;
- int fpin; /* pin file for 2.6.29 interface*/
- int irq_mode;
+ int port_num;
+ int pin_number;
+ int fpin; /* pin file for 2.6.29 interface */
+ int irq_mode;
};
/** @brief Initialize port access
@@ -69,7 +69,7 @@ struct as_gpio_device *as_gpio_open(int aGpioNum);
* @return error if negative value
*/
int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev,
- char *direction);
+ char *direction);
/** @brief Get pin direction
*
@@ -77,7 +77,7 @@ int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev,
*
* @return error if negative value
*/
-const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev);
+const char *as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev);
/** @brief Set pin value
*
@@ -86,8 +86,7 @@ const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev);
*
* @return error if negative
*/
-int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev,
- int aValue);
+int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev, int aValue);
/** @brief Get pin value
*
@@ -115,7 +114,8 @@ int32_t as_gpio_wait_event(struct as_gpio_device *aDev, int aDelay_ms);
*
* @return error if negative
*/
-int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode);
+int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev,
+ char *mode);
/** @brief Get pin irq mode value
*
@@ -123,7 +123,7 @@ int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode);
*
* @return pin triggering mode: (rising/falling/both/none)
*/
-const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev);
+const char *as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev);
/** @brief Get pin number value
*
@@ -143,6 +143,5 @@ int32_t as_gpio_close(struct as_gpio_device *aDev);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* __ASGPIO_H__ */
+#endif /* __cplusplus */
+#endif /* __ASGPIO_H__ */
diff --git a/target/packages/as_devices/c/as_gpio_2_6_29.c b/target/packages/as_devices/c/as_gpio_2_6_29.c
index 3c1702a..56bf379 100644
--- a/target/packages/as_devices/c/as_gpio_2_6_29.c
+++ b/target/packages/as_devices/c/as_gpio_2_6_29.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h> /* for close() */
+#include <unistd.h> /* for close() */
#include <sys/select.h>
#include <sys/ioctl.h>
@@ -50,7 +50,6 @@
#define GPIORDIRQMODE _IOR(PP_IOCTL, 0xF8, int)
#define GPIOWRIRQMODE _IOW(PP_IOCTL, 0xF9, int)
-
#define GPIO_BASE_PIN ("/dev/gpio/P")
#define BUFF_SIZE (300)
@@ -59,234 +58,233 @@
struct as_gpio_device *as_gpio_open(int aGpioNum)
{
- char aPortChar;
- int aPinNum;
-
- struct as_gpio_device *dev;
- char gpio_file_path[50];
- int ret = 0;
- int file;
- int value;
-
- aPortChar = (aGpioNum/32) + 'A';
- aPinNum = aGpioNum - (aPortChar-'A');
-
- /* make gpio port string path */
- ret = snprintf(gpio_file_path,50, "%s%c%d",
- GPIO_BASE_PIN, aPortChar, aPinNum);
- if (ret < 0) {
- ERROR("Can't forge gpio pin port path\n");
- goto path_error;
- }
-
- /* opening gpio port */
- file = open(gpio_file_path, O_RDWR);
- if (file < 0) {
- ERROR("Can't open file pin port\n");
- goto open_file_error;
- }
-
- dev = (struct as_gpio_device *)malloc(sizeof(struct as_gpio_device));
- if (dev == NULL) {
- ERROR("Can't allocate memory for gpio device structure\n");
- goto malloc_error;
- }
-
- dev->port_letter = aPortChar;
- dev->fpin = file;
- dev->pin_number = aPinNum;
-
- value = 1;
- ret = ioctl(dev->fpin, GPIOWRMODE, &value); /* set pin on gpio mode */
- if (ret < 0) {
- ERROR("can't set pin in gpio mode.\n");
- goto mode_error;
- }
-
- return dev;
+ char aPortChar;
+ int aPinNum;
+
+ struct as_gpio_device *dev;
+ char gpio_file_path[50];
+ int ret = 0;
+ int file;
+ int value;
+
+ aPortChar = (aGpioNum / 32) + 'A';
+ aPinNum = aGpioNum - (aPortChar - 'A');
+
+ /* make gpio port string path */
+ ret = snprintf(gpio_file_path, 50, "%s%c%d",
+ GPIO_BASE_PIN, aPortChar, aPinNum);
+ if (ret < 0) {
+ ERROR("Can't forge gpio pin port path\n");
+ goto path_error;
+ }
+
+ /* opening gpio port */
+ file = open(gpio_file_path, O_RDWR);
+ if (file < 0) {
+ ERROR("Can't open file pin port\n");
+ goto open_file_error;
+ }
+
+ dev = (struct as_gpio_device *)malloc(sizeof(struct as_gpio_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for gpio device structure\n");
+ goto malloc_error;
+ }
+
+ dev->port_letter = aPortChar;
+ dev->fpin = file;
+ dev->pin_number = aPinNum;
+
+ value = 1;
+ ret = ioctl(dev->fpin, GPIOWRMODE, &value); /* set pin on gpio mode */
+ if (ret < 0) {
+ ERROR("can't set pin in gpio mode.\n");
+ goto mode_error;
+ }
+
+ return dev;
mode_error:
- free(dev);
+ free(dev);
malloc_error:
- close(file);
+ close(file);
open_file_error:
path_error:
- return NULL;
+ return NULL;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_direction(struct as_gpio_device *aDev, int aDirection)
+int32_t as_gpio_set_pin_direction(struct as_gpio_device * aDev, int aDirection)
{
- int ret = 0;
- int portval;
+ int ret = 0;
+ int portval;
- portval = (aDirection != 0) ? 1 : 0;
+ portval = (aDirection != 0) ? 1 : 0;
- ret = ioctl(aDev->fpin, GPIOWRDIRECTION, &portval);
- if (ret < 0) {
- ERROR("Can't set gpio direction\n");
- return ret;
- }
- return 0;
+ ret = ioctl(aDev->fpin, GPIOWRDIRECTION, &portval);
+ if (ret < 0) {
+ ERROR("Can't set gpio direction\n");
+ return ret;
+ }
+ return 0;
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_get_pin_direction(struct as_gpio_device *aDev)
+int32_t as_gpio_get_pin_direction(struct as_gpio_device * aDev)
{
- int ret = 0;
- int portval;
-
- ret = ioctl(aDev->fpin, GPIORDDIRECTION, &portval);
- if (ret < 0) {
- ERROR("Can't get gpio direction\n");
- return ret;
- }
- return ((portval !=0) ? 1 : 0);
+ int ret = 0;
+ int portval;
+
+ ret = ioctl(aDev->fpin, GPIORDDIRECTION, &portval);
+ if (ret < 0) {
+ ERROR("Can't get gpio direction\n");
+ return ret;
+ }
+ return ((portval != 0) ? 1 : 0);
}
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev, int aValue)
+int32_t as_gpio_set_pin_value(struct a...
[truncated message content] |
|
From: jscheer <js...@us...> - 2014-06-25 08:42:42
|
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 7b32b10cf1143a8e8ff8570432369823f521fcc2 (commit)
from 97d5c7acdc7fa39277ce9086f73dd17b00b58280 (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 7b32b10cf1143a8e8ff8570432369823f521fcc2
Author: Jeremie Scheer <jer...@ar...>
Date: Wed Jun 25 10:42:16 2014 +0200
[AS_DEVICES] Doxygen modules description in English.
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/DoxyDefines.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/packages/as_devices/DoxyDefines.h b/target/packages/as_devices/DoxyDefines.h
index 6fa011d..1d96cc7 100644
--- a/target/packages/as_devices/DoxyDefines.h
+++ b/target/packages/as_devices/DoxyDefines.h
@@ -1,23 +1,23 @@
/*! \mainpage
*
- * Cette librairie contient les fonctions et wrappers nécessaires à l'utilisation et
- * au fonctionnement des différents devices systèmes.
+ * This library contains functions and wrappers necessary to use different
+ * system devices.
*
*/
/*!
- * \defgroup c_files C: Fonctions utilitaires en C pour les devices systèmes.
+ * \defgroup c_files C: Utility functions in C for system devices
*
*/
/*!
- * \defgroup cpp_wrappers C++: Wrappers C++ des fonctions utilitaires C
+ * \defgroup cpp_wrappers C++: C++ wrappers of C utility functions
*
*/
/*!
- * \defgroup python_wrappers PYTHON: Wrappers Python des fonctions utilitaires C
+ * \defgroup python_wrappers PYTHON: Python wrapppers of C utility functions
*
*/
hooks/post-receive
--
armadeus
|
|
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] |
|
From: Julien B a. A. <ar...@us...> - 2014-06-24 20:02:05
|
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 dd547792c9e48f07ea6cf9f47524ce710193f27d (commit)
from 62fd960209325beea1ea20300a18a3335c8ab61c (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 dd547792c9e48f07ea6cf9f47524ce710193f27d
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 24 22:01:07 2014 +0200
[BUILDROOT] 2013.11: fixes libhid download site
-----------------------------------------------------------------------
Summary of changes:
.../013-buildroot-fixes-libhid-download.patch | 15 +++++++++++++++
patches/buildroot/2013.11/cleanup_buildroot.sh | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
create mode 100644 patches/buildroot/2013.11/013-buildroot-fixes-libhid-download.patch
diff --git a/patches/buildroot/2013.11/013-buildroot-fixes-libhid-download.patch b/patches/buildroot/2013.11/013-buildroot-fixes-libhid-download.patch
new file mode 100644
index 0000000..07983cd
--- /dev/null
+++ b/patches/buildroot/2013.11/013-buildroot-fixes-libhid-download.patch
@@ -0,0 +1,15 @@
+From BR mainline. Can be removed when moving to BR 2014.05.
+
+Index: buildroot/package/libhid/libhid.mk
+===================================================================
+--- buildroot.orig/package/libhid/libhid.mk 2014-06-24 21:54:37.789807736 +0200
++++ buildroot/package/libhid/libhid.mk 2014-06-24 21:55:29.574064530 +0200
+@@ -5,7 +5,7 @@
+ ################################################################################
+
+ LIBHID_VERSION = 0.2.16
+-LIBHID_SITE = http://alioth.debian.org/frs/download.php/file/1958
++LIBHID_SITE = http://sources.buildroot.net/
+ LIBHID_DEPENDENCIES = libusb-compat libusb
+ LIBHID_INSTALL_STAGING = YES
+ LIBHID_AUTORECONF = YES
diff --git a/patches/buildroot/2013.11/cleanup_buildroot.sh b/patches/buildroot/2013.11/cleanup_buildroot.sh
index 553ee57..71ad2d9 100755
--- a/patches/buildroot/2013.11/cleanup_buildroot.sh
+++ b/patches/buildroot/2013.11/cleanup_buildroot.sh
@@ -88,3 +88,4 @@ rm -rf buildroot/package/gnash/
rm -rf buildroot/package/xc3sprog/
rm -rf buildroot/package/sam7-pgm-ng/
rm -rf buildroot/package/tk/
+rm -rf buildroot/package/libhid/
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-24 16:08:42
|
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 62fd960209325beea1ea20300a18a3335c8ab61c (commit)
from 87cfe2e87bdd1bdb61a86170470983eeb5c276de (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 62fd960209325beea1ea20300a18a3335c8ab61c
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 24 18:08:00 2014 +0200
[ASDEVICES] Lindent of Python module C wrappers
-----------------------------------------------------------------------
Summary of changes:
.../packages/as_devices/python/src/Apf27Pwm_wrap.c | 333 ++++++------
.../packages/as_devices/python/src/Apf27Pwm_wrap.h | 46 +-
target/packages/as_devices/python/src/AsAdc_wrap.c | 158 +++---
target/packages/as_devices/python/src/AsAdc_wrap.h | 6 +-
target/packages/as_devices/python/src/AsDac_wrap.c | 163 +++---
target/packages/as_devices/python/src/AsDac_wrap.h | 6 +-
.../packages/as_devices/python/src/AsGpio_wrap.c | 485 ++++++++---------
.../packages/as_devices/python/src/AsGpio_wrap.h | 22 +-
target/packages/as_devices/python/src/AsI2c_wrap.c | 563 ++++++++++----------
target/packages/as_devices/python/src/AsI2c_wrap.h | 23 +-
target/packages/as_devices/python/src/AsSpi_wrap.c | 515 +++++++++----------
target/packages/as_devices/python/src/AsSpi_wrap.h | 22 +-
12 files changed, 1091 insertions(+), 1251 deletions(-)
diff --git a/target/packages/as_devices/python/src/Apf27Pwm_wrap.c b/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
index fbd5cf2..f226cc5 100644
--- a/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
+++ b/target/packages/as_devices/python/src/Apf27Pwm_wrap.c
@@ -5,247 +5,224 @@
* @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;
- }
-
- return Py_BuildValue("i",ret);
+ ret = as_apf27_pwm_getPeriod(aPwmNumber);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_Exception, "Can't get period");
+ return NULL;
+ }
+ 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;
-
- /* 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);
+ /* 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);
}
-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;
-
- m = Py_InitModule("Apf27Pwm_wrap", Apf27Pwm_wrap_Methods);
- if (m == NULL)
- return;
+ PyObject *m;
+ 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 1a9cf83..6aad8ed 100644
--- a/target/packages/as_devices/python/src/Apf27Pwm_wrap.h
+++ b/target/packages/as_devices/python/src/Apf27Pwm_wrap.h
@@ -1,41 +1,39 @@
#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 6179052..c45ac19 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.c
+++ b/target/packages/as_devices/python/src/AsAdc_wrap.c
@@ -18,110 +18,98 @@
** 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_InitModule("AsAdc_wrap", AsAdc_wrap_methods); /* mod name, table ptr */
+void initAsAdc_wrap()
+{ /* called on first import *//* name matter if called dynamically */
+ (void)Py_InitModule("AsAdc_wrap", AsAdc_wrap_methods); /* mod name, table ptr */
}
/** @brief Initialize pin port access
* @return PyObject
*/
-static PyObject * adc_open(PyObject *self, PyObject *args)
+static PyObject *adc_open(PyObject * self, PyObject * args)
{
- /* parameters */
- char *aAdcType;
- int aDeviceNum;
- int aVref;
-
- struct as_adc_device *dev;
- PyObject *ret;
- char buff[300];
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "sii", &aAdcType, &aDeviceNum, &aVref))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- dev = as_adc_open(aAdcType, aDeviceNum, aVref);
- if (dev == NULL)
- {
- snprintf(buff, 300,
- "Initialization error for ADC type %s bus %d. Is kernel module loaded ?",
- aAdcType, aDeviceNum);
- PyErr_SetString(PyExc_IOError,buff);
- return NULL;
- }
-
- ret = Py_BuildValue("l", (long)dev);
-
- return ret;
+ /* parameters */
+ char *aAdcType;
+ int aDeviceNum;
+ int aVref;
+
+ struct as_adc_device *dev;
+ PyObject *ret;
+ char buff[300];
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "sii", &aAdcType, &aDeviceNum, &aVref)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ dev = as_adc_open(aAdcType, aDeviceNum, aVref);
+ if (dev == NULL) {
+ snprintf(buff, 300,
+ "Initialization error for ADC type %s bus %d. Is kernel module loaded ?",
+ aAdcType, aDeviceNum);
+ PyErr_SetString(PyExc_IOError, buff);
+ return NULL;
+ }
+
+ ret = Py_BuildValue("l", (long)dev);
+
+ return ret;
}
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args)
+static PyObject *getValueInMillivolts(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_adc_device *aFdev;
- int aChannel;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aChannel))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_adc_get_value_in_millivolts(aFdev, aChannel);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin direction");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_adc_device *aFdev;
+ int aChannel;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aChannel)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_adc_get_value_in_millivolts(aFdev, aChannel);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin direction");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * adc_close(PyObject *self, PyObject *args)
+static PyObject *adc_close(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_adc_device *aFdev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_adc_close(aFdev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't close port");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
-}
+ /* parameters */
+ struct as_adc_device *aFdev;
+
+ int ret;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ ret = as_adc_close(aFdev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't close port");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.h b/target/packages/as_devices/python/src/AsAdc_wrap.h
index 7fa0b8f..1f62ad5 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.h
+++ b/target/packages/as_devices/python/src/AsAdc_wrap.h
@@ -27,6 +27,6 @@ void initAsAdc_wrap();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject * adc_open(PyObject *self, PyObject *args);
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args);
-static PyObject * adc_close(PyObject *self, PyObject *args);
+static PyObject *adc_open(PyObject * self, PyObject * args);
+static PyObject *getValueInMillivolts(PyObject * self, PyObject * args);
+static PyObject *adc_close(PyObject * self, PyObject * args);
diff --git a/target/packages/as_devices/python/src/AsDac_wrap.c b/target/packages/as_devices/python/src/AsDac_wrap.c
index 7f76582..69811e7 100644
--- a/target/packages/as_devices/python/src/AsDac_wrap.c
+++ b/target/packages/as_devices/python/src/AsDac_wrap.c
@@ -18,112 +18,101 @@
** 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 "AsDac_wrap.h"
#include "as_dac.h"
/* Methods definitions */
static PyMethodDef AsDac_wrap_methods[] = {
- {"dac_open", dac_open, METH_VARARGS, "Initialize dac"},
- {"dac_setValueInMillivolts", dac_setValueInMillivolts, METH_VARARGS, "Set Channel value in millivolts"},
- {"dac_close", dac_close, METH_VARARGS, "Close dac"},
- {NULL, NULL, 0, NULL} /* Sentinel */
+ {"dac_open", dac_open, METH_VARARGS, "Initialize dac"},
+ {"dac_setValueInMillivolts", dac_setValueInMillivolts, METH_VARARGS,
+ "Set Channel value in millivolts"},
+ {"dac_close", dac_close, METH_VARARGS, "Close dac"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
};
/* Init module */
-void initAsDac_wrap() /* called on first import */
-{ /* name matter if called dynamically */
- (void) Py_InitModule("AsDac_wrap", AsDac_wrap_methods); /* mod name, table ptr */
+void initAsDac_wrap()
+{ /* called on first import *//* name matter if called dynamically */
+ (void)Py_InitModule("AsDac_wrap", AsDac_wrap_methods); /* mod name, table ptr */
}
/** @brief Initialize pin port access
* @return PyObject
*/
-static PyObject * dac_open(PyObject *self, PyObject *args)
+static PyObject *dac_open(PyObject * self, PyObject * args)
{
- /* parameters */
- char *aDacType;
- int aBusNumber;
- int aAddress;
- int aVref;
-
- struct as_dac_device *dev;
- PyObject *ret;
- char buff[300];
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "siii", &aDacType,
- &aBusNumber, &aAddress, &aVref))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- dev = as_dac_open(aDacType, aBusNumber, aAddress, aVref);
- if (dev == NULL)
- {
- snprintf(buff, 300,
- "Initialization error for DAC type %s bus %d. Is kernel module loaded ?",
- aDacType, aBusNumber);
- PyErr_SetString(PyExc_IOError,buff);
- return NULL;
- }
-
- ret = Py_BuildValue("l", (long)dev);
-
- return ret;
+ /* parameters */
+ char *aDacType;
+ int aBusNumber;
+ int aAddress;
+ int aVref;
+
+ struct as_dac_device *dev;
+ PyObject *ret;
+ char buff[300];
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "siii", &aDacType,
+ &aBusNumber, &aAddress, &aVref)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ dev = as_dac_open(aDacType, aBusNumber, aAddress, aVref);
+ if (dev == NULL) {
+ snprintf(buff, 300,
+ "Initialization error for DAC type %s bus %d. Is kernel module loaded ?",
+ aDacType, aBusNumber);
+ PyErr_SetString(PyExc_IOError, buff);
+ return NULL;
+ }
+
+ ret = Py_BuildValue("l", (long)dev);
+
+ return ret;
}
-static PyObject * dac_setValueInMillivolts(PyObject *self, PyObject *args)
+static PyObject *dac_setValueInMillivolts(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_dac_device *aDev;
- int aChannel;
- int aValue;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aChannel, &aValue))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_dac_set_value_in_millivolts(aDev, aChannel, aValue);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin direction");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_dac_device *aDev;
+ int aChannel;
+ int aValue;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aChannel, &aValue)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_dac_set_value_in_millivolts(aDev, aChannel, aValue);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin direction");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * dac_close(PyObject *self, PyObject *args)
+static PyObject *dac_close(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_dac_device *aDev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aDev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_dac_close(aDev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't close port");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
-}
+ /* parameters */
+ struct as_dac_device *aDev;
+
+ int ret;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ ret = as_dac_close(aDev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't close port");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
diff --git a/target/packages/as_devices/python/src/AsDac_wrap.h b/target/packages/as_devices/python/src/AsDac_wrap.h
index 6ba91a7..a453902 100644
--- a/target/packages/as_devices/python/src/AsDac_wrap.h
+++ b/target/packages/as_devices/python/src/AsDac_wrap.h
@@ -27,6 +27,6 @@ void initAsDac_wrap();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject * dac_open(PyObject *self, PyObject *args);
-static PyObject * dac_setValueInMillivolts(PyObject *self, PyObject *args);
-static PyObject * dac_close(PyObject *self, PyObject *args);
+static PyObject *dac_open(PyObject * self, PyObject * args);
+static PyObject *dac_setValueInMillivolts(PyObject * self, PyObject * args);
+static PyObject *dac_close(PyObject * self, PyObject * args);
diff --git a/target/packages/as_devices/python/src/AsGpio_wrap.c b/target/packages/as_devices/python/src/AsGpio_wrap.c
index 29b0da7..0eeb0b8 100644
--- a/target/packages/as_devices/python/src/AsGpio_wrap.c
+++ b/target/packages/as_devices/python/src/AsGpio_wrap.c
@@ -22,64 +22,62 @@
** - Change name of function "blockingGetPinValue" to "WaitEvent" as named
** under C library
*/
+
#include "AsGpio_wrap.h"
#include "as_gpio.h"
-
/* Methods definitions */
static PyMethodDef AsGpio_wrap_methods[] = {
- {"gpio_open", gpio_open, METH_VARARGS, "Initialize gpio"},
- {"setPinDirection", setPinDirection, METH_VARARGS, "Set pin direction"},
- {"getPinDirection", getPinDirection, METH_VARARGS, "Get pin direction"},
- {"setPinValue", setPinValue, METH_VARARGS, "Set pin value"},
- {"getPinValue", getPinValue, METH_VARARGS, "Get pin value"},
- {"blockingGetPinValue", blockingGetPinValue, METH_VARARGS, "Blocking read pin value"},
- {"getIrqMode", getIrqMode, METH_VARARGS, "Get IRQ Mode"},
- {"setIrqMode", setIrqMode, METH_VARARGS, "Set IRQ Mode"},
- {"getPinNumber", getPinNumber, METH_VARARGS, "Get pin number"},
- {"gpio_close", gpio_close, METH_VARARGS, "Close gpio"},
- {NULL, NULL, 0, NULL} /* Sentinel */
+ {"gpio_open", gpio_open, METH_VARARGS, "Initialize gpio"},
+ {"setPinDirection", setPinDirection, METH_VARARGS, "Set pin direction"},
+ {"getPinDirection", getPinDirection, METH_VARARGS, "Get pin direction"},
+ {"setPinValue", setPinValue, METH_VARARGS, "Set pin value"},
+ {"getPinValue", getPinValue, METH_VARARGS, "Get pin value"},
+ {"blockingGetPinValue", blockingGetPinValue, METH_VARARGS,
+ "Blocking read pin value"},
+ {"getIrqMode", getIrqMode, METH_VARARGS, "Get IRQ Mode"},
+ {"setIrqMode", setIrqMode, METH_VARARGS, "Set IRQ Mode"},
+ {"getPinNumber", getPinNumber, METH_VARARGS, "Get pin number"},
+ {"gpio_close", gpio_close, METH_VARARGS, "Close gpio"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
};
/* Init module */
-void initAsGpio_wrap() /* called on first import */
-{ /* name matter if called dynamically */
- (void) Py_InitModule("AsGpio_wrap", AsGpio_wrap_methods); /* mod name, table ptr */
+void initAsGpio_wrap()
+{ /* called on first import *//* name matter if called dynamically */
+ (void)Py_InitModule("AsGpio_wrap", AsGpio_wrap_methods); /* mod name, table ptr */
}
/** @brief Initialize pin port access
* @param aGpioNum pin number on port
* @return PyObject
*/
-static PyObject * gpio_open(PyObject *self, PyObject *args)
+static PyObject *gpio_open(PyObject * self, PyObject * args)
{
- /* parameters */
- int aGpioNum;
-
- struct as_gpio_device *dev;
- PyObject *ret;
- char buff[300];
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aGpioNum))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- dev = as_gpio_open(aGpioNum);
- if (dev == NULL)
- {
- snprintf(buff, 300,
- "Initialization error %d. Is kernel module loaded ?",
- aGpioNum);
- PyErr_SetString(PyExc_IOError,buff);
- return NULL;
- }
-
- ret = Py_BuildValue("l", (long)dev);
-
- return ret;
+ /* parameters */
+ int aGpioNum;
+
+ struct as_gpio_device *dev;
+ PyObject *ret;
+ char buff[300];
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aGpioNum)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ dev = as_gpio_open(aGpioNum);
+ if (dev == NULL) {
+ snprintf(buff, 300,
+ "Initialization error %d. Is kernel module loaded ?",
+ aGpioNum);
+ PyErr_SetString(PyExc_IOError, buff);
+ return NULL;
+ }
+
+ ret = Py_BuildValue("l", (long)dev);
+
+ return ret;
}
/** @brief Set pin direction
@@ -89,59 +87,49 @@ static PyObject * gpio_open(PyObject *self, PyObject *args)
*
* @return error if negative value
*/
-static PyObject * setPinDirection(PyObject *self, PyObject *args)
+static PyObject *setPinDirection(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
- char* aDirection;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ls",
- (long *)&aFdev,
- &aDirection))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_set_pin_direction(aFdev, aDirection);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't set pin direction");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+ char *aDirection;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "ls", (long *)&aFdev, &aDirection)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_gpio_set_pin_direction(aFdev, aDirection);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't set pin direction");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * getPinDirection(PyObject *self, PyObject *args)
+static PyObject *getPinDirection(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
-
- const char* dir;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- dir = as_gpio_get_pin_direction(aFdev);
- if (strcmp(dir, "??"))
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin direction");
- return NULL;
- }
-
- return Py_BuildValue("s", dir);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+
+ const char *dir;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ dir = as_gpio_get_pin_direction(aFdev);
+ if (strcmp(dir, "??")) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin direction");
+ return NULL;
+ }
+
+ return Py_BuildValue("s", dir);
}
/** @brief Set pin value
@@ -151,31 +139,27 @@ static PyObject * getPinDirection(PyObject *self, PyObject *args)
*
* @return error if negative
*/
-static PyObject * setPinValue(PyObject *self, PyObject *args)
+static PyObject *setPinValue(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
- int aValue;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aValue))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_set_pin_value(aFdev, aValue);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't set pin value");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+ int aValue;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aValue)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_gpio_set_pin_value(aFdev, aValue);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't set pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
@@ -186,30 +170,26 @@ static PyObject * setPinValue(PyObject *self, PyObject *args)
*
* @return pin value if positive or null, error if negative
*/
-static PyObject * getPinValue(PyObject *self, PyObject *args)
+static PyObject *getPinValue(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_get_pin_value(aFdev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin value");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_gpio_get_pin_value(aFdev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
/** @brief Get pin value, blocking until interrupt occur
@@ -220,40 +200,31 @@ static PyObject * getPinValue(PyObject *self, PyObject *args)
*
* @return pin value if positive or null, error if negative
*/
-static PyObject * blockingGetPinValue(PyObject *self, PyObject *args)
+static PyObject *blockingGetPinValue(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
- int aDelay_ms;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li",
- (long *)&aFdev,
- &aDelay_ms))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
-Py_BEGIN_ALLOW_THREADS
- ret = as_gpio_wait_event(aFdev, aDelay_ms);
-Py_END_ALLOW_THREADS
- if (ret == -ETIMEDOUT)
- {
- PyErr_SetString(PyExc_IOError, "TIMEOUT");
- return NULL;
- }
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin value");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+ int aDelay_ms;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aDelay_ms)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS ret = as_gpio_wait_event(aFdev, aDelay_ms);
+ Py_END_ALLOW_THREADS if (ret == -ETIMEDOUT) {
+ PyErr_SetString(PyExc_IOError, "TIMEOUT");
+ return NULL;
+ }
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
/** @brief Set pin irq mode
@@ -263,31 +234,27 @@ Py_END_ALLOW_THREADS
*
* @return error if negative
*/
-static PyObject * setIrqMode(PyObject *self, PyObject *args)
+static PyObject *setIrqMode(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
- char *aMode;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ls", (long *)&aFdev, &aMode))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_set_irq_mode(aFdev, aMode);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin value");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+ char *aMode;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "ls", (long *)&aFdev, &aMode)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_gpio_set_irq_mode(aFdev, aMode);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
/** @brief Get pin irq mode value
@@ -296,30 +263,26 @@ static PyObject * setIrqMode(PyObject *self, PyObject *args)
*
* @return pin mode ("falling"/"rising"/"both"/"none")
*/
-static PyObject * getIrqMode(PyObject *self, PyObject *args)
+static PyObject *getIrqMode(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
-
- const char *mode;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- mode = as_gpio_get_irq_mode(aFdev);
- if (strcmp(mode, "??"))
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin value");
- return NULL;
- }
-
- return Py_BuildValue("s", mode);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+
+ const char *mode;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ mode = as_gpio_get_irq_mode(aFdev);
+ if (strcmp(mode, "??")) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("s", mode);
}
/** @brief Get pin number value
@@ -328,30 +291,26 @@ static PyObject * getIrqMode(PyObject *self, PyObject *args)
*
* @return pin number, error if negative
*/
-static PyObject * getPinNumber(PyObject *self, PyObject *args)
+static PyObject *getPinNumber(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_get_pin_num(aFdev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get pin value");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_gpio_device *aFdev;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_gpio_get_pin_num(aFdev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get pin value");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
/** @brief Close port access
@@ -360,30 +319,24 @@ static PyObject * getPinNumber(PyObject *self, PyObject *args)
*
* @return pin value if positive or null, error if negative
*/
-static PyObject * gpio_close(PyObject *self, PyObject *args)
+static PyObject *gpio_close(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_gpio_device *aFdev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_gpio_close(aFdev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't close port");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
-}
+ /* parameters */
+ struct as_gpio_device *aFdev;
+
+ int ret;
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aFdev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ ret = as_gpio_close(aFdev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't close port");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
diff --git a/target/packages/as_devices/python/src/AsGpio_wrap.h b/target/packages/as_devices/python/src/AsGpio_wrap.h
index 9437057..0a93390 100644
--- a/target/packages/as_devices/python/src/AsGpio_wrap.h
+++ b/target/packages/as_devices/python/src/AsGpio_wrap.h
@@ -27,17 +27,17 @@ void initAsGpio_wrap();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject * gpio_open(PyObject *self, PyObject *args);
+static PyObject *gpio_open(PyObject * self, PyObject * args);
-static PyObject * setPinDirection(PyObject *self, PyObject *args);
-static PyObject * getPinDirection(PyObject *self, PyObject *args);
-static PyObject * setPinValue(PyObject *self, PyObject *args);
-static PyObject * getPinValue(PyObject *self, PyObject *args);
+static PyObject *setPinDirection(PyObject * self, PyObject * args);
+static PyObject *getPinDirection(PyObject * self, PyObject * args);
+static PyObject *setPinValue(PyObject * self, PyObject * args);
+static PyObject *getPinValue(PyObject * self, PyObject * args);
-static PyObject * blockingGetPinValue(PyObject *self, PyObject *args);
-static PyObject * getIrqMode(PyObject *self, PyObject *args);
-static PyObject * setIrqMode(PyObject *self, PyObject *args);
-static PyObject * getPinNumber(PyObject *self, PyObject *args);
-static PyObject * getPortLetter(PyObject *self, PyObject *args);
+static PyObject *blockingGetPinValue(PyObject * self, PyObject * args);
+static PyObject *getIrqMode(PyObject * self, PyObject * args);
+static PyObject *setIrqMode(PyObject * self, PyObject * args);
+static PyObject *getPinNumber(PyObject * self, PyObject * args);
+static PyObject *getPortLetter(PyObject * self, PyObject * args);
-static PyObject * gpio_close(PyObject *self, PyObject *args);
+static PyObject *gpio_close(PyObject * self, PyObject * args);
diff --git a/target/packages/as_devices/python/src/AsI2c_wrap.c b/target/packages/as_devices/python/src/AsI2c_wrap.c
index c080d55..97bed5a 100644
--- a/target/packages/as_devices/python/src/AsI2c_wrap.c
+++ b/target/packages/as_devices/python/src/AsI2c_wrap.c
@@ -21,6 +21,7 @@
* TODO:
* - Suppress MAX_DATA_SIZE macro
*/
+
#include "AsI2c_wrap.h"
#include "as_i2c.h"
@@ -28,334 +29,308 @@
/* Methods definitions */
static PyMethodDef AsI2c_wrap_methods[] = {
- {"i2c_open" , i2c_open , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_close" , i2c_close , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_set_slave_addr", i2c_set_slave_addr, METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_get_slave_addr", i2c_get_slave_addr, METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_read" , i2c_read , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_write" , i2c_write , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_read_reg" , i2c_read_reg , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_write_reg" , i2c_write_reg , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_read_reg_byte" , i2c_read_reg_byte , METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_write_reg_byte", i2c_write_reg_byte, METH_VARARGS, "as_i2c function wrapped"},
- {"i2c_read_msg" , i2c_read_msg , METH_VARARGS, "as_i2c function wrapped"},
- {NULL, NULL, 0, NULL} /* Sentinel */
+ {"i2c_open", i2c_open, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_close", i2c_close, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_set_slave_addr", i2c_set_slave_addr, METH_VARARGS,
+ "as_i2c function wrapped"},
+ {"i2c_get_slave_addr", i2c_get_slave_addr, METH_VARARGS,
+ "as_i2c function wrapped"},
+ {"i2c_read", i2c_read, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_write", i2c_write, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_read_reg", i2c_read_reg, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_write_reg", i2c_write_reg, METH_VARARGS,
+ "as_i2c function wrapped"},
+ {"i2c_read_reg_byte", i2c_read_reg_byte, METH_VARARGS,
+ "as_i2c function wrapped"},
+ {"i2c_write_reg_byte", i2c_write_reg_byte, METH_VARARGS,
+ "as_i2c function wrapped"},
+ {"i2c_read_msg", i2c_read_msg, METH_VARARGS, "as_i2c function wrapped"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
};
-
/* Init module */
-void initAsI2c_wrap() /* called on first import */
-{ /* name matter if called dynamically */
- (void) Py_InitModule("AsI2c_wrap", AsI2c_wrap_methods); /* mod name, table ptr */
+void initAsI2c_wrap()
+{ /* called on first import *//* name matter if called dynamically */
+ (void)Py_InitModule("AsI2c_wrap", AsI2c_wrap_methods); /* mod name, table ptr */
}
-static PyObject * i2c_open(PyObject *self, PyObject *args)
+static PyObject *i2c_open(PyObject * self, PyObject * args)
{
- /* parameters */
- int aBusNumber;
-
- struct as_i2c_device *dev;
- PyObject *ret;
- char buff[300];
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "i", &aBusNumber))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- dev = as_i2c_open(aBusNumber);
- if (dev == NULL)
- {
- snprintf(buff, 300,
- "Initialization error for i2c bus %d.", aBusNumber);
- PyErr_SetString(PyExc_IOError,buff);
- return NULL;
- }
- ret = Py_BuildValue("l", (long)dev);
-
- return ret;
+ /* parameters */
+ int aBusNumber;
+
+ struct as_i2c_device *dev;
+ PyObject *ret;
+ char buff[300];
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aBusNumber)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ dev = as_i2c_open(aBusNumber);
+ if (dev == NULL) {
+ snprintf(buff, 300,
+ "Initialization error for i2c bus %d.", aBusNumber);
+ PyErr_SetString(PyExc_IOError, buff);
+ return NULL;
+ }
+ ret = Py_BuildValue("l", (long)dev);
+
+ return ret;
}
-static PyObject * i2c_close(PyObject *self, PyObject *args)
+static PyObject *i2c_close(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
-
- /* return value */
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aDev)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- ret = as_i2c_close(aDev);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError, "Can't close i2c");
- return Py_BuildValue("i", -1);
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+
+ /* return value */
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ ret = as_i2c_close(aDev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't close i2c");
+ return Py_BuildValue("i", -1);
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_set_slave_addr(PyObject *self, PyObject *args)
+static PyObject *i2c_set_slave_addr(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- int aSlaveAddr;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSlaveAddr))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_set_slave_addr(aDev, aSlaveAddr);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't set slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ int aSlaveAddr;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSlaveAddr)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_set_slave_addr(aDev, aSlaveAddr);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't set slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_get_slave_addr(PyObject *self, PyObject *args)
+static PyObject *i2c_get_slave_addr(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aDev))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_get_slave_addr(aDev);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_get_slave_addr(aDev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_read(PyObject *self, PyObject *args)
+static PyObject *i2c_read(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t aData[MAX_DATA_SIZE];
- int aSize;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSize))
- {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- if (aSize > MAX_DATA_SIZE) {
- PyErr_SetString(PyExc_IOError,
- "Size too high");
- return NULL;
- }
-
- ret = as_i2c_read(aDev, aData, aSize);
- if (ret < 0)
- {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("s#", (unsigned char *)aData, aSize);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aData[MAX_DATA_SIZE];
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSize)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ if (aSize > MAX_DATA_SIZE) {
+ PyErr_SetString(PyExc_IOError, "Size too high");
+ return NULL;
+ }
+
+ ret = as_i2c_read(aDev, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("s#", (unsigned char *)aData, aSize);
}
-static PyObject * i2c_write(PyObject *self, PyObject *args)
+static PyObject *i2c_write(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t *aData;
- int aSize;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ls#", (long *)&aDev, (unsigned char *)&aData, &aSize)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_write(aDev, aData, aSize);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t *aData;
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple
+ (args, "ls#", (long *)&aDev, (unsigned char *)&aData, &aSize)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write(aDev, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_read_reg(PyObject *self, PyObject *args)
+static PyObject *i2c_read_reg(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t aReg;
- uint8_t aData[MAX_DATA_SIZE];
- int aSize;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aSize)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- if (aSize > MAX_DATA_SIZE) {
- PyErr_SetString(PyExc_IOError,
- "Size too high");
- return NULL;
- }
-
- ret = as_i2c_read_reg(aDev, aReg, aData, aSize);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("s#", (unsigned char *)aData, aSize);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t aData[MAX_DATA_SIZE];
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aSize)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ if (aSize > MAX_DATA_SIZE) {
+ PyErr_SetString(PyExc_IOError, "Size too high");
+ return NULL;
+ }
+
+ ret = as_i2c_read_reg(aDev, aReg, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("s#", (unsigned char *)aData, aSize);
}
-static PyObject * i2c_write_reg(PyObject *self, PyObject *args)
+static PyObject *i2c_write_reg(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t aReg;
- uint8_t *aData;
- int aSize;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "lis#", (long *)&aDev, &aReg, (unsigned char *)&aData, &aSize)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_write_reg(aDev, aReg, aData, aSize);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t *aData;
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple
+ (args, "lis#", (long *)&aDev, &aReg, (unsigned char *)&aData,
+ &aSize)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write_reg(aDev, aReg, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_read_reg_byte(PyObject *self, PyObject *args)
+static PyObject *i2c_read_reg_byte(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t aReg;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aReg)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_read_reg_byte(aDev, aReg);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aReg)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_read_reg_byte(aDev, aReg);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-static PyObject * i2c_read_msg(PyObject *self, PyObject *args)
+static PyObject *i2c_read_msg(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t *aWData;
- int aWriteSize;
- uint8_t RData[MAX_DATA_SIZE];
- int aReadSize;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "ls#i", (long *)&aDev,
- (unsigned char *)&aWData, &aWriteSize,
- &aReadSize)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
- if (aReadSize > MAX_DATA_SIZE) {
- PyErr_SetString(PyExc_IOError,
- "Read size too high");
- return NULL;
- }
-
- ret = as_i2c_read_msg(aDev, aWData, aWriteSize, RData, aReadSize);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't forge read message");
- return NULL;
- }
-
- return Py_BuildValue("s#", (unsigned char *)RData, aReadSize);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t *aWData;
+ int aWriteSize;
+ uint8_t RData[MAX_DATA_SIZE];
+ int aReadSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "ls#i", (long *)&aDev,
+ (unsigned char *)&aWData, &aWriteSize,
+ &aReadSize)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+ if (aReadSize > MAX_DATA_SIZE) {
+ PyErr_SetString(PyExc_IOError, "Read size too high");
+ return NULL;
+ }
+
+ ret = as_i2c_read_msg(aDev, aWData, aWriteSize, RData, aReadSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't forge read message");
+ return NULL;
+ }
+
+ return Py_BuildValue("s#", (unsigned char *)RData, aReadSize);
}
-
-static PyObject * i2c_write_reg_byte(PyObject *self, PyObject *args)
+static PyObject *i2c_write_reg_byte(PyObject * self, PyObject * args)
{
- /* parameters */
- struct as_i2c_device *aDev;
- uint8_t aReg;
- uint8_t aVal;
-
- int ret;
-
- /* Get arguments */
- if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aVal)) {
- PyErr_SetString(PyExc_IOError,
- "Wrong parameters.");
- return NULL;
- }
-
- ret = as_i2c_write_reg_byte(aDev, aReg, aVal);
- if (ret < 0) {
- PyErr_SetString(PyExc_IOError,
- "Can't get slave address");
- return NULL;
- }
-
- return Py_BuildValue("i", ret);
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t aVal;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aVal)) {
+ PyErr_SetString(PyExc_IOError, "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write_reg_byte(aDev, aReg, aVal);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
}
-
diff --git a/target/packages/as_devices/python/src/AsI2c_wrap.h b/target/packages/as_devices/python/src/AsI2c_wrap.h
index 61b8147..aa2390b 100644
--- a/target/packages/as_devices/python/src/AsI2c_wrap.h
+++ b/target/packages/as_devices/python/src/AsI2c_wrap.h
@@ -19,7 +19,6 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include <Python.h>
/* Init module */
@@ -28,19 +27,19 @@ void initA...
[truncated message content] |
|
From: Julien B a. A. <ar...@us...> - 2014-06-24 06:32:44
|
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 87cfe2e87bdd1bdb61a86170470983eeb5c276de (commit)
from 2c49dcd504faddca6379b6be6d29c1af3057bd19 (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 87cfe2e87bdd1bdb61a86170470983eeb5c276de
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 24 08:32:25 2014 +0200
[ASDEVICES] Fixes C++ modules build
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/Makefile | 3 ++-
target/packages/as_devices/c/as_dac.h | 6 ++++--
target/packages/as_devices/cpp/Makefile | 13 ++++++++-----
target/packages/as_devices/test_cpp.h | 11 ++++++-----
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/target/packages/as_devices/Makefile b/target/packages/as_devices/Makefile
index c3cb475..471744d 100644
--- a/target/packages/as_devices/Makefile
+++ b/target/packages/as_devices/Makefile
@@ -34,7 +34,8 @@ $(C_BINARY): main.c test_c.h $(C_LIB)
$(CC) $(CFLAGS) main.c $(C_LIB) -o $(C_BINARY) -I$(C_INCLUDE) -lm
$(CPP_BINARY): main.c test_cpp.h $(CPP_LIB) $(C_LIB)
- $(CXX) $(CFLAGS) main.c $(C_LIB) $(CPP_LIB) -I$(C_INCLUDE) -I$(CPP_INCLUDE) -o $(CPP_BINARY) -D__cplusplus
+ $(CXX) $(CFLAGS) main.c $(C_LIB) $(CPP_LIB) -I$(C_INCLUDE) -I$(CPP_INCLUDE) -o $(CPP_BINARY)
+#-D__cplusplus is automatically defined by compiler
$(CPP_LIB): $(C_LIB)
+make -C cpp/
diff --git a/target/packages/as_devices/c/as_dac.h b/target/packages/as_devices/c/as_dac.h
index 140b968..878d655 100644
--- a/target/packages/as_devices/c/as_dac.h
+++ b/target/packages/as_devices/c/as_dac.h
@@ -22,6 +22,8 @@
#ifndef __AS_DAC_H__
#define __AS_DAC_H__
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -73,5 +75,5 @@ int32_t as_dac_close(struct as_dac_device *dac);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-#endif /* __AS_DAC_H__ */
+#endif /* __cplusplus */
+#endif /* __AS_DAC_H__ */
diff --git a/target/packages/as_devices/cpp/Makefile b/target/packages/as_devices/cpp/Makefile
index 9b034f5..59e2d4c 100644
--- a/target/packages/as_devices/cpp/Makefile
+++ b/target/packages/as_devices/cpp/Makefile
@@ -2,7 +2,7 @@
# make CXX=../../../buildroot/build_armv5te/staging_dir/usr/bin/arm-linux-g++
#
# Default values for local compiling:
-ARMADEUS_BASE_DIR=../../../../
+ARMADEUS_BASE_DIR = ../../../../
-include $(ARMADEUS_BASE_DIR)/Makefile.in
CXX = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
CXXFLAGS =-Wall -g -O0
@@ -26,19 +26,22 @@ LIBNAME = ${SO_NAME}.${LIB_VERS}
ARCHIVE_CMD = ar
ARCHIVE_OPTS = -cvq
-C_INCLUDE=../c/
-C_LIB=../c/libas_devices.so.1
+C_INCLUDE = ../c/
+C_LIB = ../c/libas_devices.so.1
.PHONY: install install-exe clean
$(SO_NAME): ${OBJS}
- ${CXX} -shared -Wl,-soname,${SO_NAME} -o ${SO_NAME} ${OBJS} ${C_LIB} -lc
+ @echo " LNK $@"
+ @${CXX} -shared -Wl,-soname,${SO_NAME} -o ${SO_NAME} ${OBJS} ${C_LIB} -lc
${STAT_LIB}: ${OBJS}
${ARCHIVE_CMD} ${ARCHIVE_OPTS} ${STAT_LIB} ${OBJS}
%.o: %.cpp
- $(CXX) -fPIC -o $@ -c $< ${CXXFLAGS} -I${C_INCLUDE} -D__cplusplus
+ @echo " CPP $@"
+ @$(CXX) -fPIC -o $@ -c $< ${CXXFLAGS} -I${C_INCLUDE}
+#-D__cplusplus is automatically defined by compiler
install: $(SO_NAME)
mkdir -p $(INSTALL_DIR)/usr/lib
diff --git a/target/packages/as_devices/test_cpp.h b/target/packages/as_devices/test_cpp.h
index b12f406..6e99f05 100644
--- a/target/packages/as_devices/test_cpp.h
+++ b/target/packages/as_devices/test_cpp.h
@@ -127,8 +127,6 @@ void test_gpio()
int32_t ret;
int32_t value;
int pin_num = (5 *32) + 13;
- int port_direction = 0;
- int port_value = 1;
gpio_dev = new AsGpio(pin_num);
if (gpio_dev == NULL)
@@ -143,7 +141,6 @@ void test_gpio()
printf("Error, can't get pin value\n");
return;
}
- port_value = ret;
while(buffer[0] != 'q')
{
@@ -186,7 +183,6 @@ void test_gpio()
pressEnterToContinue();
break;
}
- port_direction = value;
printf("Ok direction changed\n");
pressEnterToContinue();
break;
@@ -211,7 +207,6 @@ void test_gpio()
break;
}
printf("Value is %d\n", ret);
- port_value = ret;
pressEnterToContinue();
break;
case '5' :
@@ -1058,3 +1053,9 @@ void test_i2c_eeprom()
}
}
}
+
+void test_tcs3472(void)
+{
+ printf("TODO\n");
+ pressEnterToContinue();
+}
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-24 06:25:13
|
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 2c49dcd504faddca6379b6be6d29c1af3057bd19 (commit)
from a0721960e6e3f8b7f4d8ea0bf7070fad8c0721be (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 2c49dcd504faddca6379b6be6d29c1af3057bd19
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 24 08:24:37 2014 +0200
[ASDEVICES] Fixes Doxygen warning on some C modules
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_adc_iio.h | 31 ++++++++++----
target/packages/as_devices/c/as_backlight.h | 9 +++-
target/packages/as_devices/c/as_led.h | 38 ++++++++--------
target/packages/as_devices/c/as_max1027.h | 53 +++++++++++++++++------
target/packages/as_devices/c/as_power_supply.h | 6 +-
target/packages/as_devices/c/as_pwm.h | 11 +++--
target/packages/as_devices/c/as_tcs3472.h | 20 ++++++---
7 files changed, 110 insertions(+), 58 deletions(-)
diff --git a/target/packages/as_devices/c/as_adc_iio.h b/target/packages/as_devices/c/as_adc_iio.h
index e15fc64..14f9ad9 100644
--- a/target/packages/as_devices/c/as_adc_iio.h
+++ b/target/packages/as_devices/c/as_adc_iio.h
@@ -18,8 +18,8 @@
*
*/
-#ifndef AS_ADC_IMX28_LRADC_H_
-#define AS_ADC_IMX28_LRADC_H_
+#ifndef __AS_ADC_IIO_H__
+#define __AS_ADC_IIO_H__
#ifdef __cplusplus
extern "C" {
@@ -27,14 +27,29 @@ extern "C" {
#include "as_adc.h"
-struct as_adc_device *as_adc_open_iio(int aDeviceNum, int aVRef);
-int32_t as_adc_get_value_in_millivolts_iio(struct as_adc_device *aDev,
- int aChannel);
-int32_t as_adc_close_iio(struct as_adc_device *aDev);
+/** @brief Initialize ADC access
+ *
+ * @param dev_num device number for IIO infra
+ * @param vref reference voltage
+ */
+struct as_adc_device *as_adc_open_iio(int dev_num, int vref);
+
+/** @brief Get given IIO ADC channel voltage
+ *
+ * @param adc ADC handler returned by as_adc_open_iio()
+ * @param channel channel to sample
+ */
+int32_t as_adc_get_value_in_millivolts_iio(struct as_adc_device *adc,
+ int channel);
+
+/** @brief Close ADC access
+ *
+ * @param adc ADC handler returned by as_adc_open_iio()
+ */
+int32_t as_adc_close_iio(struct as_adc_device *adc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /* AS_ADC_IMX28_LRADC_H_ */
-
+#endif /* __AS_ADC_IIO_H__ */
diff --git a/target/packages/as_devices/c/as_backlight.h b/target/packages/as_devices/c/as_backlight.h
index 06b70be..b678f8c 100644
--- a/target/packages/as_devices/c/as_backlight.h
+++ b/target/packages/as_devices/c/as_backlight.h
@@ -28,10 +28,13 @@ extern "C" {
#include <stdint.h>
+/** @brief Structure to store backlight device parameters
+ *
+ */
struct as_backlight_device {
- int fileActualBrightness;
- int fileMaxBrightness;
- int fileBrightness;
+ int fileActualBrightness; /*!< file descriptor to get current brightness */
+ int fileMaxBrightness; /*!< file descriptor to get maximum brightness */
+ int fileBrightness; /*!< file descriptor to set brightness */
};
/** @brief Open Backlight device
diff --git a/target/packages/as_devices/c/as_led.h b/target/packages/as_devices/c/as_led.h
index b9ae389..5e43215 100644
--- a/target/packages/as_devices/c/as_led.h
+++ b/target/packages/as_devices/c/as_led.h
@@ -30,73 +30,73 @@ extern "C" {
/**
- * Store led parameters
+ * @brief Store LED device parameters
*/
struct as_led_device {
- char led_name[32];
- int file_brightness;
- int file_max_brightness;
+ char led_name[32]; /*!< LED device name */
+ int file_brightness; /*!< file descriptor to set LED brightness */
+ int file_max_brightness; /*!< file descriptor to get LED max possible brightness */
};
-/** @brief Initialize led access
+/** @brief Initialize LED access
*
- * @param a_led_name char* name of the led
+ * @param led_name char* name of the led
*
* @return NULL on error
*/
-struct as_led_device *as_led_open(char *a_led_name);
+struct as_led_device *as_led_open(char *led_name);
/** @brief Close led access
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
*
* @return error if negative
*/
-int32_t as_led_close(struct as_led_device *a_led_dev);
+int32_t as_led_close(struct as_led_device *led);
/** @brief Get max brightness
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
*
* @return maximum allowed brightness, negative value on error
*/
-int32_t as_led_get_max_brightness(struct as_led_device *a_led_dev);
+int32_t as_led_get_max_brightness(struct as_led_device *led);
/** @brief Set brightness
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
* @param a_brightness uint32_t requested value for led brighthness
*
* @return current brightness, negative value on error
*/
-int32_t as_led_set_brightness(struct as_led_device *a_led_dev, uint32_t a_brightness);
+int32_t as_led_set_brightness(struct as_led_device *led, uint32_t a_brightness);
/** @brief Get brightness
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
*
* @return current brightness, negative value on error
*/
-int32_t as_led_get_brightness(struct as_led_device *a_led_dev);
+int32_t as_led_get_brightness(struct as_led_device *led);
/** @brief Make a led blinking
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
* @param a_delay_on uint32_t value for led on time
* @param a_delay_off uint32_t value for led off time
*
* @return negative value on error
*/
-int32_t as_led_start_blinking(struct as_led_device *a_led_dev, int32_t a_delay_on, int32_t a_delay_off);
+int32_t as_led_start_blinking(struct as_led_device *led, int32_t a_delay_on, int32_t a_delay_off);
/** @brief Led stop blinking
*
- * @param a_led_dev as_led_device pointer structure
+ * @param led LED handler returned by as_led_open()
*
* @return negative value on error
*/
-int32_t as_led_stop_blinking(struct as_led_device *a_led_dev);
+int32_t as_led_stop_blinking(struct as_led_device *led);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
index edd071f..eb3612d 100644
--- a/target/packages/as_devices/c/as_max1027.h
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -18,36 +18,61 @@
*
*/
-#ifndef AS_MAX1027_H_
-#define AS_MAX1027_H_
+#ifndef __AS_MAX1027_H__
+#define __AS_MAX1027_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "as_adc.h"
-#define NUMBER_OF_CHANNELS (7)
-#define PATH_SIZE (50)
+#define NUMBER_OF_CHANNELS (7)
+#define PATH_SIZE (50)
typedef enum {
- AS_MAX1027_FAST,
- AS_MAX1027_SLOW
+ AS_MAX1027_FAST, /*!< Fast mode */
+ AS_MAX1027_SLOW /*!< Slow mode */
} AS_max1027_mode;
+/** @brief Structure to store max1027 parameters
+ *
+ */
struct as_max1027_device {
- AS_max1027_mode mode;
- uint8_t scan_mode;
- char path[PATH_SIZE];
+ AS_max1027_mode mode; /*!< mode/speed */
+ uint8_t scan_mode; /*!< ?? */
+ char path[PATH_SIZE]; /*!< ?? */
};
-struct as_adc_device *as_adc_open_max1027(int aDeviceNum, int aVRef);
-int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *aDev,
- int aChannel);
-int32_t as_adc_close_max1027(struct as_adc_device *aDev);
+/** @brief Initialize max1027 access
+ *
+ * @param num device number
+ * @param vref reference voltage
+ *
+ * @return pointer to device structure, NULL if error
+ */
+struct as_adc_device *as_adc_open_max1027(int num, int vref);
+
+/** @brief Get given max1027 channel voltage value
+ *
+ * @param max1027 chip handler
+ * @param channel channel to sample
+ *
+ * @return negative if error
+ */
+int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *max1027,
+ int channel);
+
+/** @brief Close given max1027 access
+ *
+ * @param max1027 chip handler
+ *
+ * @return negative if error
+ */
+int32_t as_adc_close_max1027(struct as_adc_device *max1027);
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /* AS_MAX1027_H_ */
+#endif /* __AS_MAX1027_H__ */
diff --git a/target/packages/as_devices/c/as_power_supply.h b/target/packages/as_devices/c/as_power_supply.h
index 394452c..c696e0b 100644
--- a/target/packages/as_devices/c/as_power_supply.h
+++ b/target/packages/as_devices/c/as_power_supply.h
@@ -22,7 +22,7 @@
#ifndef __ASPOWERSUPPLY_H__
#define __ASPOWERSUPPLY_H__
-#include <stdint.h>
+#include <stdint.h> /* uint32_t */
#ifdef __cplusplus
extern "C" {
@@ -30,10 +30,10 @@ extern "C" {
/**
- * Store power supplier parameters
+ * @brief Store power supplier parameters
*/
struct as_power_supply_device {
- char power_supply_name[32];
+ char power_supply_name[32]; /*!< device name */
int file_online;
int file_capacity;
int file_status;
diff --git a/target/packages/as_devices/c/as_pwm.h b/target/packages/as_devices/c/as_pwm.h
index fb44b78..3089abe 100644
--- a/target/packages/as_devices/c/as_pwm.h
+++ b/target/packages/as_devices/c/as_pwm.h
@@ -31,11 +31,14 @@ extern "C" {
/* number of pwm under system */
#define NUMBER_OF_PWM 2
+/** @brief Structure to handle PWM device
+ *
+ */
struct as_pwm_device {
- int fileFrequency;
- int filePeriod;
- int fileDuty;
- int fileActive;
+ int fileFrequency; /*!< file descriptor to set frequency */
+ int filePeriod; /*!< file descriptor to set period */
+ int fileDuty; /*!< file descriptor to set duty cycle */
+ int fileActive; /*!< file descriptor to activate PWM */
};
/** @brief Open pwm
diff --git a/target/packages/as_devices/c/as_tcs3472.h b/target/packages/as_devices/c/as_tcs3472.h
index 8065c7e..7dcf89c 100644
--- a/target/packages/as_devices/c/as_tcs3472.h
+++ b/target/packages/as_devices/c/as_tcs3472.h
@@ -27,15 +27,21 @@ extern "C" {
#include "as_i2c.h"
+/** @brief Structure to handle TCS3274 device
+ *
+ */
struct as_tcs3472 {
- struct as_i2c_device *i2c_dev;
+ struct as_i2c_device *i2c_dev; /*!< I2C bus handler */
};
+/** @brief Structure to store color results from TCS3274
+ *
+ */
struct as_tcs3472_colours {
- int clear;
- int red;
- int green;
- int blue;
+ int clear; /*!< Clear component */
+ int red; /*!< Red component */
+ int green; /*!< Green component */
+ int blue; /*!< Blue component */
};
/** @brief Initialize access to a TCS3472* chip
@@ -76,5 +82,5 @@ int32_t as_tcs3472_close(struct as_tcs3472 *tcs3472);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-#endif /* __AS_TCS3472_H__ */
+#endif /* __cplusplus */
+#endif /* __AS_TCS3472_H__ */
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-23 18:18:28
|
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 a0721960e6e3f8b7f4d8ea0bf7070fad8c0721be (commit)
via 201e2d90fac01b25953b05c5f19d359ae87e76f3 (commit)
from f4b9141b825d14a45b870cea31dea8e29e4e9cb2 (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 a0721960e6e3f8b7f4d8ea0bf7070fad8c0721be
Author: Julien Boibessot <jul...@ar...>
Date: Mon Jun 23 20:17:26 2014 +0200
[ASDEVICES] Lindent some C files
commit 201e2d90fac01b25953b05c5f19d359ae87e76f3
Author: Julien Boibessot <jul...@ar...>
Date: Mon Jun 23 18:58:37 2014 +0200
[BUILDROOT] 2013.11: fixes Tk build
-----------------------------------------------------------------------
Summary of changes:
.../2013.11/011-armadeus-add-tk-package.patch | 3 +-
target/packages/as_devices/c/as_adc.c | 127 +-
target/packages/as_devices/c/as_adc.h | 49 +-
target/packages/as_devices/c/as_dac.c | 70 +-
target/packages/as_devices/c/as_dac.h | 65 +-
target/packages/as_devices/c/as_helpers.c | 126 +-
target/packages/as_devices/c/as_helpers.h | 9 +-
target/packages/as_devices/main.c | 118 +-
target/packages/as_devices/test_c.h | 2101 ++++++++++----------
9 files changed, 1359 insertions(+), 1309 deletions(-)
diff --git a/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch b/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
index 3bb3ef5..e4bb262 100644
--- a/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
+++ b/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
@@ -39,7 +39,7 @@ Index: buildroot/package/tk/tk.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildroot/package/tk/tk.mk 2014-06-16 21:20:26.187716126 +0200
-@@ -0,0 +1,29 @@
+@@ -0,0 +1,30 @@
+################################################################################
+#
+# tk
@@ -52,6 +52,7 @@ Index: buildroot/package/tk/tk.mk
+TK_SITE = http://downloads.sourceforge.net/project/tcl/Tcl/$(TK_VERSION)
+TK_LICENSE = tcl license
+TK_LICENSE_FILES = license.terms
++TK_SUBDIR = unix
+TK_INSTALL_STAGING = YES
+TK_DEPENDENCIES = tcl xlib_libX11
+
diff --git a/target/packages/as_devices/c/as_adc.c b/target/packages/as_devices/c/as_adc.c
index c8755bb..1218515 100644
--- a/target/packages/as_devices/c/as_adc.c
+++ b/target/packages/as_devices/c/as_adc.c
@@ -21,17 +21,11 @@
#include <stdlib.h>
#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h> /* for close() */
-#include <sys/select.h>
+#include <unistd.h> /* close() */
#include <string.h>
-#include <sys/ioctl.h>
-#include <linux/ppdev.h>
-
#include "as_helpers.h"
#include "as_adc.h"
-
#include "as_max1027.h"
#include "as_as1531.h"
#include "as_adc_iio.h"
@@ -40,72 +34,67 @@
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
const char AS_MAX1027_NAME[] = "max1027";
-const char AS_AS1531_NAME[] = "as1531";
-const char AS_IIO_NAME[] = "iio";
+const char AS_AS1531_NAME[] = "as1531";
+const char AS_IIO_NAME[] = "iio";
struct as_adc_device *as_adc_open(const char *aAdcType,
- int aDeviceNum,
- int aVRef) {
- if (strncmp(AS_MAX1027_NAME,
- aAdcType,
- strlen(AS_MAX1027_NAME)) == 0)
- return as_adc_open_max1027(aDeviceNum, aVRef);
- if (strncmp(AS_AS1531_NAME,
- aAdcType,
- strlen(AS_AS1531_NAME)) == 0)
- return as_adc_open_as1531(aDeviceNum, aVRef);
- if (strncmp(AS_IIO_NAME,
- aAdcType,
- strlen(AS_IIO_NAME)) == 0)
- return as_adc_open_iio(aDeviceNum, aVRef);
-
- ERROR("Undefined ADC type '%s'\n",aAdcType);
- return NULL;
+ int aDeviceNum, int aVRef)
+{
+ if (strncmp(AS_MAX1027_NAME, aAdcType, strlen(AS_MAX1027_NAME)) == 0)
+ return as_adc_open_max1027(aDeviceNum, aVRef);
+ if (strncmp(AS_AS1531_NAME, aAdcType, strlen(AS_AS1531_NAME)) == 0)
+ return as_adc_open_as1531(aDeviceNum, aVRef);
+ if (strncmp(AS_IIO_NAME, aAdcType, strlen(AS_IIO_NAME)) == 0)
+ return as_adc_open_iio(aDeviceNum, aVRef);
+
+ ERROR("Undefined ADC type '%s'\n", aAdcType);
+ return NULL;
}
-int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev,
- int aChannel) {
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
-
- if (aDev->device_type == AS_MAX1027_NAME)
- return as_adc_get_value_in_millivolts_max1027(aDev, aChannel);
- if (aDev->device_type == AS_AS1531_NAME)
- return as_adc_get_value_in_millivolts_as1531(aDev, aChannel);
- if (aDev->device_type == AS_IIO_NAME)
- return as_adc_get_value_in_millivolts_iio(aDev, aChannel);
-
- ERROR("Undefined ADC type '%s'\n", aDev->device_type);
- return -1;
+int32_t as_adc_get_value_in_millivolts(struct as_adc_device * aDev,
+ int aChannel)
+{
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ if (aDev->device_type == AS_MAX1027_NAME)
+ return as_adc_get_value_in_millivolts_max1027(aDev, aChannel);
+ if (aDev->device_type == AS_AS1531_NAME)
+ return as_adc_get_value_in_millivolts_as1531(aDev, aChannel);
+ if (aDev->device_type == AS_IIO_NAME)
+ return as_adc_get_value_in_millivolts_iio(aDev, aChannel);
+
+ ERROR("Undefined ADC type '%s'\n", aDev->device_type);
+ return -1;
}
-int32_t as_adc_close(struct as_adc_device *aDev) {
- int ret;
-
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
-
- if (aDev->device_type == AS_MAX1027_NAME) {
- ret = as_adc_close_max1027(aDev);
- free(aDev);
- return ret;
- }
- if (aDev->device_type == AS_AS1531_NAME) {
- ret = as_adc_close_as1531(aDev);
- free(aDev);
- return ret;
- }
- if (aDev->device_type == AS_IIO_NAME) {
- ret = as_adc_close_iio(aDev);
- free(aDev);
- return ret;
- }
-
- ERROR("Undefined ADC type '%s'\n", aDev->device_type);
- return -1;
+int32_t as_adc_close(struct as_adc_device * aDev)
+{
+ int ret;
+
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ if (aDev->device_type == AS_MAX1027_NAME) {
+ ret = as_adc_close_max1027(aDev);
+ free(aDev);
+ return ret;
+ }
+ if (aDev->device_type == AS_AS1531_NAME) {
+ ret = as_adc_close_as1531(aDev);
+ free(aDev);
+ return ret;
+ }
+ if (aDev->device_type == AS_IIO_NAME) {
+ ret = as_adc_close_iio(aDev);
+ free(aDev);
+ return ret;
+ }
+
+ ERROR("Undefined ADC type '%s'\n", aDev->device_type);
+ return -1;
}
-
diff --git a/target/packages/as_devices/c/as_adc.h b/target/packages/as_devices/c/as_adc.h
index b3786da..6c58917 100644
--- a/target/packages/as_devices/c/as_adc.h
+++ b/target/packages/as_devices/c/as_adc.h
@@ -19,57 +19,58 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef __ASADC_H__
-#define __ASADC_H__
+#ifndef __AS_ADC_H__
+#define __AS_ADC_H__
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
extern const char AS_MAX1027_NAME[];
extern const char AS_AS1531_NAME[];
extern const char AS_IIO_NAME[];
-/**
- * Store adc parameters
+/** @brief Store ADC parameters
*/
struct as_adc_device {
- const char *device_type; /* Name of device type as1531 or max1027 */
- int device_num;
- int vref; /* reference tension in millivolts */
- void *chip_param; /* chip specific parameters */
+ const char *device_type; /*!< device type: "as1531" or "max1027" */
+ int device_num; /*!< device id on bus */
+ int vref; /*!< reference voltage in millivolts */
+ void *chip_param; /*!< private data for chip handler */
};
-/** @brief Initialize port access
+/** @brief Initialize ADC chip access
*
- * @param aDeviceNum device number
- * @param aAdcType ADC type 0:max1027 1:as1531
- * @param aVRef reference tension in millivolts
+ * @param device_num device number
+ * @param type ADC type: "max1027"/"as1531"/"iio"
+ * @param vref reference voltage in millivolts
*
* @return error if negative value
*/
-struct as_adc_device *as_adc_open(const char *aAdcType, int aDeviceNum, int aVRef);
+struct as_adc_device *as_adc_open(const char *type, int device_num,
+ int vref);
-/** @brief get value in millivolts
+/** @brief Get given ADC channel value in millivolts
*
- * @param aDev as_gpio_device pointer structure
+ * @param adc ADC handler
+ * @param channel channel to use
*
- * @return error if negative millivolts
+ * @return millivolts or error if negative
*/
-int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev, int aChannel);
+int32_t as_adc_get_value_in_millivolts(struct as_adc_device *adc,
+ int channel);
-/** @brief Close device
+/** @brief Close given ADC access
*
- * @param Adev as_adc_device pointer structure
+ * @param adc ADC handler
*
* @return error if negative
*/
-int32_t as_adc_close(struct as_adc_device *aDev);
+int32_t as_adc_close(struct as_adc_device *adc);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* __ASADC_H__ */
+#endif /* __cplusplus */
+#endif /* __AS_ADC_H__ */
diff --git a/target/packages/as_devices/c/as_dac.c b/target/packages/as_devices/c/as_dac.c
index ab36e3d..a9a71c2 100644
--- a/target/packages/as_devices/c/as_dac.c
+++ b/target/packages/as_devices/c/as_dac.c
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h> /* for close() */
+#include <unistd.h> /* close() */
#include <string.h>
#include "as_dac.h"
@@ -30,51 +30,45 @@
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-struct as_dac_device *as_dac_open(const char *aDacType, int aBusNumber,
- int aAddress, int aVRef)
+struct as_dac_device *as_dac_open(const char *dac_type, int bus,
+ int address, int vref)
{
- if (strncmp(AS_MAX5821_TYPE, aDacType, strlen(AS_MAX5821_TYPE)) == 0)
- return as_dac_open_max5821(aBusNumber, aAddress, aVRef);
- /* TODO: mcp4912 */
- ERROR("Undefined DAC type '%s'\n", aDacType);
- return NULL;
+ if (strncmp(AS_MAX5821_TYPE, dac_type, strlen(AS_MAX5821_TYPE)) == 0)
+ return as_dac_open_max5821(bus, address, vref);
+ /* TODO: mcp4912 */
+ ERROR("Undefined DAC type '%s'\n", dac_type);
+ return NULL;
}
-int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
- int aChannel,
- int aValue)
+int32_t as_dac_set_value_in_millivolts(struct as_dac_device * dac,
+ int channel, int value)
{
- if (aDev == NULL) {
- ERROR("Device is NULL\n");
- return -1;
- }
+ if (dac == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
- if (strncmp(AS_MAX5821_TYPE,
- aDev->device_type,
- strlen(AS_MAX5821_TYPE)) == 0) {
- if ((aChannel == 0) || (aChannel == 1))
- return as_dac_set_value_max5821(aDev,
- aChannel + 'A',
- aValue);
- else {
- ERROR("Wrong channel number %d\n",aChannel);
- return -1;
- }
- }
+ if (strncmp(AS_MAX5821_TYPE,
+ dac->device_type, strlen(AS_MAX5821_TYPE)) == 0) {
+ if ((channel == 0) || (channel == 1)) {
+ return as_dac_set_value_max5821(dac,
+ channel + 'A', value);
+ } else {
+ ERROR("Wrong channel number %d\n", channel);
+ return -1;
+ }
+ }
- ERROR("Undefined DAC type '%s'\n", aDev->device_type);
- return -1;
+ ERROR("Undefined DAC type '%s'\n", dac->device_type);
+ return -1;
}
-
-int32_t as_dac_close(struct as_dac_device *aDev)
+int32_t as_dac_close(struct as_dac_device * dac)
{
- if (strncmp(AS_MAX5821_TYPE,
- aDev->device_type,
- strlen(AS_MAX5821_TYPE)) == 0)
- as_dac_close_max5821(aDev);
+ if (strncmp(AS_MAX5821_TYPE,
+ dac->device_type, strlen(AS_MAX5821_TYPE)) == 0)
+ as_dac_close_max5821(dac);
- free(aDev);
- return 0;
+ free(dac);
+ return 0;
}
-
diff --git a/target/packages/as_devices/c/as_dac.h b/target/packages/as_devices/c/as_dac.h
index 8ace82b..140b968 100644
--- a/target/packages/as_devices/c/as_dac.h
+++ b/target/packages/as_devices/c/as_dac.h
@@ -14,71 +14,64 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * Copyright (C) 2011 Fabien Marteau <fab...@ar...>
+ * Copyright (C) 2011-2014 The Armadeus Project & Armadeus Systems teams
+ * Author: Fabien Marteau <fab...@ar...>
*
*/
-
-#ifndef AS_DAC_H_
-#define AS_DAC_H_
+#ifndef __AS_DAC_H__
+#define __AS_DAC_H__
#ifdef __cplusplus
extern "C" {
#endif
-#include "as_dac.h"
-#include <stdint.h>
-
#define AS_MAX5821_TYPE "max5821"
#define AS_MCP4912
-/**
- * Store dac parameters
+/** @brief Store DAC parameters
+ *
*/
struct as_dac_device {
- int bus_number;
- int chip_address;
- int vref;
- const char *device_type;
- void *chip_param;
+ int bus_number; /*!< bus number */
+ int chip_address; /*!< chip address on bus */
+ int vref; /*!< reference voltage */
+ const char *device_type; /*!< device type: "max5821" or "mcp4912" */
+ void *chip_param; /*!< private data for chip handler */
};
-/** @brief Open dac
+/** @brief Initialize DAC chip access
*
- * @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
+ * @param dac_type type of DAC ("max5821" or "mcp4912")
+ * @param bus bus number used (I2C/SPI)
+ * @param address I2C address for I2C chip, and CS number for SPI chip
+ * @param vref voltage reference in milivolt
*
* @return as_dac_device structure pointer on success, NULL on error
*/
-struct as_dac_device *as_dac_open(const char *aDacType, int aBusNumber,
- int aAddress, int aVRef);
+struct as_dac_device *as_dac_open(const char *dac_type, int bus,
+ int address, int vref);
-
-/** @brief set a channel value.
+/** @brief Set a DAC channel to given value
*
- * @param aDev structure pointer of dac device
- * @param aChannel channel number (A:0, B:1,...)
- * @param aValue channel value in milivolt
+ * @param dac handler of the DAC device
+ * @param channel channel number (A:0, B:1,...)
+ * @param value channel value in milivolt
*
* @return negative value on error
*/
-int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
- int aChannel,
- int aValue);
+int32_t as_dac_set_value_in_millivolts(struct as_dac_device *dac,
+ int channel, int value);
-/** @brief close device
+/** @brief Close DAC device access
*
- * @param aDev structure pointer of dac device
+ * @param dac handler of DAC device
*
* @return negative value on error
*/
-int32_t as_dac_close(struct as_dac_device *aDev);
+int32_t as_dac_close(struct as_dac_device *dac);
#ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* AS_DAC_H_ */
+#endif /* __cplusplus */
+#endif /* __AS_DAC_H__ */
diff --git a/target/packages/as_devices/c/as_helpers.c b/target/packages/as_devices/c/as_helpers.c
index 068a64a..fe4d902 100644
--- a/target/packages/as_devices/c/as_helpers.c
+++ b/target/packages/as_devices/c/as_helpers.c
@@ -1,8 +1,8 @@
/*
** AsDevices - Helpers functions for other modules
**
-** Copyright (C) 2009-2010 The armadeus systems team
-** Fabien Marteau <fab...@ar...>
+** Copyright (C) 2009-2014 The Armadeus Project & Armadeus Systems teams
+** Author: Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
@@ -19,11 +19,10 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h> /* for open() */
-#include <unistd.h> /* for write() */
+#include <unistd.h> /* write()/lseek()/read() */
+#include <string.h>
/* #define DEBUG */
#include "as_helpers.h"
@@ -33,85 +32,84 @@
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-
int as_write_buffer(int fd, int value)
{
- int ret;
- char buffer[16];
- int buffer_len;
+ int ret;
+ char buffer[16];
+ int buffer_len;
- ret = snprintf(buffer, 16, "%d\n", value);
- if (ret < 0)
- return ret;
+ ret = snprintf(buffer, 16, "%d\n", value);
+ if (ret < 0)
+ return ret;
- buffer_len = strlen(buffer);
- ret = write(fd, buffer, buffer_len);
+ buffer_len = strlen(buffer);
+ ret = write(fd, buffer, buffer_len);
//XXX if (ret < 0) {
//XXX ERROR("Can't write file, buffer lenght %d $>%s<$\n", buffer_len, buffer);
//XXX return ret;
//XXX }
- ret = lseek(fd, 0, SEEK_SET);
- if (ret < 0) {
- ERROR("lseek error\n");
- return ret;
- }
+ ret = lseek(fd, 0, SEEK_SET);
+ if (ret < 0) {
+ ERROR("lseek error\n");
+ return ret;
+ }
- return buffer_len;
+ return buffer_len;
}
int as_write_buffer_string(int fd, char *string)
{
- int ret;
- int string_len;
-
- string_len = strlen(string);
- ret = write(fd, string, string_len);
- if (ret < 0) {
- ERROR("Can't write file ");
- return ret;
- }
- ret = lseek(fd, 0, SEEK_SET);
- if (ret < 0) {
- ERROR("lseek error ");
- return ret;
- }
-
- return string_len;
+ int ret;
+ int string_len;
+
+ string_len = strlen(string);
+ ret = write(fd, string, string_len);
+ if (ret < 0) {
+ ERROR("Can't write file ");
+ return ret;
+ }
+ ret = lseek(fd, 0, SEEK_SET);
+ if (ret < 0) {
+ ERROR("lseek error ");
+ return ret;
+ }
+
+ return string_len;
}
int as_read_buffer(int fd, char *buf, int size)
{
- int ret, err;
-
- ret = read(fd, buf, size);
- if (ret < 0) {
- ERROR("Can't read file ");
- return ret;
- }
- err = lseek(fd, 0, SEEK_SET);
- if (err < 0) {
- ERROR("lseek error ");
- return err;
- }
-
- return ret;
+ int ret, err;
+
+ ret = read(fd, buf, size);
+ if (ret < 0) {
+ ERROR("Can't read file ");
+ return ret;
+ }
+ err = lseek(fd, 0, SEEK_SET);
+ if (err < 0) {
+ ERROR("lseek error ");
+ return err;
+ }
+
+ return ret;
}
int as_read_int(int fd, int *value_res)
{
- const int SIZEOFBUFF = 20;
- ssize_t ret;
- char buf[SIZEOFBUFF];
- int value;
-
- ret = as_read_buffer(fd, buf, SIZEOFBUFF);
- if (ret < 0)
- return ret;
- buf[ret-1] = '\0';
- value = strtol(buf, NULL, 10);
- *value_res = value;
-
- return 0;
+ const int SIZEOFBUFF = 20;
+ ssize_t ret;
+ char buf[SIZEOFBUFF];
+ int value;
+
+ ret = as_read_buffer(fd, buf, SIZEOFBUFF);
+ if (ret < 0)
+ return ret;
+ buf[ret - 1] = '\0';
+ value = strtol(buf, NULL, 10);
+ *value_res = value;
+
+ return 0;
}
int as_helpers_get_platform(void)
@@ -138,7 +136,7 @@ int as_helpers_get_platform(void)
char *as_helpers_get_root()
{
- char * root;
+ char *root;
root = getenv("AS_DEVICES_ROOT");
if (root)
diff --git a/target/packages/as_devices/c/as_helpers.h b/target/packages/as_devices/c/as_helpers.h
index c558db3..3e8bd64 100644
--- a/target/packages/as_devices/c/as_helpers.h
+++ b/target/packages/as_devices/c/as_helpers.h
@@ -1,8 +1,8 @@
/*
** AsDevices - Helpers functions for other modules
**
-** Copyright (C) 2009-2010 The armadeus systems team
-** Fabien Marteau <fab...@ar...>
+** Copyright (C) 2009-2014 The Armadeus Project & Armadeus Systems teams
+** Author: Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
@@ -26,9 +26,9 @@
#include <stdlib.h>
#ifdef DEBUG
-# define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
-# define ERROR(fmt, ...) /*fmt, ##__VA_ARGS__*/
+#define ERROR(fmt, ...) /*fmt, ##__VA_ARGS__ */
#endif
/** @brief Write an int value as string in a /sys/ or /proc interface
@@ -91,4 +91,3 @@ enum {
};
#endif /* __ASHELPERS_H__ */
-
diff --git a/target/packages/as_devices/main.c b/target/packages/as_devices/main.c
index e1c5053..ec88275 100644
--- a/target/packages/as_devices/main.c
+++ b/target/packages/as_devices/main.c
@@ -20,63 +20,73 @@
*/
#ifdef __cplusplus
-# include "test_cpp.h"
+#include "test_cpp.h"
#else
-# include "test_c.h"
+#include "test_c.h"
#endif
-int main(int argc, char ** argv)
+int main(int argc, char **argv)
{
- char buffer[20];
- buffer[0] = '0';
+ char buffer[20];
+ buffer[0] = '0';
- while(buffer[0] != 'q')
- {
- system("clear");
- printf("*******************************************************\n");
- printf("* Testing program for as_devices library *\n");
- printf("*******************************************************\n");
- printf("Choose a test ('q' to quit):\n");
- printf(" 1) pwm\n");
- printf(" 2) i2c\n");
- printf(" 3) spi\n");
- printf(" 4) 93LCxx eeprom\n");
- printf(" 5) gpio\n");
- printf(" 6) max1027\n");
- printf(" 7) max5821\n");
- printf(" 8) as1531\n");
- printf(" 9) backlight\n");
- printf(" a) i2c eeprom\n");
- printf(" b) tcs3472\n");
- printf("> ");
- scanf("%s",buffer);
-
- switch(buffer[0])
- {
- case '1' : test_pwm();
- break;
- case '2' : test_i2c();
- break;
- case '3' : test_spi();
- break;
- case '4' : test_93LC();
- break;
- case '5' : test_gpio();
- break;
- case '6' : test_max1027();
- break;
- case '7' : test_max5821();
- break;
- case '8' : test_as1531();
- break;
- case '9' : test_backlight();
- break;
- case 'a': test_i2c_eeprom();
- break;
- case 'b': test_tcs3472();
- break;
- default : break;
- }
- }
- return 0;
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("**********************************************\n");
+ printf("* Testing program for as_devices library *\n");
+ printf("**********************************************\n");
+ printf("Choose a test ('q' to quit):\n");
+ printf(" 1) pwm\n");
+ printf(" 2) i2c\n");
+ printf(" 3) spi\n");
+ printf(" 4) 93LCxx eeprom\n");
+ printf(" 5) gpio\n");
+ printf(" 6) max1027\n");
+ printf(" 7) max5821\n");
+ printf(" 8) as1531\n");
+ printf(" 9) backlight\n");
+ printf(" a) i2c eeprom\n");
+ printf(" b) tcs3472\n");
+ printf("> ");
+ scanf("%s", buffer);
+
+ switch (buffer[0]) {
+ case '1':
+ test_pwm();
+ break;
+ case '2':
+ test_i2c();
+ break;
+ case '3':
+ test_spi();
+ break;
+ case '4':
+ test_93LC();
+ break;
+ case '5':
+ test_gpio();
+ break;
+ case '6':
+ test_max1027();
+ break;
+ case '7':
+ test_max5821();
+ break;
+ case '8':
+ test_as1531();
+ break;
+ case '9':
+ test_backlight();
+ break;
+ case 'a':
+ test_i2c_eeprom();
+ break;
+ case 'b':
+ test_tcs3472();
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index e294806..02ef5af 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h> /* sleep */
+#include <unistd.h> /* sleep */
#include <math.h>
#include "as_pwm.h"
@@ -43,1086 +43,1151 @@
void press_enter_to_continue(void)
{
- printf("\nPress enter to continue\n");
- while( getc(stdin) != '\n');
- while( getc(stdin) != '\n');
+ printf("\nPress enter to continue\n");
+ while (getc(stdin) != '\n') ;
+ while (getc(stdin) != '\n') ;
}
/* pwm test */
void test_pwm(void)
{
- int ret;
- char buffer[20];
- char buffer2[20];
- int value;
- struct as_pwm_device *pwm_dev;
-
- pwm_dev = as_pwm_open(PWM_NUM);
- if (pwm_dev == NULL) {
- printf("can't init pwm0\n");
- press_enter_to_continue();
- return;
- }
- while (buffer[0] != 'q') {
- system("clear");
- printf("*********************************\n");
- printf("* Testing pwm menu *\n");
- printf("*********************************\n");
- printf("Choose ('q' to quit):\n");
- printf(" 1) set Frequency\n");
- printf(" 2) get Frequency\n");
- printf(" 3) set Period\n");
- printf(" 4) get Period\n");
- printf(" 5) set Duty\n");
- printf(" 6) get Duty\n");
- printf(" 7) activate/desactivate\n");
- printf(" 8) get state\n");
- printf("> ");
- scanf("%s", buffer);
-
- switch (buffer[0])
- {
- case '1' : printf("Give frequency :");
- scanf("%d",&value);
- as_pwm_set_frequency(pwm_dev,value);
- press_enter_to_continue();
- break;
- case '2' : printf("Current pwm frequency is %d\n",
- as_pwm_get_frequency(pwm_dev));
- press_enter_to_continue();
- break;
- case '3' : printf("Give period :");
- scanf("%d", &value);
- as_pwm_set_period(pwm_dev, value);
- press_enter_to_continue();
- break;
- case '4' : printf("Current period is %d\n",
- as_pwm_get_period(pwm_dev));
- press_enter_to_continue();
- break;
- case '5' : printf("Give Duty :");
- scanf("%d", &value);
- as_pwm_set_duty(pwm_dev, value);
- press_enter_to_continue();
- break;
- case '6' : printf("Current Duty is %d\n",
- as_pwm_get_duty(pwm_dev));
- press_enter_to_continue();
- break;
- case '7' : printf("Activate 'a' or Desactivate 'd' ?");
- scanf("%s", buffer2);
- if (buffer2[0] == 'a') {
- as_pwm_set_state(pwm_dev, 1);
- printf("Pwm activated\n");
- press_enter_to_continue();
- } else if (buffer2[0] == 'd') {
- as_pwm_set_state(pwm_dev, 0);
- printf("Pwm desactivated\n");
- press_enter_to_continue();
- } else {
- printf("Option %c unknown\n",buffer[0]);
- press_enter_to_continue();
- }
- break;
- case '8' : if (as_pwm_get_state(pwm_dev)) {
- printf("pwm is active\n");
- press_enter_to_continue();
- } else {
- printf("pwm is inactive\n");
- press_enter_to_continue();
- }
- break;
- default : break;
- }
- }
- ret = as_pwm_close(pwm_dev);
- if (ret < 0) {
- printf("can't close pwm0\n");
- return;
- }
+ int ret;
+ char buffer[20];
+ char buffer2[20];
+ int value;
+ struct as_pwm_device *pwm_dev;
+
+ pwm_dev = as_pwm_open(PWM_NUM);
+ if (pwm_dev == NULL) {
+ printf("can't init pwm0\n");
+ press_enter_to_continue();
+ return;
+ }
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("*********************************\n");
+ printf("* Testing pwm menu *\n");
+ printf("*********************************\n");
+ printf("Choose ('q' to quit):\n");
+ printf(" 1) set Frequency\n");
+ printf(" 2) get Frequency\n");
+ printf(" 3) set Period\n");
+ printf(" 4) get Period\n");
+ printf(" 5) set Duty\n");
+ printf(" 6) get Duty\n");
+ printf(" 7) activate/desactivate\n");
+ printf(" 8) get state\n");
+ printf("> ");
+ scanf("%s", buffer);
+
+ switch (buffer[0]) {
+ case '1':
+ printf("Give frequency :");
+ scanf("%d", &value);
+ as_pwm_set_frequency(pwm_dev, value);
+ press_enter_to_continue();
+ break;
+ case '2':
+ printf("Current pwm frequency is %d\n",
+ as_pwm_get_frequency(pwm_dev));
+ press_enter_to_continue();
+ break;
+ case '3':
+ printf("Give period :");
+ scanf("%d", &value);
+ as_pwm_set_period(pwm_dev, value);
+ press_enter_to_continue();
+ break;
+ case '4':
+ printf("Current period is %d\n",
+ as_pwm_get_period(pwm_dev));
+ press_enter_to_continue();
+ break;
+ case '5':
+ printf("Give Duty :");
+ scanf("%d", &value);
+ as_pwm_set_duty(pwm_dev, value);
+ press_enter_to_continue();
+ break;
+ case '6':
+ printf("Current Duty is %d\n",
+ as_pwm_get_duty(pwm_dev));
+ press_enter_to_continue();
+ break;
+ case '7':
+ printf("Activate 'a' or Desactivate 'd' ?");
+ scanf("%s", buffer2);
+ if (buffer2[0] == 'a') {
+ as_pwm_set_state(pwm_dev, 1);
+ printf("Pwm activated\n");
+ press_enter_to_continue();
+ } else if (buffer2[0] == 'd') {
+ as_pwm_set_state(pwm_dev, 0);
+ printf("Pwm desactivated\n");
+ press_enter_to_continue();
+ } else {
+ printf("Option %c unknown\n", buffer[0]);
+ press_enter_to_continue();
+ }
+ break;
+ case '8':
+ if (as_pwm_get_state(pwm_dev)) {
+ printf("pwm is active\n");
+ press_enter_to_continue();
+ } else {
+ printf("pwm is inactive\n");
+ press_enter_to_continue();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ ret = as_pwm_close(pwm_dev);
+ if (ret < 0) {
+ printf("can't close pwm0\n");
+ return;
+ }
}
/* i2c bus test */
void test_i2c(void)
{
- char buffer[20];
- int value;
- int initialized = 0;
-
- struct as_i2c_device *i2c_bus = 0;
- int i2c_id = 0;
-
- while (buffer[0] != 'q') {
- system("clear");
- printf("*********************************\n");
- printf("* Testing i2c menu *\n");
- printf("*********************************\n");
- printf("Choose ('q' to quit):\n");
- if (initialized == 0) {
- printf(" 1) Open i2c bus \n");
- printf(" 2) Change bus number (%d)\n",i2c_id);
- } else {
- printf(" 1) Close i2c bus \n");
- }
- printf("> ");
- scanf("%s",buffer);
-
- if (initialized == 0)
- {
- switch(buffer[0])
- {
- case '1' : printf("Open i2c bus\n");
- i2c_bus = as_i2c_open( i2c_id);
- if (i2c_bus < 0)
- {
- printf("Error can't open i2c bus\n");
- } else {
- printf("Bus %d opened\n", i2c_id);
- initialized = 1;
- }
- press_enter_to_continue();
- break;
- case '2' : printf("Give bus number (max %d): ", sizeof(_STR(AS_I2C_DEV_COUNT))-1);
- scanf("%d",&value);
- if ((value >= sizeof(_STR(AS_I2C_DEV_COUNT))) || (value < 0))
- {
- printf(" Wrong value\n");
- } else {
- i2c_id = value;
- }
- press_enter_to_continue();
- default : break;
- }
- } else {
- switch(buffer[0])
- {
- case '1' : printf("Close i2c bus\n");
- value = as_i2c_close(i2c_bus);
- if (value < 0)
- {
- printf(" Error, can't close i2c bus num %d\n", i2c_id);
- } else {
- initialized = 0;
- }
- press_enter_to_continue();
- break;
- default : break;
- }
- }
- }
+ char buffer[20];
+ int value;
+ int initialized = 0;
+
+ struct as_i2c_device *i2c_bus = 0;
+ int i2c_id = 0;
+
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("*********************************\n");
+ printf("* Testing i2c menu *\n");
+ printf("*********************************\n");
+ printf("Choose ('q' to quit):\n");
+ if (initialized == 0) {
+ printf(" 1) Open i2c bus \n");
+ printf(" 2) Change bus number (%d)\n", i2c_id);
+ } else {
+ printf(" 1) Close i2c bus \n");
+ }
+ printf("> ");
+ scanf("%s", buffer);
+
+ if (initialized == 0) {
+ switch (buffer[0]) {
+ case '1':
+ printf("Open i2c bus\n");
+ i2c_bus = as_i2c_open(i2c_id);
+ if (i2c_bus < 0) {
+ printf("Error can't open i2c bus\n");
+ } else {
+ printf("Bus %d opened\n", i2c_id);
+ initialized = 1;
+ }
+ press_enter_to_continue();
+ break;
+ case '2':
+ printf("Give bus number (max %d): ",
+ sizeof(_STR(AS_I2C_DEV_COUNT)) - 1);
+ scanf("%d", &value);
+ if ((value >= sizeof(_STR(AS_I2C_DEV_COUNT)))
+ || (value < 0)) {
+ printf(" Wrong value\n");
+ } else {
+ i2c_id = value;
+ }
+ press_enter_to_continue();
+ default:
+ break;
+ }
+ } else {
+ switch (buffer[0]) {
+ case '1':
+ printf("Close i2c bus\n");
+ value = as_i2c_close(i2c_bus);
+ if (value < 0) {
+ printf
+ (" Error, can't close i2c bus num %d\n",
+ i2c_id);
+ } else {
+ initialized = 0;
+ }
+ press_enter_to_continue();
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
/* spi bus test */
void test_spi(void)
{
- printf("TODO\n");
- press_enter_to_continue();
+ printf("TODO\n");
+ press_enter_to_continue();
}
-
/* 93LCxx eepromm test */
int address_size(int aType, int aWordSize)
{
- return (((aType-46)/10) + 6 + 2 - (aWordSize/8));
+ return (((aType - 46) / 10) + 6 + 2 - (aWordSize / 8));
}
int max_address(int aType, int aWordSize)
{
- return (pow(2,address_size(aType, aWordSize))-1);
+ return (pow(2, address_size(aType, aWordSize)) - 1);
}
void test_93LC()
{
- char buffer[50];
- int i;
-
- int type = 46;
- char spidevpath[50];
- struct as_93lcxx_device *dev;
- /* defaults values */
- int frequency = 1000000;
- uint8_t word_size = 8;
- int value, value2;
- int initialized=0;
- snprintf(spidevpath, 50, "%s", "/dev/spidev2.0");
-
- while(buffer[0] != 'q')
- {
- system("clear");
- printf("*********************************\n");
- printf("* Testing 93LCxx menu *\n");
- printf("*********************************\n");
- printf("Choose ('q' to quit):\n");
- if (initialized == 0)
- {
- printf(" 1) Change word size (%d)\n", word_size);
- printf(" 2) Change bus frequency (%d)\n", frequency);
- printf(" 3) Change eeprom type (%d)\n", type);
- printf(" 4) Change spidev path (%s)\n", spidevpath);
- printf(" 5) Initialize eeprom\n");
- } else {
- printf(" 1) Close eeprom\n");
- printf(" 2) Read specific address\n");
- printf(" 3) Erase specific address\n");
- printf(" 4) Write specific address\n");
- printf(" 5) Write all\n");
- printf(" 6) Read all\n");
- printf(" 7) Erase all\n");
- printf(" 8) Unlock write\n");
- printf(" 9) lock write\n");
- }
-
- printf("> ");
- scanf("%s",buffer);
-
- if (initialized == 0)
- {
- switch(buffer[0])
- {
- case '1' : printf("Give new word size (8 or 16) : ");
- scanf("%d", &value);
- if ( (value != 8) && (value != 16) )
- {
- printf("Wrong value\n");
- press_enter_to_continue();
- } else {
- word_size = value;
- }
- break;
- case '2' : printf("Give bus frequency : ");
- scanf("%d", &value);
- frequency = value;
- printf("Frequency changed to %dHz\n",frequency);
- break;
- case '3' : printf("Give new type of eeprom (46, 56 or 66) : ");
- scanf("%d", &value);
- if ( (value != 46) && (value != 56) && (value != 66) )
- {
- printf("Wrong value\n");
- press_enter_to_continue();
- } else {
- type = value;
- }
- break;
- case '4' : printf("Give new path for spidev : \n");
- scanf("%s", spidevpath);
- printf("New path is %s\n",spidevpath);
- break;
- case '5' : dev = as_93lcxx_open((unsigned char *)spidevpath,
- type,
- frequency,
- word_size);
- if (dev == NULL)
- {
- printf("Error, can't initialize eeprom. Have you modprobed spidev ?\n");
- } else {
- initialized = 1;
- }
- press_enter_to_continue();
- break;
- default : break;
- }
- } else {
- switch(buffer[0])
- {
- case '1' : as_93lcxx_close(dev);
- printf("eeprom closed\n");
- initialized = 0;
- press_enter_to_continue();
- break;
- case '2' : printf(" Read specific address\n");
- printf("Give address in hexadecimal (max 0x%03X):",
- max_address(type, word_size));
- scanf("%x",&value);
- if (value > max_address(type, word_size))
- {
- printf(" Error, address wrong\n");
- } else {
- value2 = as_93lcxx_read(dev, value);
- if (value2 < 0)
- {
- printf("Error, can't read value\n");
- } else {
- printf(" Read %02x at %02X", value2, value );
- }
- }
- press_enter_to_continue();
- break;
- case '3' : printf("Erase specific address\n");
- printf("Give address in hexadecimal (max 0x%03X):",
- max_address(type, word_size));
- scanf("%x",&value);
- if (value > max_address(type, word_size))
- {
- printf(" Error, address wrong\n");
- } else {
- value2 = as_93lcxx_erase(dev, value);
- if (value2 < 0)
- {
- printf("Error, can't erase value\n");
- } else {
- printf("Value erased\n");
- }
- }
- press_enter_to_continue();
- break;
- case '4' : printf("Write specific address\n");
- printf("Give address in hexadecimal (max 0x%03X):",
- max_address(type, word_size));
- scanf("%x",&value);
- if (value > max_address(type, word_size))
- {
- printf(" Error, address wrong\n");
- press_enter_to_continue();
- break;
- }
- printf("Give value in hexadecimal :");
- scanf("%x",&value2);
- value2 = as_93lcxx_write(dev, value, value2);
- if (value2 < 0)
- {
- printf("Error, can't write value\n");
- }
- press_enter_to_continue();
- break;
- case '5' : printf(" Write all\n");
- printf("Give value in hexadecimal:");
- scanf("%x",&value);
- value2 = as_93lcxx_write_all(dev, value);
- if (value2 < 0)
- {
- printf("Error, can't write value\n");
- }
- press_enter_to_continue();
- break;
- case '6' : printf(" Read all\n");
- for(i = 0; i <= max_address(type, word_size); i++)
- {
- if (word_size == 8)
- {
- printf("%03X -> %02X\n",
- i,as_93lcxx_read(dev, i));
- } else{
- printf("%03X -> %04X\n",
- i,as_93lcxx_read(dev, i));
- }
- }
- press_enter_to_continue();
- break;
- case '7' : printf(" Erase all\n");
- value = as_93lcxx_erase_all(dev);
- if (value < 0)
- printf(" Error in erasing eeprom\n");
- press_enter_to_continue();
- break;
- case '8' : printf("Unlock write\n");
- if (as_93lcxx_ewen(dev) < 0)
- printf("Error can't unlock write\n");
- press_enter_to_continue();
- break;
- case '9' : printf("lock write\n");
- if (as_93lcxx_ewds(dev) < 0)
- printf("Error can't lock write\n");
- press_enter_to_continue();
- break;
- default : break;
- }
- }
- }
+ char buffer[50];
+ int i;
+
+ int type = 46;
+ char spidevpath[50];
+ struct as_93lcxx_device *dev;
+ /* defaults values */
+ int frequency = 1000000;
+ uint8_t word_size = 8;
+ int value, value2;
+ int initialized = 0;
+ snprintf(spidevpath, 50, "%s", "/dev/spidev2.0");
+
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("*********************************\n");
+ printf("* Testing 93LCxx menu *\n");
+ printf("*********************************\n");
+ printf("Choose ('q' to quit):\n");
+ if (initialized == 0) {
+ printf(" 1) Change word size (%d)\n", word_size);
+ printf(" 2) Change bus frequency (%d)\n", frequency);
+ printf(" 3) Change eeprom type (%d)\n", type);
+ printf(" 4) Change spidev path (%s)\n", spidevpath);
+ printf(" 5) Initialize eeprom\n");
+ } else {
+ printf(" 1) Close eeprom\n");
+ printf(" 2) Read specific address\n");
+ printf(" 3) Erase specific address\n");
+ printf(" 4) Write specific address\n");
+ printf(" 5) Write all\n");
+ printf(" 6) Read all\n");
+ printf(" 7) Erase all\n");
+ printf(" 8) Unlock write\n");
+ printf(" 9) lock write\n");
+ }
+
+ printf("> ");
+ scanf("%s", buffer);
+
+ if (initialized == 0) {
+ switch (buffer[0]) {
+ case '1':
+ printf("Give new word size (8 or 16) : ");
+ scanf("%d", &value);
+ if ((value != 8) && (value != 16)) {
+ printf("Wrong value\n");
+ press_enter_to_continue();
+ } else {
+ word_size = value;
+ }
+ break;
+ case '2':
+ printf("Give bus frequency : ");
+ scanf("%d", &value);
+ frequency = value;
+ printf("Frequency changed to %dHz\n",
+ frequency);
+ break;
+ case '3':
+ printf
+ ("Give new type of eeprom (46, 56 or 66) : ");
+ scanf("%d", &value);
+ if ((value != 46) && (value != 56)
+ && (value != 66)) {
+ printf("Wrong value\n");
+ press_enter_to_continue();
+ } else {
+ type = value;
+ }
+ break;
+ case '4':
+ printf("Give new path for spidev : \n");
+ scanf("%s", spidevpath);
+ printf("New path is %s\n", spidevpath);
+ break;
+ case '5':
+ dev =
+ as_93lcxx_open((unsigned char *)spidevpath,
+ type, frequency, word_size);
+ if (dev == NULL) {
+ printf
+ ("Error, can't initialize eeprom. Have you modprobed spidev ?\n");
+ } else {
+ initialized = 1;
+ }
+ press_enter_to_continue();
+ break;
+ default:
+ break;
+ }
+ } else {
+ switch (buffer[0]) {
+ case '1':
+ as_93lcxx_close(dev);
+ printf("eeprom closed\n");
+ initialized = 0;
+ press_enter_to_continue();
+ break;
+ case '2':
+ printf(" Read specific address\n");
+ printf
+ ("Give address in hexadecimal (max 0x%03X):",
+ max_address(type, word_size));
+ scanf("%x", &value);
+ if (value > max_address(type, word_size)) {
+ printf(" Error, address wrong\n");
+ } else {
+ value2 = as_93lcxx_read(dev, value);
+ if (value2 < 0) {
+ printf
+ ("Error, can't read value\n");
+ } else {
+ printf(" Read %02x at %02X",
+ value2, value);
+ }
+ }
+ press_enter_to_continue();
+ break;
+ case '3':
+ printf("Erase specific address\n");
+ printf
+ ("Give address in hexadecimal (max 0x%03X):",
+ max_address(type, word_size));
+ scanf("%x", &value);
+ if (value > max_address(type, word_size)) {
+ printf(" Error, address wrong\n");
+ } else {
+ value2 = as_93lcxx_erase(dev, value);
+ if (value2 < 0) {
+ printf
+ ("Error, can't erase value\n");
+ } else {
+ printf("Value erased\n");
+ }
+ }
+ press_enter_to_continue();
+ break;
+ case '4':
+ printf("Write specific address\n");
+ printf
+ ("Give address in hexadecimal (max 0x%03X):",
+ max_address(type, word_size));
+ scanf("%x", &value);
+ if (value > max_address(type, word_size)) {
+ printf(" Error, address wrong\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Give value in hexadecimal :");
+ scanf("%x", &value2);
+ value2 = as_93lcxx_write(dev, value, value2);
+ if (value2 < 0) {
+ printf("Error, can't write value\n");
+ }
+ press_enter_to_continue();
+ break;
+ case '5':
+ printf(" Write all\n");
+ printf("Give value in hexadecimal:");
+ scanf("%x", &value);
+ value2 = as_93lcxx_write_all(dev, value);
+ if (value2 < 0) {
+ printf("Error, can't write value\n");
+ }
+ press_enter_to_continue();
+ break;
+ case '6':
+ printf(" Read all\n");
+ for (i = 0; i <= max_address(type, word_size);
+ i++) {
+ if (word_size == 8) {
+ printf("%03X -> %02X\n",
+ i, as_93lcxx_read(dev,
+ i));
+ } else {
+ printf("%03X -> %04X\n",
+ i, as_93lcxx_read(dev,
+ i));
+ }
+ }
+ press_enter_to_continue();
+ break;
+ case '7':
+ printf(" Erase all\n");
+ value = as_93lcxx_erase_all(dev);
+ if (value < 0)
+ printf(" Error in erasing eeprom\n");
+ press_enter_to_continue();
+ break;
+ case '8':
+ printf("Unlock write\n");
+ if (as_93lcxx_ewen(dev) < 0)
+ printf("Error can't unlock write\n");
+ press_enter_to_continue();
+ break;
+ case '9':
+ printf("lock write\n");
+ if (as_93lcxx_ewds(dev) < 0)
+ printf("Error can't lock write\n");
+ press_enter_to_continue();
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
void test_gpio()
{
- char buffer[50];
- struct as_gpio_device *gpio_dev;
- int32_t ret;
- int32_t value;
- int pin_num = 173; /* default: PF13 */
- int pin_value = 1, platform;
-
- platform = as_helpers_get_platform();
- switch (platform) {
- case APF9328:
- pin_num = 0x007;
- break;
- case APF27:
- pin_num = 173;
- break;
- case APF51:
- pin_num = 3;
- break;
- default:
- break;
- }
-
- gpio_dev = as_gpio_open(pin_num);
- if (gpio_dev == NULL) {
- printf("Error can't open gpio %d\nHave you got gpiolib ?\n", pin_num);
- press_enter_to_continue();
- return ;
- }
-
- pin_value = as_gpio_get_pin_value(gpio_dev);
- if (pin_value < 0) {
- printf("Error, can't get pin value\n");
- return;
- }
-
- while(buffer[0] != 'q')
- {
- system("clear");
- printf("**************************\n");
- printf(" Testing GPIO Port%d \n", pin_num);
- printf("**************************\n");
- printf("Choose ('q' to quit):\n");
- printf(" 1) Change gpio (%d)\n", as_gpio_get_pin_num(gpio_dev));
- printf(" 2) Change direction (%s)\n", as_gpio_get_pin_direction(gpio_dev));
- printf(" 3) Change value (%d)\n", as_gpio_get_pin_value(gpio_dev));
- printf(" 4) Read pin value\n");
- printf(" 5) Set irq/event mode (%s)\n", as_gpio_get_irq_mode(gpio_dev));
- printf(" a) Wait an event\n");
-
- printf("> ");
- scanf("%s",buffer);
-
- switch (buffer[0])
- {
- case '1' : printf("Give pin number : ");
- scanf("%d", &pin_num);
-
- gpio_dev = as_gpio_open(pin_num);
- if (gpio_dev == NULL)
- {
- printf("Error, can't open %d\n", pin_num);
- press_enter_to_continue();
- break;
- }
- printf("Ok %d is open\n", pin_num);
- press_enter_to_continue();
- break;
- case '2' : printf("Give direction (in/out) : ");
- scanf("%s", buffer);
- ret = as_gpio_set_pin_direction(gpio_dev, buffer);
- if (ret < 0)
- {
- printf("Error, can't change direction\n");
- press_enter_to_continue();
- break;
- }
- printf("Ok direction changed\n");
- press_enter_to_continue();
- break;
- case '3' : printf("Give value : ");
- scanf("%d", &value);
- ret = as_gpio_set_pin_value(gpio_dev, value);
- if (ret < 0)
- {
- printf("Error, can't change pin value\n");
- press_enter_to_continue();
- break;
- }
- printf("Ok value changed\n");
- press_enter_to_continue();
- break;
- case '4' : printf("Get value \n");
- pin_value = as_gpio_get_pin_value(gpio_dev);
- if (pin_value < 0) {
- printf("Error, can't get pin value\n");
- press_enter_to_continue();
- break;
- }
- printf("Value is %d\n", pin_value);
- press_enter_to_continue();
- break;
- case '5':
+ char buffer[50];
+ struct as_gpio_device *gpio_dev;
+ int32_t ret;
+ int32_t value;
+ int pin_num = 173; /* default: PF13 */
+ int pin_value = 1, platform;
+
+ platform = as_helpers_get_platform();
+ switch (platform) {
+ case APF9328:
+ pin_num = 0x007;
+ break;
+ case APF27:
+ pin_num = 173;
+ break;
+ case APF51:
+ pin_num = 3;
+ break;
+ default:
+ break;
+ }
+
+ gpio_dev = as_gpio_open(pin_num);
+ if (gpio_dev == NULL) {
+ printf("Error can't open gpio %d\nHave you got gpiolib ?\n",
+ pin_num);
+ press_enter_to_continue();
+ return;
+ }
+
+ pin_value = as_gpio_get_pin_value(gpio_dev);
+ if (pin_value < 0) {
+ printf("Error, can't get pin value\n");
+ return;
+ }
+
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("**************************\n");
+ printf(" Testing GPIO Port%d \n", pin_num);
+ printf("**************************\n");
+ printf("Choose ('q' to quit):\n");
+ printf(" 1) Change gpio (%d)\n", as_gpio_get_pin_num(gpio_dev));
+ printf(" 2) Change direction (%s)\n",
+ as_gpio_get_pin_direction(gpio_dev));
+ printf(" 3) Change value (%d)\n",
+ as_gpio_get_pin_value(gpio_dev));
+ printf(" 4) Read pin value\n");
+ printf(" 5) Set irq/event mode (%s)\n",
+ as_gpio_get_irq_mode(gpio_dev));
+ printf(" a) Wait an event\n");
+
+ printf("> ");
+ scanf("%s", buffer);
+
+ switch (buffer[0]) {
+ case '1':
+ printf("Give pin number : ");
+ scanf("%d", &pin_num);
+
+ gpio_dev = as_gpio_open(pin_num);
+ if (gpio_dev == NULL) {
+ printf("Error, can't open %d\n", pin_num);
+ press_enter_to_continue();
+ break;
+ }
+ printf("Ok %d is open\n", pin_num);
+ press_enter_to_continue();
+ break;
+ case '2':
+ printf("Give direction (in/out) : ");
+ scanf("%s", buffer);
+ ret = as_gpio_set_pin_direction(gpio_dev, buffer);
+ if (ret < 0) {
+ printf("Error, can't change direction\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Ok direction changed\n");
+ press_enter_to_continue();
+ break;
+ case '3':
+ printf("Give value : ");
+ scanf("%d", &value);
+ ret = as_gpio_set_pin_value(gpio_dev, value);
+ if (ret < 0) {
+ printf("Error, can't change pin value\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Ok value changed\n");
+ press_enter_to_continue();
+ break;
+ case '4':
+ printf("Get value \n");
+ pin_value = as_gpio_get_pin_value(gpio_dev);
+ if (pin_value < 0) {
+ printf("Error, can't get pin value\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Value is %d\n", pin_value);
+ press_enter_to_continue();
+ break;
+ case '5':
printf("rising / falling / both / none\n");
- printf("Please choose a mode : ");
- scanf("%s", buffer);
- ret = as_gpio_set_irq_mode(gpio_dev, buffer);
- if (ret < 0)
- {
- printf("Error, can't change irq value\n");
- press_enter_to_continue();
- break;
- }
- printf("Ok value changed\n");
- press_enter_to_continue();
- break;
- case 'a' : printf("Blocking read (10 sec timeout)\n");
- ret = as_gpio_wait_event(gpio_dev, 10000);
- if (ret < 0)
- {
- printf("Error, can't read value\n");
- press_enter_to_continue();
- break;
- }
- printf("Value read %d\n",ret);
- press_enter_to_continue();
- break;
- default : break;
- }
- }
- ret = as_gpio_close(gpio_dev);
- if(ret < 0)
- {
- printf("Error, can't close gpio\n");
- press_enter_to_continue();
- }
+ printf("Please choose a mode : ");
+ scanf("%s", buffer);
+ ret = as_gpio_set_irq_mode(gpio_dev, buffer);
+ if (ret < 0) {
+ printf("Error, can't change irq value\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Ok value changed\n");
+ press_enter_to_continue();
+ break;
+ case 'a':
+ printf("Blocking read (10 sec timeout)\n");
+ ret = as_gpio_wait_event(gpio_dev, 10000);
+ if (ret < 0) {
+ printf("Error, can't read value\n");
+ press_enter_to_continue();
+ break;
+ }
+ printf("Value read %d\n", ret);
+ press_enter_to_continue();
+ break;
+ default:
+ break;
+ }
+ }
+ ret = as_gpio_close(gpio_dev);
+ if (ret < 0) {
+ printf("Error, can't close gpio\n");
+ press_enter_to_continue();
+ }
}
#define NUM_OF_CHANNEL (8)
void test_max1027()
{
- char buffer[50];
- int ret;
- int value;
- float fValue;
- struct as_adc_device *max1027_dev;
- int channel=0;
- float vRef = 2500;
- int devNumber = 0;
- int initialized = 0;
-
- while(buffer[0] != 'q')
- {
- system("clear");
- printf("**************************\n");
- printf(" Testing max1027 *\n");
- printf("**************************\n");
- printf("Choose ('q' to quit):\n");
-
- if (initialized == 0)
- {
- printf(" 1) Open Max 1027 device\n");
- printf(" 2) Change device number (%i)\n", devNumber);
- }
- else
- {
- printf(" 1) Close Max 1027 device\n");
- printf(" 2) Change Vref (%fmV)\n",vRef);
- printf(" 3) Select channel (%i)\n", channel);
- printf(" 4) Read channel value\n");
- }
+ char buffer[50];
+ int ret;
+ int value;
+ float fValue;
+ struct as_adc_device *max1027_dev;
+ int channel = 0;
+ float vRef = 2500;
+ int devNumber = 0;
+ int initialized = 0;
+
+ while (buffer[0] != 'q') {
+ system("clear");
+ printf("**************************\n");
+ printf(" Testing max1027 *\n");
+ printf("**************************\n");
+ printf("Choose ('q' to quit):\n");
+
+ if (initialized == 0) {
+ printf(" 1) Open Max 1027 device\n");
+ printf(" 2) Change device number (%i)\n", devNumber);
+ } else {
+ printf(" 1) Close Max 1027 device\n");
+ printf(" 2) Change Vref (%fmV)\n", vRef);
+ printf(" 3) Select channel (%i)\n", channel);
+ printf(" 4) Read channel value\n");
+ }
+
+ printf("> ");
+ scanf("%s", buffer);
+
+ if (initialized == 0) {
+ switch (buffer[0]) {
+ case '1':
+ printf("Open MAX1027 device\n");
+ max1027_dev =
+ as_adc_open(AS_MA...
[truncated message content] |
|
From: Julien B a. A. <ar...@us...> - 2014-06-23 14:58:49
|
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 f4b9141b825d14a45b870cea31dea8e29e4e9cb2 (commit)
via 9531013a86e2c557cef3b07dd13291c43db076c6 (commit)
from fb8c0db7277e6010284520558f4ae2d494288ca2 (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 f4b9141b825d14a45b870cea31dea8e29e4e9cb2
Author: Julien Boibessot <jul...@ar...>
Date: Mon Jun 23 16:57:09 2014 +0200
[ASDEVICES] Add C wrappers to drive TCS3472 color converter chips
commit 9531013a86e2c557cef3b07dd13291c43db076c6
Author: Julien Boibessot <jul...@ar...>
Date: Mon Jun 23 16:32:19 2014 +0200
[ASDEVICES] Cleanup
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/Makefile | 31 ++--
target/packages/as_devices/c/Makefile | 25 ++--
target/packages/as_devices/c/as_as1531.c | 9 +-
target/packages/as_devices/c/as_i2c_eeprom.c | 45 ++---
target/packages/as_devices/c/as_max5821.c | 4 -
target/packages/as_devices/c/as_tcs3472.c | 256 ++++++++++++++++++++++++
target/packages/as_devices/c/as_tcs3472.h | 80 ++++++++
target/packages/as_devices/main.c | 11 +-
target/packages/as_devices/test_c.h | 272 ++++++++++++++++++--------
9 files changed, 581 insertions(+), 152 deletions(-)
create mode 100644 target/packages/as_devices/c/as_tcs3472.c
create mode 100644 target/packages/as_devices/c/as_tcs3472.h
diff --git a/target/packages/as_devices/Makefile b/target/packages/as_devices/Makefile
index 7c01bbc..c3cb475 100644
--- a/target/packages/as_devices/Makefile
+++ b/target/packages/as_devices/Makefile
@@ -1,25 +1,23 @@
# Default values for local compiling:
-ARMADEUS_BASE_DIR=../../../
+ARMADEUS_BASE_DIR = ../../../
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-CFLAGS=-Wall -g -O0
+CFLAGS = -Wall -g -O0
LDFLAGS=
-CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
-CXX:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
-STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
-INSTALL_DIR:=$(ARMADEUS_STAGING_DIR)
+CC = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+CXX = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
+INSTALL_DIR = $(ARMADEUS_STAGING_DIR)
+C_BINARY = test_cdevices
+C_LIBNAME = libas_devices.so
+C_LIB = c/$(C_LIBNAME)
+C_INCLUDE = c
-C_BINARY=test_cdevices
-C_LIBNAME=libas_devices.so
-C_LIB=c/$(C_LIBNAME)
-C_INCLUDE=c
+P_WRAPPER = .python_wrappers
-P_WRAPPER=.python_wrappers
-
-CPP_BINARY=test_cppdevices
-CPP_LIBNAME=libas_devices_cpp.so
-CPP_LIB=cpp/$(CPP_LIBNAME)
-CPP_INCLUDE=cpp
+CPP_BINARY = test_cppdevices
+CPP_LIBNAME = libas_devices_cpp.so
+CPP_LIB = cpp/$(CPP_LIBNAME)
+CPP_INCLUDE = cpp
.PHONY: all install install-exe clean
@@ -55,7 +53,6 @@ install:
install-exe:
install -D $(C_LIB) $(INSTALL_DIR)/usr/lib/$(C_LIBNAME)
- $(STRIP) $(INSTALL_DIR)/usr/lib/$(C_LIBNAME)
clean:
make -C c/ clean
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 8ea7426..989b7a5 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -1,10 +1,9 @@
# Default values for local compiling:
-ARMADEUS_BASE_DIR=../../../../
+ARMADEUS_BASE_DIR = ../../../../
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-CFLAGS+= -Wall -g -O0
-LDFLAGS=
-CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
-STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
+CFLAGS ?= -Wall -g -O0
+LDFLAGS =
+CC = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
OBJ += as_pwm.o
OBJ += as_i2c.o
@@ -27,14 +26,15 @@ OBJ += as_backlight.o
OBJ += as_i2c_eeprom.o
OBJ += as_helpers.o
OBJ += as_power_supply.o
+OBJ += as_tcs3472.o
-LIBRARY=as_devices
-LIB_VERS=1
-STAT_LIB=$(LIBRARY).a
-SONAME=lib$(LIBRARY).so
-LIBNAME=$(SONAME).$(LIB_VERS)
-ARCHIVE_CMD=ar
-ARCHIVE_OPTS=-cvq
+LIBRARY = as_devices
+LIB_VERS = 1
+STAT_LIB = $(LIBRARY).a
+SONAME = lib$(LIBRARY).so
+LIBNAME = $(SONAME).$(LIB_VERS)
+ARCHIVE_CMD = ar
+ARCHIVE_OPTS = -cvq
$(LIBNAME): $(OBJ)
@$(CC) -shared -Wl,-soname,$(SONAME) -o $(SONAME) $(OBJ)
@@ -50,4 +50,3 @@ $(STAT_LIB): $(OBJ)
clean:
rm -f $(OBJ) $(BINARY) $(LIBNAME) $(SONAME)
-
diff --git a/target/packages/as_devices/c/as_as1531.c b/target/packages/as_devices/c/as_as1531.c
index 0a74262..8a83bf4 100644
--- a/target/packages/as_devices/c/as_as1531.c
+++ b/target/packages/as_devices/c/as_as1531.c
@@ -12,7 +12,8 @@
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef) {
+struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef)
+{
struct as_adc_device *dev;
int ret;
int fname;
@@ -51,7 +52,8 @@ struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef) {
return dev;
}
-int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel) {
+int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel)
+{
int ret;
int finput;
int value;
@@ -78,6 +80,7 @@ int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aC
return (value*aDev->vref)/AS_AS1531_MAX_VALUE;
}
-int32_t as_adc_close_as1531(struct as_adc_device *aDev) {
+int32_t as_adc_close_as1531(struct as_adc_device *aDev)
+{
return 0;
}
diff --git a/target/packages/as_devices/c/as_i2c_eeprom.c b/target/packages/as_devices/c/as_i2c_eeprom.c
index b7a8376..1525cf0 100644
--- a/target/packages/as_devices/c/as_i2c_eeprom.c
+++ b/target/packages/as_devices/c/as_i2c_eeprom.c
@@ -52,8 +52,7 @@ struct as_i2c_eeprom_device * as_i2c_eeprom_open(int aBusNumber,
return NULL;
}
- if (as_i2c_set_slave_addr(i2c_dev, anEeprom_addr) < 0)
- {
+ if (as_i2c_set_slave_addr(i2c_dev, anEeprom_addr) < 0) {
ERROR("Can't set EEPROM address on I2C\n");
return NULL;
}
@@ -69,8 +68,7 @@ struct as_i2c_eeprom_device * as_i2c_eeprom_open(int aBusNumber,
return NULL;
dev = (struct as_i2c_eeprom_device *)malloc(sizeof(struct as_i2c_eeprom_device));
- if (dev == NULL)
- {
+ if (dev == NULL) {
ERROR("Can't allocate memory for I2C eeprom structure device\n");
return NULL;
}
@@ -111,37 +109,33 @@ int32_t as_i2c_eeprom_read(struct as_i2c_eeprom_device *aDev, uint16_t aPage_num
if (aDev->addr_width == 8) {
buffer[0] = 0;
len = 1;
- } else { // 16
+ } else { /* 16 */
buffer[0] = 0;
buffer[1] = 0;
len = 2;
}
- if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr) < 0)
- {
+ if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr) < 0) {
ERROR("Can't set EEPROM address on I2C\n");
return -1;
}
- if (as_i2c_write(aDev->i2c_dev, buffer, len) < 0)
- {
+ if (as_i2c_write(aDev->i2c_dev, buffer, len) < 0) {
ERROR("Can't write on I2C EEPROM\n");
return -1;
}
- if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr|aPage_number) < 0)
- {
+ if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr|aPage_number) < 0) {
ERROR("Can't set EEPROM address on I2C\n");
return -1;
}
- if (as_i2c_read(aDev->i2c_dev, buffer, 256) < 0)
- {
+ if (as_i2c_read(aDev->i2c_dev, buffer, 256) < 0) {
ERROR("Can't read on I2C EEPROM\n");
return -1;
}
- memcpy( aBuffer, buffer, 256 );
+ memcpy(aBuffer, buffer, 256);
return 0;
}
@@ -161,8 +155,7 @@ int32_t as_i2c_eeprom_write(struct as_i2c_eeprom_device *aDev, uint16_t aPage_nu
nb_it = aBuffer_size / aDev->page_buffer_size;
int16_t i;
- for (i = 0; i < nb_it; i++)
- {
+ for (i = 0; i < nb_it; i++) {
if (aDev->addr_width == 8) {
buffer[0] = current_pos;
memcpy( buffer+1, aBuffer + current_pos, aDev->page_buffer_size );
@@ -174,14 +167,12 @@ int32_t as_i2c_eeprom_write(struct as_i2c_eeprom_device *aDev, uint16_t aPage_nu
msg_size = aDev->page_buffer_size+2;
}
- if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr|aPage_number) < 0)
- {
+ if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr|aPage_number) < 0) {
ERROR("Can't set EEPROM address on I2C\n");
return -1;
}
- if (as_i2c_write(aDev->i2c_dev, buffer, msg_size) < 0)
- {
+ if (as_i2c_write(aDev->i2c_dev, buffer, msg_size) < 0) {
ERROR("Can't write on I2C EEPROM\n");
return -1;
}
@@ -215,12 +206,12 @@ static int32_t as_i2c_eeprom_read_write_mid(struct as_i2c_eeprom_device *aDev, u
if (aDev->addr_width == 8) {
addr_len = 1;
- } else { // 16
+ } else { /* 16 */
addr_len = 2;
}
while (aLen) {
- // calculate page and offset
+ /* calculate page and offset */
current_page = current_addr / aDev->page_size;
if (addr_len == 2) {
*((uint16_t*)buffer) = htons(current_addr % aDev->page_size);
@@ -228,13 +219,13 @@ static int32_t as_i2c_eeprom_read_write_mid(struct as_i2c_eeprom_device *aDev, u
*((uint8_t*)buffer) = (uint8_t)(current_addr % aDev->page_size);
}
- // select page to read or write to
+ /* select page to read or write to */
if (as_i2c_set_slave_addr(aDev->i2c_dev, aDev->eeprom_addr|current_page) < 0) {
ERROR("Can't set EEPROM address on I2C\n");
return -1;
}
- // calculate len of fragment regarding page_buffer_size
+ /* calculate len of fragment regarding page_buffer_size */
fragment_len = aDev->page_buffer_size - (current_addr % aDev->page_buffer_size);
if (fragment_len > aLen) {
fragment_len = aLen;
@@ -242,19 +233,19 @@ static int32_t as_i2c_eeprom_read_write_mid(struct as_i2c_eeprom_device *aDev, u
if (isWrite) {
memcpy(buffer + 2, aBuffer, fragment_len);
- // select offset address inside page
+ /* select offset address inside page */
if (as_i2c_write(aDev->i2c_dev, buffer, addr_len + fragment_len) < 0) {
ERROR("Can't write on I2C EEPROM\n");
return -1;
}
usleep(aDev->write_time_us);
} else {
- // select offset address inside page
+ /* select offset address inside page */
if (as_i2c_write(aDev->i2c_dev, buffer, addr_len) < 0) {
ERROR("Can't write on I2C EEPROM\n");
return -1;
}
- // read data
+ /* read data */
if (as_i2c_read(aDev->i2c_dev, aBuffer, fragment_len) < 0) {
ERROR("Can't read on I2C EEPROM\n");
return -1;
diff --git a/target/packages/as_devices/c/as_max5821.c b/target/packages/as_devices/c/as_max5821.c
index 33959b8..ee6c670 100644
--- a/target/packages/as_devices/c/as_max5821.c
+++ b/target/packages/as_devices/c/as_max5821.c
@@ -25,7 +25,6 @@
#include "as_max5821.h"
#include "as_i2c.h"
-
/* command bytes */
#define MAX5821_UPDATE_ALL_DAC_COMMAND (0xE0)
#define MAX5821_EXTENDED_COMMAND_MODE (0xF0)
@@ -36,7 +35,6 @@
#define MAX5821M_MAX_DATA_VALUE (1023)
//#define DEBUG
-
#ifdef DEBUG
# define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
@@ -75,8 +73,6 @@ struct as_dac_device *as_dac_open_max5821(int aI2cBus, int aI2cAddress, int aVRe
goto free_dev_err;
}
-
-
max5821_dev->i2c_dev = i2c_dev;
dev->bus_number = aI2cBus;
diff --git a/target/packages/as_devices/c/as_tcs3472.c b/target/packages/as_devices/c/as_tcs3472.c
new file mode 100644
index 0000000..001b95e
--- /dev/null
+++ b/target/packages/as_devices/c/as_tcs3472.c
@@ -0,0 +1,256 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Julien Boibessot <jul...@ar...>
+ * Copyright (C) 2014 The Armadeus Project & Armadeus Systems
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "as_tcs3472.h"
+
+/* registers */
+#define TCS3472_REG_ENABLE (0x00)
+#define TCS3472_REG_ATIME (0x01)
+#define TCS3472_REG_WTIME (0x02)
+/* TBDL
+#define TCS3472_REG_AILTL (0x04)
+#define TCS3472_REG_AILTH (0x05)
+#define TCS3472_REG_AIHTL (0x06)
+#define TCS3472_REG_AIHTH (0x07)
+#define TCS3472_REG_PERS (0x0c)
+*/
+#define TCS3472_REG_CONFIG (0x0d)
+#define TCS3472_REG_CONTROL (0x0f)
+#define TCS3472_REG_ID (0x12)
+#define TCS3472_REG_STATUS (0x13)
+#define TCS3472_REG_STATUS_AVALID (1 << 0)
+#define TCS3472_REG_CDATAL (0x14)
+#define TCS3472_REG_CDATAH (0x15)
+#define TCS3472_REG_RDATAL (0x16)
+#define TCS3472_REG_RDATAH (0x17)
+#define TCS3472_REG_GDATAL (0x18)
+#define TCS3472_REG_GDATAH (0x19)
+#define TCS3472_REG_BDATAL (0x1a)
+#define TCS3472_REG_BDATAH (0x1b)
+
+//#define DEBUG
+#ifdef DEBUG
+#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
+#else
+#define DBG(fmt, ...) /*fmt, ##__VA_ARGS__ */
+#endif
+#define ERROR(fmt, ...) printf("%s" fmt, __func__, ##__VA_ARGS__)
+
+static int32_t as_tcs3472_read16(struct as_tcs3472 *tcs3472, int reg,
+ unsigned short *value, int size)
+{
+ int ret;
+ unsigned char buf[2];
+
+ /* Set address of register to access */
+ buf[0] = 0x80 | ((unsigned char)(reg & 0x1f));
+ ret = as_i2c_write(tcs3472->i2c_dev, buf, 1);
+ if (ret)
+ return ret;
+
+ /* Read it */
+ ret = as_i2c_read(tcs3472->i2c_dev, buf, 2);
+ if (ret)
+ return ret;
+
+ *value = buf[1] << 8 | buf[0];
+ DBG("read 0x%02x%02x at 0x%02x\n", buf[1], buf[0], reg);
+
+ return 0;
+}
+
+static int32_t as_tcs3472_read8(struct as_tcs3472 *tcs3472, int reg,
+ unsigned char *value)
+{
+ int ret;
+ unsigned char buff[1];
+
+ /* Set address of register to access */
+ buff[0] = 0x80 | ((unsigned char)(reg & 0x1f));
+ ret = as_i2c_write(tcs3472->i2c_dev, buff, 1);
+ if (ret)
+ return ret;
+
+ /* Read it */
+ ret = as_i2c_read(tcs3472->i2c_dev, buff, 1);
+ if (ret)
+ return ret;
+
+ *value = *buff;
+ DBG("read 0x%02x in 0x%02x\n", *value, reg);
+
+ return 0;
+}
+
+static int32_t as_tcs3472_write8(struct as_tcs3472 *tcs3472, int reg,
+ unsigned char value)
+{
+ int ret;
+ unsigned char buf[1];
+
+ /* Set address of register to access */
+ buf[0] = 0x80 | ((unsigned char)(reg & 0x1f));
+ ret = as_i2c_write(tcs3472->i2c_dev, buf, 1);
+ if (ret)
+ return ret;
+
+ /* write value */
+ buf[0] = value;
+ ret = as_i2c_write(tcs3472->i2c_dev, buf, 1);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+/*-----------------------------------------------------------------------------*/
+
+struct as_tcs3472 *as_tcs3472_open(int i2c_bus, int i2c_addr)
+{
+ struct as_tcs3472 *tcs3472;
+ struct as_i2c_device *i2c_dev;
+ int ret;
+ unsigned char id;
+
+ i2c_dev = as_i2c_open(i2c_bus);
+ if (i2c_dev == NULL) {
+ perror("Can't open I2C bus number\n");
+ return NULL;
+ }
+
+ ret = as_i2c_set_slave_addr(i2c_dev, i2c_addr);
+ if (ret < 0) {
+ perror("Can't set i2c address\n");
+ goto close_i2c_err;
+ }
+
+ tcs3472 = (struct as_tcs3472 *)malloc(sizeof(struct as_tcs3472));
+ if (!tcs3472) {
+ perror("can't allocate memory for device structure\n");
+ goto close_i2c_err;
+ }
+ tcs3472->i2c_dev = i2c_dev;
+
+ ret = as_tcs3472_read8(tcs3472, TCS3472_REG_ID, &id);
+ if (ret) {
+ printf("%s: can't read ID register !\n", __func__);
+ goto free_tcs3472_dev_err;
+ }
+ if (id == 0x44) {
+ printf("found a TCS34721/5");
+ } else if (id == 0x42) {
+ printf("found a TCS34723/7");
+ } else {
+ printf("No TCS3472x found at given address !!\n");
+ goto free_tcs3472_dev_err;
+ }
+ printf(" @ 0x%02x on I2C%d\n", i2c_addr, i2c_bus);
+
+ /* Powerdown by default */
+ as_tcs3472_write8(tcs3472, TCS3472_REG_ENABLE, 0x00);
+
+ return tcs3472;
+
+free_tcs3472_dev_err:
+ free(tcs3472);
+close_i2c_err:
+ as_i2c_close(i2c_dev);
+ return NULL;
+}
+
+/*-----------------------------------------------------------------------------*/
+
+int32_t as_tcs3472_start_rgbc(struct as_tcs3472 * tcs3472, int time)
+{
+ struct timespec t;
+ unsigned char int_time;
+
+ /* Powerup & wait 24ms */
+ as_tcs3472_write8(tcs3472, TCS3472_REG_ENABLE, 0x01);
+ t.tv_sec = 0;
+ t.tv_nsec = 24000000; /* 24ms */
+ nanosleep(&t, NULL);
+
+ /* Set integration time */
+ int_time = (unsigned char)(256 - (time * 10 / 24));
+ as_tcs3472_write8(tcs3472, TCS3472_REG_ATIME, int_time);
+
+ /* AEN */
+ as_tcs3472_write8(tcs3472, TCS3472_REG_ENABLE, 0x03);
+
+#ifdef DEBUG
+ unsigned char buf2;
+ nanosleep(&t, NULL);
+ as_tcs3472_read8(tcs3472, TCS3472_REG_STATUS, &buf2);
+#endif
+
+ return 0;
+}
+
+/*-----------------------------------------------------------------------------*/
+
+int32_t as_tcs3472_get_colours(struct as_tcs3472 * tcs3472,
+ struct as_tcs3472_colours * colours)
+{
+ int ret;
+ unsigned short buf;
+ unsigned char status;
+
+ as_tcs3472_read8(tcs3472, TCS3472_REG_STATUS, &status);
+ if (!status && TCS3472_REG_STATUS_AVALID) {
+ ERROR("integration cycle not completed yet\n");
+ return -1;
+ }
+
+ ret = as_tcs3472_read16(tcs3472, TCS3472_REG_CDATAL, &buf, 1);
+ if (ret)
+ return ret;
+ colours->clear = buf;
+
+ ret = as_tcs3472_read16(tcs3472, TCS3472_REG_RDATAL, &buf, 1);
+ if (ret)
+ return ret;
+ colours->red = buf;
+
+ ret = as_tcs3472_read16(tcs3472, TCS3472_REG_GDATAL, &buf, 1);
+ if (ret)
+ return ret;
+ colours->green = buf;
+
+ ret = as_tcs3472_read16(tcs3472, TCS3472_REG_BDATAL, &buf, 1);
+ if (ret)
+ return ret;
+ colours->blue = buf;
+
+ return 0;
+}
+
+/*-----------------------------------------------------------------------------*/
+
+int32_t as_tcs3472_close(struct as_tcs3472 * tcs3472)
+{
+ as_i2c_close(tcs3472->i2c_dev);
+ free(tcs3472);
+
+ return 0;
+}
diff --git a/target/packages/as_devices/c/as_tcs3472.h b/target/packages/as_devices/c/as_tcs3472.h
new file mode 100644
index 0000000..8065c7e
--- /dev/null
+++ b/target/packages/as_devices/c/as_tcs3472.h
@@ -0,0 +1,80 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Julien Boibessot <jul...@ar...>
+ * Copyright (C) 2014 The Armadeus Project & Armadeus Systems
+ *
+ */
+
+#ifndef __AS_TCS3472_H__
+#define __AS_TCS3472_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "as_i2c.h"
+
+struct as_tcs3472 {
+ struct as_i2c_device *i2c_dev;
+};
+
+struct as_tcs3472_colours {
+ int clear;
+ int red;
+ int green;
+ int blue;
+};
+
+/** @brief Initialize access to a TCS3472* chip
+ *
+ * @param i2c_bus I2C bus number
+ * @param i2c_addr I2C chip address
+ *
+ * @return as_tcs3472_device structure on success, NULL on error
+ */
+struct as_tcs3472 *as_tcs3472_open(int i2c_bus, int i2c_addr);
+
+/** @brief Start a color convertion
+ *
+ * @param tcs3472 the TCS3472 to ask for
+ * @param time duration of the convertion (integration time)
+ *
+ * @return negative value on error
+ */
+int32_t as_tcs3472_start_rgbc(struct as_tcs3472 *tcs3472, int time);
+
+/** @brief Get R/G/B/C colour components from previous conversion
+ *
+ * @param tcs3472 the TCS3472 to ask for
+ * @param colours pointer to the structure to store the value
+ *
+ * @return negative value on error
+ */
+int32_t as_tcs3472_get_colours(struct as_tcs3472 *tcs3472,
+ struct as_tcs3472_colours *colours);
+
+/** @brief Close TCS3472 access
+ *
+ * @param tcs3472 the chip to close access for
+ *
+ * @return negative value on error
+ */
+int32_t as_tcs3472_close(struct as_tcs3472 *tcs3472);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __AS_TCS3472_H__ */
diff --git a/target/packages/as_devices/main.c b/target/packages/as_devices/main.c
index a87afbf..e1c5053 100644
--- a/target/packages/as_devices/main.c
+++ b/target/packages/as_devices/main.c
@@ -1,8 +1,8 @@
/*
-** THE ARMadeus Systems
+** AsDevices test program
**
-** Copyright (C) 2009 The armadeus systems team
-** Fabien Marteau <fab...@ar...>
+** Copyright (C) 2009-2014 The Armadeus Project & Armadeus Systems teams
+** Author: Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
@@ -40,13 +40,14 @@ int main(int argc, char ** argv)
printf(" 1) pwm\n");
printf(" 2) i2c\n");
printf(" 3) spi\n");
- printf(" 4) 93LCxx eprom\n");
+ printf(" 4) 93LCxx eeprom\n");
printf(" 5) gpio\n");
printf(" 6) max1027\n");
printf(" 7) max5821\n");
printf(" 8) as1531\n");
printf(" 9) backlight\n");
printf(" a) i2c eeprom\n");
+ printf(" b) tcs3472\n");
printf("> ");
scanf("%s",buffer);
@@ -72,6 +73,8 @@ int main(int argc, char ** argv)
break;
case 'a': test_i2c_eeprom();
break;
+ case 'b': test_tcs3472();
+ break;
default : break;
}
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index 20ac106..e294806 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -1,7 +1,8 @@
/*
+ ** AsDevices C layer test program
**
- ** Copyright (C) 2009-2011 The Armadeus Project - ARMadeus Systems
- ** Fabien Marteau <fab...@ar...>
+ ** Copyright (C) 2009-2014 The Armadeus Project & Armadeus Systems teams
+ ** Author: Fabien Marteau <fab...@ar...>
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
@@ -15,11 +16,12 @@
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
- **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h> /* sleep */
#include <math.h>
#include "as_pwm.h"
@@ -33,12 +35,13 @@
#include "as_backlight.h"
#include "as_i2c_eeprom.h"
#include "as_helpers.h"
+#include "as_tcs3472.h"
#define PWM_NUM 0
#define _STR(x) #x
-void pressEnterToContinue(void)
+void press_enter_to_continue(void)
{
printf("\nPress enter to continue\n");
while( getc(stdin) != '\n');
@@ -55,13 +58,12 @@ void test_pwm(void)
struct as_pwm_device *pwm_dev;
pwm_dev = as_pwm_open(PWM_NUM);
- if(pwm_dev == NULL){
+ if (pwm_dev == NULL) {
printf("can't init pwm0\n");
- pressEnterToContinue();
+ press_enter_to_continue();
return;
}
- while(buffer[0] != 'q')
- {
+ while (buffer[0] != 'q') {
system("clear");
printf("*********************************\n");
printf("* Testing pwm menu *\n");
@@ -83,51 +85,51 @@ void test_pwm(void)
case '1' : printf("Give frequency :");
scanf("%d",&value);
as_pwm_set_frequency(pwm_dev,value);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Current pwm frequency is %d\n",
as_pwm_get_frequency(pwm_dev));
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Give period :");
scanf("%d", &value);
as_pwm_set_period(pwm_dev, value);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '4' : printf("Current period is %d\n",
as_pwm_get_period(pwm_dev));
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '5' : printf("Give Duty :");
scanf("%d", &value);
as_pwm_set_duty(pwm_dev, value);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '6' : printf("Current Duty is %d\n",
as_pwm_get_duty(pwm_dev));
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '7' : printf("Activate 'a' or Desactivate 'd' ?");
scanf("%s", buffer2);
if (buffer2[0] == 'a') {
as_pwm_set_state(pwm_dev, 1);
printf("Pwm activated\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else if (buffer2[0] == 'd') {
as_pwm_set_state(pwm_dev, 0);
printf("Pwm desactivated\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
printf("Option %c unknown\n",buffer[0]);
- pressEnterToContinue();
+ press_enter_to_continue();
}
break;
case '8' : if (as_pwm_get_state(pwm_dev)) {
printf("pwm is active\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
printf("pwm is inactive\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
break;
default : break;
@@ -150,15 +152,13 @@ void test_i2c(void)
struct as_i2c_device *i2c_bus = 0;
int i2c_id = 0;
- while(buffer[0] != 'q')
- {
+ while (buffer[0] != 'q') {
system("clear");
printf("*********************************\n");
printf("* Testing i2c menu *\n");
printf("*********************************\n");
printf("Choose ('q' to quit):\n");
- if (initialized == 0)
- {
+ if (initialized == 0) {
printf(" 1) Open i2c bus \n");
printf(" 2) Change bus number (%d)\n",i2c_id);
} else {
@@ -180,7 +180,7 @@ void test_i2c(void)
printf("Bus %d opened\n", i2c_id);
initialized = 1;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Give bus number (max %d): ", sizeof(_STR(AS_I2C_DEV_COUNT))-1);
scanf("%d",&value);
@@ -190,7 +190,7 @@ void test_i2c(void)
} else {
i2c_id = value;
}
- pressEnterToContinue();
+ press_enter_to_continue();
default : break;
}
} else {
@@ -204,7 +204,7 @@ void test_i2c(void)
} else {
initialized = 0;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -216,7 +216,7 @@ void test_i2c(void)
void test_spi(void)
{
printf("TODO\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
@@ -284,7 +284,7 @@ void test_93LC()
if ( (value != 8) && (value != 16) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
word_size = value;
}
@@ -299,7 +299,7 @@ void test_93LC()
if ( (value != 46) && (value != 56) && (value != 66) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
type = value;
}
@@ -318,7 +318,7 @@ void test_93LC()
} else {
initialized = 1;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -328,7 +328,7 @@ void test_93LC()
case '1' : as_93lcxx_close(dev);
printf("eeprom closed\n");
initialized = 0;
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf(" Read specific address\n");
printf("Give address in hexadecimal (max 0x%03X):",
@@ -346,7 +346,7 @@ void test_93LC()
printf(" Read %02x at %02X", value2, value );
}
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Erase specific address\n");
printf("Give address in hexadecimal (max 0x%03X):",
@@ -364,7 +364,7 @@ void test_93LC()
printf("Value erased\n");
}
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '4' : printf("Write specific address\n");
printf("Give address in hexadecimal (max 0x%03X):",
@@ -373,7 +373,7 @@ void test_93LC()
if (value > max_address(type, word_size))
{
printf(" Error, address wrong\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Give value in hexadecimal :");
@@ -383,7 +383,7 @@ void test_93LC()
{
printf("Error, can't write value\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '5' : printf(" Write all\n");
printf("Give value in hexadecimal:");
@@ -393,7 +393,7 @@ void test_93LC()
{
printf("Error, can't write value\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '6' : printf(" Read all\n");
for(i = 0; i <= max_address(type, word_size); i++)
@@ -407,23 +407,23 @@ void test_93LC()
i,as_93lcxx_read(dev, i));
}
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '7' : printf(" Erase all\n");
value = as_93lcxx_erase_all(dev);
if (value < 0)
printf(" Error in erasing eeprom\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '8' : printf("Unlock write\n");
if (as_93lcxx_ewen(dev) < 0)
printf("Error can't unlock write\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '9' : printf("lock write\n");
if (as_93lcxx_ewds(dev) < 0)
printf("Error can't lock write\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -458,7 +458,7 @@ void test_gpio()
gpio_dev = as_gpio_open(pin_num);
if (gpio_dev == NULL) {
printf("Error can't open gpio %d\nHave you got gpiolib ?\n", pin_num);
- pressEnterToContinue();
+ press_enter_to_continue();
return ;
}
@@ -494,11 +494,11 @@ void test_gpio()
if (gpio_dev == NULL)
{
printf("Error, can't open %d\n", pin_num);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Ok %d is open\n", pin_num);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Give direction (in/out) : ");
scanf("%s", buffer);
@@ -506,11 +506,11 @@ void test_gpio()
if (ret < 0)
{
printf("Error, can't change direction\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Ok direction changed\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Give value : ");
scanf("%d", &value);
@@ -518,21 +518,21 @@ void test_gpio()
if (ret < 0)
{
printf("Error, can't change pin value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Ok value changed\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '4' : printf("Get value \n");
pin_value = as_gpio_get_pin_value(gpio_dev);
if (pin_value < 0) {
printf("Error, can't get pin value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Value is %d\n", pin_value);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '5':
printf("rising / falling / both / none\n");
@@ -542,22 +542,22 @@ void test_gpio()
if (ret < 0)
{
printf("Error, can't change irq value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Ok value changed\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case 'a' : printf("Blocking read (10 sec timeout)\n");
ret = as_gpio_wait_event(gpio_dev, 10000);
if (ret < 0)
{
printf("Error, can't read value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Value read %d\n",ret);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -566,7 +566,7 @@ void test_gpio()
if(ret < 0)
{
printf("Error, can't close gpio\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
}
@@ -621,7 +621,7 @@ void test_max1027()
printf("Max 1027 device opened\n");
initialized = 1;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Give device number:");
scanf("%i",&value);
@@ -632,7 +632,7 @@ void test_max1027()
} else {
devNumber = value;
}
- pressEnterToContinue();
+ press_enter_to_continue();
default : break;
}
}
@@ -648,7 +648,7 @@ void test_max1027()
} else {
initialized = 0;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Give wanted Vref (mV): ");
scanf("%f",&fValue);
@@ -656,19 +656,19 @@ void test_max1027()
if (ret < 0)
{
printf("Error, can't close max1027\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
max1027_dev = as_adc_open(AS_MAX1027_NAME, devNumber, fValue);
if (max1027_dev == NULL){
printf("Error, can't open max1027 with Vref = %fmV\n", fValue);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
vRef = fValue;
printf("Vref changed to: %fmV\n", vRef);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Give channel you want to read (0-6): ");
scanf("%d",&value);
@@ -682,11 +682,11 @@ void test_max1027()
channel);
if (ret < 0) {
printf("Error reading temperature\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Channel %d value read : %dmV\n", channel, ret);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -709,10 +709,10 @@ void test_max5821()
if (max5821_dev == NULL)
{
printf("Error, can't open max5821.\n");
- pressEnterToContinue();
+ press_enter_to_continue();
return ;
}
- pressEnterToContinue();
+ press_enter_to_continue();
while(buffer[0] != 'q')
{
@@ -744,7 +744,7 @@ void test_max5821()
{
printf("Error, can't select power mode\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Choose your mode:\n");
printf(" 0) MAX5821_POWER_UP \n");
@@ -758,7 +758,7 @@ void test_max5821()
{
printf("Error, can't select power mode\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Give value between 0-1023\n");
printf("> ");
@@ -768,7 +768,7 @@ void test_max5821()
{
printf("Error, can't select value\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '4' : printf("Give value between 0-1023\n");
printf("> ");
@@ -778,7 +778,7 @@ void test_max5821()
{
printf("Error, can't select value\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '5' : printf("Give value between 0-1023\n");
printf("> ");
@@ -788,7 +788,7 @@ void test_max5821()
{
printf("Error, can't select value\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -797,7 +797,7 @@ void test_max5821()
ret = as_dac_close(max5821_dev);
if (ret < 0) {
printf("Error on closing max5821_dev\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
}
@@ -805,7 +805,7 @@ void test_max5821()
void test_as1531(void)
{
printf("TODO\n");
- pressEnterToContinue();
+ press_enter_to_continue();
}
/* Backlight test */
@@ -819,7 +819,7 @@ void test_backlight(void)
backlight_dev = as_backlight_open();
if (backlight_dev == NULL) {
printf("can't init backlight\n");
- pressEnterToContinue();
+ press_enter_to_continue();
return;
}
while (buffer[0] != 'q') {
@@ -838,16 +838,16 @@ void test_backlight(void)
{
case '1' : printf("Actual brightness is %d\n",
as_backlight_get_actual_brightness(backlight_dev));
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf("Maximum brightness is %d\n",
as_backlight_get_max_brightness(backlight_dev));
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Give brightness :");
scanf("%d",&value);
as_backlight_set_brightness(backlight_dev,value);
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -911,7 +911,7 @@ void test_i2c_eeprom()
if ( (value != 0) && (value != 1) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
bus_number = value;
printf("Bus number changed to %d\n", bus_number);
@@ -927,7 +927,7 @@ void test_i2c_eeprom()
if ( (value != 8) && (value != 16) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
addr_width = value;
printf("Eeprom address width changed to %lu\n", addr_width);
@@ -938,7 +938,7 @@ void test_i2c_eeprom()
if ( (value != 16) && (value != 32) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
page_buffer_size = value;
printf("Page write buffer size changed to %lu\n", page_buffer_size);
@@ -949,7 +949,7 @@ void test_i2c_eeprom()
if ( (value != 1) && (value != 2) && (value != 4) )
{
printf("Wrong value\n");
- pressEnterToContinue();
+ press_enter_to_continue();
} else {
number_pages = value;
printf("Number of pages changed to %d\n", number_pages);
@@ -967,7 +967,7 @@ void test_i2c_eeprom()
} else {
initialized = 1;
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -977,7 +977,7 @@ void test_i2c_eeprom()
case '1' : as_i2c_eeprom_close(dev);
printf("eeprom closed\n");
initialized = 0;
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '2' : printf(" Read specific page\n");
printf("Give page number (max. %d):",
@@ -995,7 +995,7 @@ void test_i2c_eeprom()
printf(" Read %s at page %d", page_buffer, value );
}
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
case '3' : printf("Write on specific page\n");
printf("Give page number (max. %d):",
@@ -1004,7 +1004,7 @@ void test_i2c_eeprom()
if (value > number_pages)
{
printf(" Error, wrong page number\n");
- pressEnterToContinue();
+ press_enter_to_continue();
break;
}
printf("Give data to write :");
@@ -1014,7 +1014,7 @@ void test_i2c_eeprom()
{
printf("Error, can't write on page\n");
}
- pressEnterToContinue();
+ press_enter_to_continue();
break;
default : break;
}
@@ -1022,3 +1022,107 @@ void test_i2c_eeprom()
}
}
+void test_tcs3472()
+{
+ char kbd_buf[50];
+
+ /* default values */
+ int i2c_bus = 0;
+ int i2c_addr = 0x29;
+ int convertion_time = 100;
+
+ struct as_tcs3472 *tcs3472;
+ struct as_tcs3472_colours colours;
+ int value, ret, initialized = 0;
+
+ while (kbd_buf[0] != 'q') {
+ system("clear");
+ printf("**********************************\n");
+ printf("* AsDevice TCS3472 Test menu *\n");
+ printf("**********************************\n");
+ printf("Please make your choice ('q' to quit):\n");
+ if (!initialized) {
+ printf(" 1) Change I2C bus (%d)\n", i2c_bus);
+ printf(" 2) Change chip I2C address (0x%02x)\n", i2c_addr);
+ printf(" 3) Initialize TCS3472\n");
+ } else {
+ printf(" 1) Close chip access\n");
+ printf(" 2) Change color convertion time (%dms)\n", convertion_time);
+ printf(" 3) Get colours\n");
+ }
+
+ printf("> ");
+ scanf("%s", kbd_buf);
+
+ if (!initialized) {
+ switch(kbd_buf[0]) {
+ case '1':
+ printf("Give new I2C bus number (0 or 1): ");
+ scanf("%d", &value);
+ if ((value != 0) && (value != 1)) {
+ printf("Wrong value\n");
+ press_enter_to_continue();
+ } else {
+ i2c_bus = value;
+ printf("Bus number changed to %d\n", i2c_bus);
+ }
+ break;
+
+ case '2': printf("Give new I2C address: ");
+ scanf("%d", &value);
+ i2c_addr = value;
+ printf("I2C address changed to 0x%02x\n", i2c_addr);
+ break;
+
+ case '3':
+ tcs3472 = as_tcs3472_open(i2c_bus, i2c_addr);
+ if (!tcs3472) {
+ printf("Failed to open TCS3472 device !\n");
+ initialized = 0;
+ } else {
+ initialized = 1;
+ }
+ press_enter_to_continue();
+ break;
+ }
+ } else { /* initialized */
+ switch (kbd_buf[0]) {
+ case '1':
+ ret = as_tcs3472_close(tcs3472);
+ if (ret) {
+ printf("error while closing\n");
+ } else {
+ printf("TCS3472 access closed\n");
+ initialized = 0;
+ }
+ sleep(1);
+ break;
+
+ case '2':
+ printf("Give new convertion time (ms, max 700): ");
+ scanf("%d", &value);
+ convertion_time = value;
+ if (convertion_time > 700)
+ convertion_time = 700;
+ printf("convertion time changed to %dms\n", convertion_time);
+ sleep(1);
+ break;
+
+ case '3':
+ printf("Launching conversion\n");
+ as_tcs3472_start_rgbc(tcs3472, convertion_time);
+ printf("Waiting end of conversion\n");
+ sleep(1);
+ ret = as_tcs3472_get_colours(tcs3472, &colours);
+ if (ret) {
+ printf("Error, can't get colours\n");
+ } else {
+ printf("C=%04d R=%04d G=%04d B=%04d\n", colours.clear, colours.red, colours.green, colours.blue);
+ }
+ press_enter_to_continue();
+ break;
+ }
+ }
+ }
+}
+
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2014-06-23 14:21:00
|
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 fb8c0db7277e6010284520558f4ae2d494288ca2 (commit)
from 4ee78e7a5c69f7846bb7f8333fa09b977b6deff1 (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 fb8c0db7277e6010284520558f4ae2d494288ca2
Author: Jeremie Scheer <jer...@ar...>
Date: Mon Jun 23 16:19:11 2014 +0200
[BUILDROOT] Fix Qt's URL.
-----------------------------------------------------------------------
Summary of changes:
...-qt-full_integration_with_cross_compiling.patch | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/patches/buildroot/2013.11/132-qt-full_integration_with_cross_compiling.patch b/patches/buildroot/2013.11/132-qt-full_integration_with_cross_compiling.patch
index afe0268..416f891 100644
--- a/patches/buildroot/2013.11/132-qt-full_integration_with_cross_compiling.patch
+++ b/patches/buildroot/2013.11/132-qt-full_integration_with_cross_compiling.patch
@@ -4,9 +4,9 @@ Signed-off-by: Jérémie Scheer <jer...@ar...>
Index: buildroot/package/qt/Config.in
===================================================================
---- buildroot.orig/package/qt/Config.in
-+++ buildroot/package/qt/Config.in
-@@ -21,7 +21,13 @@ config BR2_PACKAGE_QT_DEBUG
+--- buildroot.orig/package/qt/Config.in 2013-11-30 14:16:03.000000000 +0100
++++ buildroot/package/qt/Config.in 2014-06-23 11:56:03.000000000 +0200
+@@ -21,7 +21,13 @@
If unsure, say N.
config BR2_PACKAGE_QT_DEMOS
@@ -23,8 +23,8 @@ Index: buildroot/package/qt/Config.in
If unsure, say N.
Index: buildroot/package/qt/qt.mk
===================================================================
---- buildroot.orig/package/qt/qt.mk
-+++ buildroot/package/qt/qt.mk
+--- buildroot.orig/package/qt/qt.mk 2013-11-30 14:16:03.000000000 +0100
++++ buildroot/package/qt/qt.mk 2014-06-23 11:57:29.000000000 +0200
@@ -11,9 +11,10 @@
#
################################################################################
@@ -34,11 +34,11 @@ Index: buildroot/package/qt/qt.mk
+QT_VERSION = $(QT_VERSION_MAJOR).5
QT_SOURCE = qt-everywhere-opensource-src-$(QT_VERSION).tar.gz
-QT_SITE = http://download.qt-project.org/official_releases/qt/4.8/$(QT_VERSION)
-+QT_SITE = http://download.qt-project.org/official_releases/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION)
++QT_SITE = http://download.qt-project.org/archive/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION)
QT_DEPENDENCIES = host-pkgconf
QT_INSTALL_STAGING = YES
-@@ -58,9 +59,14 @@ QT_CONFIGURE_OPTS += -no-qt3support
+@@ -58,9 +59,14 @@
endif
ifeq ($(BR2_PACKAGE_QT_DEMOS),y)
hooks/post-receive
--
armadeus
|
|
From: Sébastien S. <ss...@us...> - 2014-06-23 09:57:36
|
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 4ee78e7a5c69f7846bb7f8333fa09b977b6deff1 (commit)
via a8b7575c05f525f10dccd20a01dcba95b88bf4b5 (commit)
from 9d1495d3ac1526e85bd2779dec7e35c0f80b69e9 (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 4ee78e7a5c69f7846bb7f8333fa09b977b6deff1
Author: Sébastien Szymanski <ss...@us...>
Date: Mon Jun 23 11:59:39 2014 +0200
[LINUX] 3.16: apf6: move to linux 3.16-rc2
commit a8b7575c05f525f10dccd20a01dcba95b88bf4b5
Author: Sébastien Szymanski <ss...@us...>
Date: Mon Jun 23 11:57:59 2014 +0200
[LINUX] 3.16: add linux 3.16-rc2
The following patches have been removed because they are mainlined or no more needed:
0025-armadeus-imx-correct_dma_shift.patch
0413-armadeus-imx-drm-fix_clk_polarity_for_apf51_screen.patch
0453-linux-0001-imx6q-work-around-fec-tx-queue-timeouts-when-SATA-SD.patch
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf6_defconfig | 2 +-
.../armadeus/apf27/apf27-linux-3.16-rc2.config | 1 +
...7-linux-3.13.config => apf27-linux-3.16.config} | 0
.../armadeus/apf28/apf28-linux-3.16-rc2.config | 1 +
...8-linux-3.14.config => apf28-linux-3.16.config} | 0
.../armadeus/apf51/apf51-linux-3.16-rc2.config | 1 +
...1-linux-3.13.config => apf51-linux-3.16.config} | 0
.../armadeus/apf6/apf6-linux-3.15-rc8.config | 1 -
.../armadeus/apf6/apf6-linux-3.16-rc2.config | 1 +
...f6-linux-3.15.config => apf6-linux-3.16.config} | 0
patches/linux/3.16-rc2 | 1 +
...15-armadeus-logo-add_armadeus-project_tux.patch | 0
.../{3.15 => 3.16}/0021-armadeus-apf9328.patch | 0
...s-apf9328-add_board_to_linux_build_system.patch | 0
.../0029-armadeus-add_csi_and_spi_registers.patch | 0
.../0029b-armadeus-add_csi_registers.patch | 0
...rmadeus-devices-imx1-add_udc_registration.patch | 0
...35-armadeus-re_add_pwm_and_correct_driver.tofix | 0
...50-armadeus-add_custom_drivers_to_kconfig.patch | 0
.../{3.15 => 3.16}/0073-armadeus-tsc2102.patch | 0
...02_integrate_driver_to_linux_build_system.patch | 0
...chscreen-add_driver_to_linux_build_system.patch | 0
.../0074-armadeus-tsc2102-touchscreen.patch | 0
.../0075-armadeus-spi2-reg-defines.patch | 0
.../0076-Add-tsc210x-device-tree-support.patch | 0
...eus-clock_correct_mxc_decode_pll_for_imx1.tofix | 0
...madeus-clock-imx1_avoid_crash_with_module.tofix | 0
...re_to_setup_PWM_Contrast_Control_Register.tofix | 0
...-tsc210x-device-tree-support-for-apf27dev.patch | 0
...deus-dts-apf27dev-fixes-user-led-polarity.patch | 0
...1-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch | 0
...dts-apf27dev-add_gpio_key_wakeup_behavior.patch | 0
...-armadeus-fixes-vpu-spll-clock-dependency.patch | 0
.../0322-armadeus-add_mach_fpga_h.patch | 0
...rmadeus-mach_fpga_add_dt_support_for_mx27.patch | 0
.../0400-Add-apf51-basic-dt-support.patch | 0
.../0401-armadeus-add_apf51dev_baseboard.patch | 1 -
...-imx51_dts-add_usbphy_for_host1_and_host2.patch | 0
...51-chipidea-usbmisc_imx-add_imx51_support.patch | 0
...adeus-chipidea-add_node_to_select_clk_phy.patch | 0
...us-imx51-dts-add-pin-definition-for-uart1.patch | 0
...dts-apf51dev-add_gpio_key_wakeup_behavior.patch | 0
.../0420-armadeus-Add-apf28dev-dts.patch | 0
...ot_link_otg_phy_clock_directly_to_osc_ref.patch | 0
..._star_completion_for_source_in_menuconfig.patch | 0
...low_to_use_the_wakeupalarm_functionnality.patch | 0
.../0444-armadeus-imx27-add-usb.patch.tofix | 0
...deus-add-apf27-apf27dev-dts-for-USB.patch.tofix | 0
.../0446-armadeus_add_pm_power_off_function.patch | 0
...rmadeus-add-apf6q-and-apf6dl-device-trees.patch | 0
...c-core-Update-ext_csd-if-touched-by-ioctl.patch | 0
...6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch | 0
...-remove-pwr_in_suspend-from-platform-data.patch | 38 ++++++++++----------
...-instead-of-enumerations-for-pdata-clocks.patch | 0
...al-device-tree-support-to-the-sdio-module.patch | 33 +++++++++++------
...-8-wlcore-sdio-add-wilink-clock-providers.patch | 0
...8-wlcore-sdio-get-clocks-from-device-tree.patch | 0
...heck-if-we-got-correct-clock-data-from-DT.patch | 0
...cumentation-dt-bindings-TI-WiLink-modules.patch | 0
...latfrom-get_max_timeout_count-hook.patch.tofix} | 0
...incorrect-max_discard_to-for-uSDHC.patch.tofix} | 0
...dhci-add-platform-set_timeout-hook.patch.tofix} | 0
...orrect-max-timeout-value-for-uSDHC.patch.tofix} | 0
...DHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch.tofix} | 0
...04-armadeus-add_sx8674_touchscreen_driver.patch | 0
.../0505-armadeus-add_mcp7940x_rtc_driver.patch | 0
66 files changed, 46 insertions(+), 34 deletions(-)
create mode 120000 buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc2.config
copy buildroot/target/device/armadeus/apf27/{apf27-linux-3.13.config => apf27-linux-3.16.config} (100%)
create mode 120000 buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc2.config
copy buildroot/target/device/armadeus/apf28/{apf28-linux-3.14.config => apf28-linux-3.16.config} (100%)
create mode 120000 buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc2.config
copy buildroot/target/device/armadeus/apf51/{apf51-linux-3.13.config => apf51-linux-3.16.config} (100%)
delete mode 120000 buildroot/target/device/armadeus/apf6/apf6-linux-3.15-rc8.config
create mode 120000 buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc2.config
rename buildroot/target/device/armadeus/apf6/{apf6-linux-3.15.config => apf6-linux-3.16.config} (100%)
create mode 120000 patches/linux/3.16-rc2
copy patches/linux/{3.15 => 3.16}/0015-armadeus-logo-add_armadeus-project_tux.patch (100%)
copy patches/linux/{3.15 => 3.16}/0021-armadeus-apf9328.patch (100%)
copy patches/linux/{3.15 => 3.16}/0024-armadeus-apf9328-add_board_to_linux_build_system.patch (100%)
copy patches/linux/{3.15 => 3.16}/0029-armadeus-add_csi_and_spi_registers.patch (100%)
copy patches/linux/{3.15 => 3.16}/0029b-armadeus-add_csi_registers.patch (100%)
copy patches/linux/{3.15 => 3.16}/0030-armadeus-devices-imx1-add_udc_registration.patch (100%)
copy patches/linux/{3.15 => 3.16}/0035-armadeus-re_add_pwm_and_correct_driver.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0050-armadeus-add_custom_drivers_to_kconfig.patch (100%)
copy patches/linux/{3.15 => 3.16}/0073-armadeus-tsc2102.patch (100%)
copy patches/linux/{3.15 => 3.16}/0073-armadeus-tsc2102_integrate_driver_to_linux_build_system.patch (100%)
copy patches/linux/{3.15 => 3.16}/0074-armadeus-tsc2102-touchscreen-add_driver_to_linux_build_system.patch (100%)
copy patches/linux/{3.10 => 3.16}/0074-armadeus-tsc2102-touchscreen.patch (100%)
copy patches/linux/{3.10 => 3.16}/0075-armadeus-spi2-reg-defines.patch (100%)
copy patches/linux/{3.15 => 3.16}/0076-Add-tsc210x-device-tree-support.patch (100%)
copy patches/linux/{3.15 => 3.16}/0100-armadeus-clock_correct_mxc_decode_pll_for_imx1.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0101-armadeus-clock-imx1_avoid_crash_with_module.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0211-linaro-imx-framebuffer-Add_feature_to_setup_PWM_Contrast_Control_Register.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0219-Add-tsc210x-device-tree-support-for-apf27dev.patch (100%)
copy patches/linux/{3.15 => 3.16}/0220-armadeus-dts-apf27dev-fixes-user-led-polarity.patch (100%)
copy patches/linux/{3.15 => 3.16}/0221-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch (100%)
copy patches/linux/{3.15 => 3.16}/0222-armadeus-dts-apf27dev-add_gpio_key_wakeup_behavior.patch (100%)
copy patches/linux/{3.15 => 3.16}/0230-armadeus-fixes-vpu-spll-clock-dependency.patch (100%)
copy patches/linux/{3.10 => 3.16}/0322-armadeus-add_mach_fpga_h.patch (100%)
copy patches/linux/{3.15 => 3.16}/0323-armadeus-mach_fpga_add_dt_support_for_mx27.patch (100%)
copy patches/linux/{3.15 => 3.16}/0400-Add-apf51-basic-dt-support.patch (100%)
copy patches/linux/{3.15 => 3.16}/0401-armadeus-add_apf51dev_baseboard.patch (99%)
copy patches/linux/{3.15 => 3.16}/0407-armadeus-imx51_dts-add_usbphy_for_host1_and_host2.patch (100%)
copy patches/linux/{3.15 => 3.16}/0408-armadeus-imx51-chipidea-usbmisc_imx-add_imx51_support.patch (100%)
copy patches/linux/{3.15 => 3.16}/0409-armadeus-chipidea-add_node_to_select_clk_phy.patch (100%)
copy patches/linux/{3.15 => 3.16}/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch (100%)
copy patches/linux/{3.15 => 3.16}/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch (100%)
copy patches/linux/{3.15 => 3.16}/0420-armadeus-Add-apf28dev-dts.patch (100%)
copy patches/linux/{3.15 => 3.16}/0431-armadeus-clock-mx51-do_not_link_otg_phy_clock_directly_to_osc_ref.patch (100%)
copy patches/linux/{3.15 => 3.16}/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch (100%)
copy patches/linux/{3.15 => 3.16}/0442-armadeus-rtc-mxs-allow_to_use_the_wakeupalarm_functionnality.patch (100%)
copy patches/linux/{3.15 => 3.16}/0444-armadeus-imx27-add-usb.patch.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0445-armadeus-add-apf27-apf27dev-dts-for-USB.patch.tofix (100%)
copy patches/linux/{3.15 => 3.16}/0446-armadeus_add_pm_power_off_function.patch (100%)
copy patches/linux/{3.15 => 3.16}/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch (100%)
copy patches/linux/{3.15 => 3.16}/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch (100%)
copy patches/linux/{3.15 => 3.16}/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch (100%)
copy patches/linux/{3.15 => 3.16}/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch (71%)
copy patches/linux/{3.15 => 3.16}/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch (100%)
copy patches/linux/{3.15 => 3.16}/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch (80%)
copy patches/linux/{3.15 => 3.16}/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch (100%)
copy patches/linux/{3.15 => 3.16}/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch (100%)
copy patches/linux/{3.15 => 3.16}/0496-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch (100%)
copy patches/linux/{3.15 => 3.16}/0497-v3-Documentation-dt-bindings-TI-WiLink-modules.patch (100%)
copy patches/linux/{3.15/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch => 3.16/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch.tofix} (100%)
copy patches/linux/{3.15/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch => 3.16/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch.tofix} (100%)
copy patches/linux/{3.15/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch => 3.16/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch.tofix} (100%)
copy patches/linux/{3.15/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch => 3.16/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch.tofix} (100%)
copy patches/linux/{3.15/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch => 3.16/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch.tofix} (100%)
copy patches/linux/{3.14 => 3.16}/0504-armadeus-add_sx8674_touchscreen_driver.patch (100%)
copy patches/linux/{3.14 => 3.16}/0505-armadeus-add_mcp7940x_rtc_driver.patch (100%)
diff --git a/buildroot/configs/apf6_defconfig b/buildroot/configs/apf6_defconfig
index 9919cbe..9298fae 100644
--- a/buildroot/configs/apf6_defconfig
+++ b/buildroot/configs/apf6_defconfig
@@ -22,7 +22,7 @@ BR2_TARGET_ARMADEUS_NR_SDRAM="2"
BR2_TARGET_ARMADEUS_SDRAM_SIZE="512"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.15"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.16-rc2"
BR2_LINUX_KERNEL_PATCH="../patches/linux/$(BR2_LINUX_KERNEL_VERSION)"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-linux-$(BR2_LINUX_KERNEL_VERSION).config"
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc2.config b/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc2.config
new file mode 120000
index 0000000..946ea8d
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-3.16-rc2.config
@@ -0,0 +1 @@
+apf27-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-3.13.config b/buildroot/target/device/armadeus/apf27/apf27-linux-3.16.config
similarity index 100%
copy from buildroot/target/device/armadeus/apf27/apf27-linux-3.13.config
copy to buildroot/target/device/armadeus/apf27/apf27-linux-3.16.config
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc2.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc2.config
new file mode 120000
index 0000000..8af93d4
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf28/apf28-linux-3.16-rc2.config
@@ -0,0 +1 @@
+apf28-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.14.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.16.config
similarity index 100%
copy from buildroot/target/device/armadeus/apf28/apf28-linux-3.14.config
copy to buildroot/target/device/armadeus/apf28/apf28-linux-3.16.config
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc2.config b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc2.config
new file mode 120000
index 0000000..9c57540
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16-rc2.config
@@ -0,0 +1 @@
+apf51-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-3.13.config b/buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config
similarity index 100%
copy from buildroot/target/device/armadeus/apf51/apf51-linux-3.13.config
copy to buildroot/target/device/armadeus/apf51/apf51-linux-3.16.config
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.15-rc8.config b/buildroot/target/device/armadeus/apf6/apf6-linux-3.15-rc8.config
deleted file mode 120000
index fadcb0d..0000000
--- a/buildroot/target/device/armadeus/apf6/apf6-linux-3.15-rc8.config
+++ /dev/null
@@ -1 +0,0 @@
-apf6-linux-3.15.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc2.config b/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc2.config
new file mode 120000
index 0000000..4f41d2e
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf6/apf6-linux-3.16-rc2.config
@@ -0,0 +1 @@
+apf6-linux-3.16.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.15.config b/buildroot/target/device/armadeus/apf6/apf6-linux-3.16.config
similarity index 100%
rename from buildroot/target/device/armadeus/apf6/apf6-linux-3.15.config
rename to buildroot/target/device/armadeus/apf6/apf6-linux-3.16.config
diff --git a/patches/linux/3.16-rc2 b/patches/linux/3.16-rc2
new file mode 120000
index 0000000..1bc446c
--- /dev/null
+++ b/patches/linux/3.16-rc2
@@ -0,0 +1 @@
+3.16
\ No newline at end of file
diff --git a/patches/linux/3.15/0015-armadeus-logo-add_armadeus-project_tux.patch b/patches/linux/3.16/0015-armadeus-logo-add_armadeus-project_tux.patch
similarity index 100%
copy from patches/linux/3.15/0015-armadeus-logo-add_armadeus-project_tux.patch
copy to patches/linux/3.16/0015-armadeus-logo-add_armadeus-project_tux.patch
diff --git a/patches/linux/3.15/0021-armadeus-apf9328.patch b/patches/linux/3.16/0021-armadeus-apf9328.patch
similarity index 100%
copy from patches/linux/3.15/0021-armadeus-apf9328.patch
copy to patches/linux/3.16/0021-armadeus-apf9328.patch
diff --git a/patches/linux/3.15/0024-armadeus-apf9328-add_board_to_linux_build_system.patch b/patches/linux/3.16/0024-armadeus-apf9328-add_board_to_linux_build_system.patch
similarity index 100%
copy from patches/linux/3.15/0024-armadeus-apf9328-add_board_to_linux_build_system.patch
copy to patches/linux/3.16/0024-armadeus-apf9328-add_board_to_linux_build_system.patch
diff --git a/patches/linux/3.15/0029-armadeus-add_csi_and_spi_registers.patch b/patches/linux/3.16/0029-armadeus-add_csi_and_spi_registers.patch
similarity index 100%
copy from patches/linux/3.15/0029-armadeus-add_csi_and_spi_registers.patch
copy to patches/linux/3.16/0029-armadeus-add_csi_and_spi_registers.patch
diff --git a/patches/linux/3.15/0029b-armadeus-add_csi_registers.patch b/patches/linux/3.16/0029b-armadeus-add_csi_registers.patch
similarity index 100%
copy from patches/linux/3.15/0029b-armadeus-add_csi_registers.patch
copy to patches/linux/3.16/0029b-armadeus-add_csi_registers.patch
diff --git a/patches/linux/3.15/0030-armadeus-devices-imx1-add_udc_registration.patch b/patches/linux/3.16/0030-armadeus-devices-imx1-add_udc_registration.patch
similarity index 100%
copy from patches/linux/3.15/0030-armadeus-devices-imx1-add_udc_registration.patch
copy to patches/linux/3.16/0030-armadeus-devices-imx1-add_udc_registration.patch
diff --git a/patches/linux/3.15/0035-armadeus-re_add_pwm_and_correct_driver.tofix b/patches/linux/3.16/0035-armadeus-re_add_pwm_and_correct_driver.tofix
similarity index 100%
copy from patches/linux/3.15/0035-armadeus-re_add_pwm_and_correct_driver.tofix
copy to patches/linux/3.16/0035-armadeus-re_add_pwm_and_correct_driver.tofix
diff --git a/patches/linux/3.15/0050-armadeus-add_custom_drivers_to_kconfig.patch b/patches/linux/3.16/0050-armadeus-add_custom_drivers_to_kconfig.patch
similarity index 100%
copy from patches/linux/3.15/0050-armadeus-add_custom_drivers_to_kconfig.patch
copy to patches/linux/3.16/0050-armadeus-add_custom_drivers_to_kconfig.patch
diff --git a/patches/linux/3.15/0073-armadeus-tsc2102.patch b/patches/linux/3.16/0073-armadeus-tsc2102.patch
similarity index 100%
copy from patches/linux/3.15/0073-armadeus-tsc2102.patch
copy to patches/linux/3.16/0073-armadeus-tsc2102.patch
diff --git a/patches/linux/3.15/0073-armadeus-tsc2102_integrate_driver_to_linux_build_system.patch b/patches/linux/3.16/0073-armadeus-tsc2102_integrate_driver_to_linux_build_system.patch
similarity index 100%
copy from patches/linux/3.15/0073-armadeus-tsc2102_integrate_driver_to_linux_build_system.patch
copy to patches/linux/3.16/0073-armadeus-tsc2102_integrate_driver_to_linux_build_system.patch
diff --git a/patches/linux/3.15/0074-armadeus-tsc2102-touchscreen-add_driver_to_linux_build_system.patch b/patches/linux/3.16/0074-armadeus-tsc2102-touchscreen-add_driver_to_linux_build_system.patch
similarity index 100%
copy from patches/linux/3.15/0074-armadeus-tsc2102-touchscreen-add_driver_to_linux_build_system.patch
copy to patches/linux/3.16/0074-armadeus-tsc2102-touchscreen-add_driver_to_linux_build_system.patch
diff --git a/patches/linux/3.10/0074-armadeus-tsc2102-touchscreen.patch b/patches/linux/3.16/0074-armadeus-tsc2102-touchscreen.patch
similarity index 100%
copy from patches/linux/3.10/0074-armadeus-tsc2102-touchscreen.patch
copy to patches/linux/3.16/0074-armadeus-tsc2102-touchscreen.patch
diff --git a/patches/linux/3.10/0075-armadeus-spi2-reg-defines.patch b/patches/linux/3.16/0075-armadeus-spi2-reg-defines.patch
similarity index 100%
copy from patches/linux/3.10/0075-armadeus-spi2-reg-defines.patch
copy to patches/linux/3.16/0075-armadeus-spi2-reg-defines.patch
diff --git a/patches/linux/3.15/0076-Add-tsc210x-device-tree-support.patch b/patches/linux/3.16/0076-Add-tsc210x-device-tree-support.patch
similarity index 100%
copy from patches/linux/3.15/0076-Add-tsc210x-device-tree-support.patch
copy to patches/linux/3.16/0076-Add-tsc210x-device-tree-support.patch
diff --git a/patches/linux/3.15/0100-armadeus-clock_correct_mxc_decode_pll_for_imx1.tofix b/patches/linux/3.16/0100-armadeus-clock_correct_mxc_decode_pll_for_imx1.tofix
similarity index 100%
copy from patches/linux/3.15/0100-armadeus-clock_correct_mxc_decode_pll_for_imx1.tofix
copy to patches/linux/3.16/0100-armadeus-clock_correct_mxc_decode_pll_for_imx1.tofix
diff --git a/patches/linux/3.15/0101-armadeus-clock-imx1_avoid_crash_with_module.tofix b/patches/linux/3.16/0101-armadeus-clock-imx1_avoid_crash_with_module.tofix
similarity index 100%
copy from patches/linux/3.15/0101-armadeus-clock-imx1_avoid_crash_with_module.tofix
copy to patches/linux/3.16/0101-armadeus-clock-imx1_avoid_crash_with_module.tofix
diff --git a/patches/linux/3.15/0211-linaro-imx-framebuffer-Add_feature_to_setup_PWM_Contrast_Control_Register.tofix b/patches/linux/3.16/0211-linaro-imx-framebuffer-Add_feature_to_setup_PWM_Contrast_Control_Register.tofix
similarity index 100%
copy from patches/linux/3.15/0211-linaro-imx-framebuffer-Add_feature_to_setup_PWM_Contrast_Control_Register.tofix
copy to patches/linux/3.16/0211-linaro-imx-framebuffer-Add_feature_to_setup_PWM_Contrast_Control_Register.tofix
diff --git a/patches/linux/3.15/0219-Add-tsc210x-device-tree-support-for-apf27dev.patch b/patches/linux/3.16/0219-Add-tsc210x-device-tree-support-for-apf27dev.patch
similarity index 100%
copy from patches/linux/3.15/0219-Add-tsc210x-device-tree-support-for-apf27dev.patch
copy to patches/linux/3.16/0219-Add-tsc210x-device-tree-support-for-apf27dev.patch
diff --git a/patches/linux/3.15/0220-armadeus-dts-apf27dev-fixes-user-led-polarity.patch b/patches/linux/3.16/0220-armadeus-dts-apf27dev-fixes-user-led-polarity.patch
similarity index 100%
copy from patches/linux/3.15/0220-armadeus-dts-apf27dev-fixes-user-led-polarity.patch
copy to patches/linux/3.16/0220-armadeus-dts-apf27dev-fixes-user-led-polarity.patch
diff --git a/patches/linux/3.15/0221-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch b/patches/linux/3.16/0221-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch
similarity index 100%
copy from patches/linux/3.15/0221-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch
copy to patches/linux/3.16/0221-armadeus-dts-apf27-add_i2c_eeprom_24c02.patch
diff --git a/patches/linux/3.15/0222-armadeus-dts-apf27dev-add_gpio_key_wakeup_behavior.patch b/patches/linux/3.16/0222-armadeus-dts-apf27dev-add_gpio_key_wakeup_behavior.patch
similarity index 100%
copy from patches/linux/3.15/0222-armadeus-dts-apf27dev-add_gpio_key_wakeup_behavior.patch
copy to patches/linux/3.16/0222-armadeus-dts-apf27dev-add_gpio_key_wakeup_behavior.patch
diff --git a/patches/linux/3.15/0230-armadeus-fixes-vpu-spll-clock-dependency.patch b/patches/linux/3.16/0230-armadeus-fixes-vpu-spll-clock-dependency.patch
similarity index 100%
copy from patches/linux/3.15/0230-armadeus-fixes-vpu-spll-clock-dependency.patch
copy to patches/linux/3.16/0230-armadeus-fixes-vpu-spll-clock-dependency.patch
diff --git a/patches/linux/3.10/0322-armadeus-add_mach_fpga_h.patch b/patches/linux/3.16/0322-armadeus-add_mach_fpga_h.patch
similarity index 100%
copy from patches/linux/3.10/0322-armadeus-add_mach_fpga_h.patch
copy to patches/linux/3.16/0322-armadeus-add_mach_fpga_h.patch
diff --git a/patches/linux/3.15/0323-armadeus-mach_fpga_add_dt_support_for_mx27.patch b/patches/linux/3.16/0323-armadeus-mach_fpga_add_dt_support_for_mx27.patch
similarity index 100%
copy from patches/linux/3.15/0323-armadeus-mach_fpga_add_dt_support_for_mx27.patch
copy to patches/linux/3.16/0323-armadeus-mach_fpga_add_dt_support_for_mx27.patch
diff --git a/patches/linux/3.15/0400-Add-apf51-basic-dt-support.patch b/patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch
similarity index 100%
copy from patches/linux/3.15/0400-Add-apf51-basic-dt-support.patch
copy to patches/linux/3.16/0400-Add-apf51-basic-dt-support.patch
diff --git a/patches/linux/3.15/0401-armadeus-add_apf51dev_baseboard.patch b/patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
similarity index 99%
copy from patches/linux/3.15/0401-armadeus-add_apf51dev_baseboard.patch
copy to patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
index c490052..1f8bcb7 100644
--- a/patches/linux/3.15/0401-armadeus-add_apf51dev_baseboard.patch
+++ b/patches/linux/3.16/0401-armadeus-add_apf51dev_baseboard.patch
@@ -88,4 +88,3 @@ Index: linux-3.14-rc4/arch/arm/boot/dts/imx51-apf51dev.dts
+ };
};
};
-
diff --git a/patches/linux/3.15/0407-armadeus-imx51_dts-add_usbphy_for_host1_and_host2.patch b/patches/linux/3.16/0407-armadeus-imx51_dts-add_usbphy_for_host1_and_host2.patch
similarity index 100%
copy from patches/linux/3.15/0407-armadeus-imx51_dts-add_usbphy_for_host1_and_host2.patch
copy to patches/linux/3.16/0407-armadeus-imx51_dts-add_usbphy_for_host1_and_host2.patch
diff --git a/patches/linux/3.15/0408-armadeus-imx51-chipidea-usbmisc_imx-add_imx51_support.patch b/patches/linux/3.16/0408-armadeus-imx51-chipidea-usbmisc_imx-add_imx51_support.patch
similarity index 100%
copy from patches/linux/3.15/0408-armadeus-imx51-chipidea-usbmisc_imx-add_imx51_support.patch
copy to patches/linux/3.16/0408-armadeus-imx51-chipidea-usbmisc_imx-add_imx51_support.patch
diff --git a/patches/linux/3.15/0409-armadeus-chipidea-add_node_to_select_clk_phy.patch b/patches/linux/3.16/0409-armadeus-chipidea-add_node_to_select_clk_phy.patch
similarity index 100%
copy from patches/linux/3.15/0409-armadeus-chipidea-add_node_to_select_clk_phy.patch
copy to patches/linux/3.16/0409-armadeus-chipidea-add_node_to_select_clk_phy.patch
diff --git a/patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch b/patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
similarity index 100%
copy from patches/linux/3.15/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
copy to patches/linux/3.16/0412-armadeus-imx51-dts-add-pin-definition-for-uart1.patch
diff --git a/patches/linux/3.15/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch b/patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
similarity index 100%
copy from patches/linux/3.15/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
copy to patches/linux/3.16/0414-armadeus-dts-apf51dev-add_gpio_key_wakeup_behavior.patch
diff --git a/patches/linux/3.15/0420-armadeus-Add-apf28dev-dts.patch b/patches/linux/3.16/0420-armadeus-Add-apf28dev-dts.patch
similarity index 100%
copy from patches/linux/3.15/0420-armadeus-Add-apf28dev-dts.patch
copy to patches/linux/3.16/0420-armadeus-Add-apf28dev-dts.patch
diff --git a/patches/linux/3.15/0431-armadeus-clock-mx51-do_not_link_otg_phy_clock_directly_to_osc_ref.patch b/patches/linux/3.16/0431-armadeus-clock-mx51-do_not_link_otg_phy_clock_directly_to_osc_ref.patch
similarity index 100%
copy from patches/linux/3.15/0431-armadeus-clock-mx51-do_not_link_otg_phy_clock_directly_to_osc_ref.patch
copy to patches/linux/3.16/0431-armadeus-clock-mx51-do_not_link_otg_phy_clock_directly_to_osc_ref.patch
diff --git a/patches/linux/3.15/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch b/patches/linux/3.16/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
similarity index 100%
copy from patches/linux/3.15/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
copy to patches/linux/3.16/0441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
diff --git a/patches/linux/3.15/0442-armadeus-rtc-mxs-allow_to_use_the_wakeupalarm_functionnality.patch b/patches/linux/3.16/0442-armadeus-rtc-mxs-allow_to_use_the_wakeupalarm_functionnality.patch
similarity index 100%
copy from patches/linux/3.15/0442-armadeus-rtc-mxs-allow_to_use_the_wakeupalarm_functionnality.patch
copy to patches/linux/3.16/0442-armadeus-rtc-mxs-allow_to_use_the_wakeupalarm_functionnality.patch
diff --git a/patches/linux/3.15/0444-armadeus-imx27-add-usb.patch.tofix b/patches/linux/3.16/0444-armadeus-imx27-add-usb.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0444-armadeus-imx27-add-usb.patch.tofix
copy to patches/linux/3.16/0444-armadeus-imx27-add-usb.patch.tofix
diff --git a/patches/linux/3.15/0445-armadeus-add-apf27-apf27dev-dts-for-USB.patch.tofix b/patches/linux/3.16/0445-armadeus-add-apf27-apf27dev-dts-for-USB.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0445-armadeus-add-apf27-apf27dev-dts-for-USB.patch.tofix
copy to patches/linux/3.16/0445-armadeus-add-apf27-apf27dev-dts-for-USB.patch.tofix
diff --git a/patches/linux/3.15/0446-armadeus_add_pm_power_off_function.patch b/patches/linux/3.16/0446-armadeus_add_pm_power_off_function.patch
similarity index 100%
copy from patches/linux/3.15/0446-armadeus_add_pm_power_off_function.patch
copy to patches/linux/3.16/0446-armadeus_add_pm_power_off_function.patch
diff --git a/patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch b/patches/linux/3.16/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
similarity index 100%
copy from patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
copy to patches/linux/3.16/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
diff --git a/patches/linux/3.15/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch b/patches/linux/3.16/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
similarity index 100%
copy from patches/linux/3.15/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
copy to patches/linux/3.16/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
diff --git a/patches/linux/3.15/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch b/patches/linux/3.16/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
similarity index 100%
copy from patches/linux/3.15/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
copy to patches/linux/3.16/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
diff --git a/patches/linux/3.15/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch b/patches/linux/3.16/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
similarity index 71%
copy from patches/linux/3.15/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
copy to patches/linux/3.16/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
index 5dc1500..67fe8a0 100644
--- a/patches/linux/3.15/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
+++ b/patches/linux/3.16/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
@@ -32,11 +32,11 @@ drivers/net/wireless/ti/wlcore/main.c | 3 +--
include/linux/wl12xx.h | 1 -
4 files changed, 3 insertions(+), 4 deletions(-)
-Index: linux-3.13/drivers/net/wireless/ti/wlcore/main.c
+Index: linux-3.16-rc1/drivers/net/wireless/ti/wlcore/main.c
===================================================================
---- linux-3.13.orig/drivers/net/wireless/ti/wlcore/main.c
-+++ linux-3.13/drivers/net/wireless/ti/wlcore/main.c
-@@ -6033,7 +6033,6 @@ static void wlcore_nvs_cb(const struct f
+--- linux-3.16-rc1.orig/drivers/net/wireless/ti/wlcore/main.c
++++ linux-3.16-rc1/drivers/net/wireless/ti/wlcore/main.c
+@@ -6050,7 +6050,6 @@ static void wlcore_nvs_cb(const struct f
struct wl1271 *wl = context;
struct platform_device *pdev = wl->pdev;
struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
@@ -44,7 +44,7 @@ Index: linux-3.13/drivers/net/wireless/ti/wlcore/main.c
int ret;
irq_handler_t hardirq_fn = NULL;
-@@ -6081,7 +6080,7 @@ static void wlcore_nvs_cb(const struct f
+@@ -6098,7 +6097,7 @@ static void wlcore_nvs_cb(const struct f
if (!ret) {
wl->irq_wake_enabled = true;
device_init_wakeup(wl->dev, 1);
@@ -53,24 +53,24 @@ Index: linux-3.13/drivers/net/wireless/ti/wlcore/main.c
wl->hw->wiphy->wowlan = &wlcore_wowlan_support;
}
#endif
-Index: linux-3.13/drivers/net/wireless/ti/wlcore/sdio.c
+Index: linux-3.16-rc1/drivers/net/wireless/ti/wlcore/sdio.c
===================================================================
---- linux-3.13.orig/drivers/net/wireless/ti/wlcore/sdio.c
-+++ linux-3.13/drivers/net/wireless/ti/wlcore/sdio.c
-@@ -260,7 +260,7 @@ static int wl1271_probe(struct sdio_func
+--- linux-3.16-rc1.orig/drivers/net/wireless/ti/wlcore/sdio.c
++++ linux-3.16-rc1/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -257,7 +257,7 @@ static int wl1271_probe(struct sdio_func
dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
if (mmcflags & MMC_PM_KEEP_POWER)
-- pdev_data->pdata->pwr_in_suspend = true;
+- pdev_data.pdata->pwr_in_suspend = true;
+ pdev_data->pwr_in_suspend = true;
sdio_set_drvdata(func, glue);
-Index: linux-3.13/drivers/net/wireless/ti/wlcore/wlcore_i.h
+Index: linux-3.16-rc1/drivers/net/wireless/ti/wlcore/wlcore_i.h
===================================================================
---- linux-3.13.orig/drivers/net/wireless/ti/wlcore/wlcore_i.h
-+++ linux-3.13/drivers/net/wireless/ti/wlcore/wlcore_i.h
-@@ -209,6 +209,7 @@ struct wl1271_if_operations {
+--- linux-3.16-rc1.orig/drivers/net/wireless/ti/wlcore/wlcore_i.h
++++ linux-3.16-rc1/drivers/net/wireless/ti/wlcore/wlcore_i.h
+@@ -200,6 +200,7 @@ struct wl1271_if_operations {
struct wlcore_platdev_data {
struct wl12xx_platform_data *pdata;
struct wl1271_if_operations *if_ops;
@@ -78,12 +78,12 @@ Index: linux-3.13/drivers/net/wireless/ti/wlcore/wlcore_i.h
};
#define MAX_NUM_KEYS 14
-Index: linux-3.13/include/linux/wl12xx.h
+Index: linux-3.16-rc1/include/linux/wl12xx.h
===================================================================
---- linux-3.13.orig/include/linux/wl12xx.h
-+++ linux-3.13/include/linux/wl12xx.h
-@@ -55,7 +55,6 @@ struct wl12xx_platform_data {
- bool use_eeprom;
+--- linux-3.16-rc1.orig/include/linux/wl12xx.h
++++ linux-3.16-rc1/include/linux/wl12xx.h
+@@ -59,7 +59,6 @@ struct wl12xx_platform_data {
+ int irq;
int board_ref_clock;
int board_tcxo_clock;
- bool pwr_in_suspend;
diff --git a/patches/linux/3.15/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch b/patches/linux/3.16/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
similarity index 100%
copy from patches/linux/3.15/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
copy to patches/linux/3.16/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
diff --git a/patches/linux/3.15/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch b/patches/linux/3.16/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
similarity index 80%
copy from patches/linux/3.15/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
copy to patches/linux/3.16/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
index 5b61ece..e7f5676 100644
--- a/patches/linux/3.15/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
+++ b/patches/linux/3.16/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
@@ -30,10 +30,10 @@ Reviewed-by: Felipe Balbi <ba...@ti...>
drivers/net/wireless/ti/wlcore/sdio.c | 69 ++++++++++++++++++++++++++++++++---
1 file changed, 63 insertions(+), 6 deletions(-)
-diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
-index 4c7e8ac..9370d7e 100644
---- a/drivers/net/wireless/ti/wlcore/sdio.c
-+++ b/drivers/net/wireless/ti/wlcore/sdio.c
+Index: linux-3.16-rc1/drivers/net/wireless/ti/wlcore/sdio.c
+===================================================================
+--- linux-3.16-rc1.orig/drivers/net/wireless/ti/wlcore/sdio.c
++++ linux-3.16-rc1/drivers/net/wireless/ti/wlcore/sdio.c
@@ -30,7 +30,7 @@
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/card.h>
@@ -43,7 +43,7 @@ index 4c7e8ac..9370d7e 100644
#include <linux/wl12xx.h>
#include <linux/pm_runtime.h>
#include <linux/printk.h>
-@@ -214,6 +214,43 @@ static struct wl1271_if_operations sdio_ops = {
+@@ -214,6 +214,43 @@ static struct wl1271_if_operations sdio_
.set_block_size = wl1271_sdio_set_block_size,
};
@@ -87,7 +87,7 @@ index 4c7e8ac..9370d7e 100644
static int wl1271_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
-@@ -248,11 +285,22 @@ static int wl1271_probe(struct sdio_func *func,
+@@ -245,11 +282,22 @@ static int wl1271_probe(struct sdio_func
/* Use block mode for transferring over one block size of data */
func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
@@ -97,23 +97,32 @@ index 4c7e8ac..9370d7e 100644
+ */
+
+ /* Try to get legacy platform data from the board file */
- pdev_data->pdata = wl12xx_get_platform_data();
- if (IS_ERR(pdev_data->pdata)) {
-- ret = PTR_ERR(pdev_data->pdata);
+ pdev_data.pdata = wl12xx_get_platform_data();
+ if (IS_ERR(pdev_data.pdata)) {
+- ret = PTR_ERR(pdev_data.pdata);
- dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
- goto out_free_glue;
+ dev_info(&func->dev,
+ "legacy platform data not found, trying device tree\n");
+
-+ pdev_data->pdata = wlcore_get_pdata_from_of(&func->dev);
-+ if (IS_ERR(pdev_data->pdata)) {
++ pdev_data.pdata = wlcore_get_pdata_from_of(&func->dev);
++ if (IS_ERR(pdev_data.pdata)) {
+ dev_err(&func->dev, "can't get platform data\n");
+ goto out_free_glue;
+ }
}
/* if sdio can keep power while host is suspended, enable wow */
-@@ -386,16 +434,25 @@ static const struct dev_pm_ops wl1271_sdio_pm_ops = {
+@@ -257,7 +305,7 @@ static int wl1271_probe(struct sdio_func
+ dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
+
+ if (mmcflags & MMC_PM_KEEP_POWER)
+- pdev_data->pwr_in_suspend = true;
++ pdev_data.pwr_in_suspend = true;
+
+ sdio_set_drvdata(func, glue);
+
+@@ -380,16 +428,25 @@ static const struct dev_pm_ops wl1271_sd
};
#endif
diff --git a/patches/linux/3.15/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch b/patches/linux/3.16/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
similarity index 100%
copy from patches/linux/3.15/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
copy to patches/linux/3.16/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
diff --git a/patches/linux/3.15/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch b/patches/linux/3.16/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
similarity index 100%
copy from patches/linux/3.15/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
copy to patches/linux/3.16/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
diff --git a/patches/linux/3.15/0496-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch b/patches/linux/3.16/0496-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
similarity index 100%
copy from patches/linux/3.15/0496-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
copy to patches/linux/3.16/0496-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
diff --git a/patches/linux/3.15/0497-v3-Documentation-dt-bindings-TI-WiLink-modules.patch b/patches/linux/3.16/0497-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
similarity index 100%
copy from patches/linux/3.15/0497-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
copy to patches/linux/3.16/0497-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
diff --git a/patches/linux/3.15/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch b/patches/linux/3.16/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch
copy to patches/linux/3.16/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch.tofix
diff --git a/patches/linux/3.15/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch b/patches/linux/3.16/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch
copy to patches/linux/3.16/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch.tofix
diff --git a/patches/linux/3.15/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch b/patches/linux/3.16/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch
copy to patches/linux/3.16/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch.tofix
diff --git a/patches/linux/3.15/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch b/patches/linux/3.16/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch
copy to patches/linux/3.16/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch.tofix
diff --git a/patches/linux/3.15/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch b/patches/linux/3.16/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch.tofix
similarity index 100%
copy from patches/linux/3.15/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch
copy to patches/linux/3.16/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch.tofix
diff --git a/patches/linux/3.14/0504-armadeus-add_sx8674_touchscreen_driver.patch b/patches/linux/3.16/0504-armadeus-add_sx8674_touchscreen_driver.patch
similarity index 100%
copy from patches/linux/3.14/0504-armadeus-add_sx8674_touchscreen_driver.patch
copy to patches/linux/3.16/0504-armadeus-add_sx8674_touchscreen_driver.patch
diff --git a/patches/linux/3.14/0505-armadeus-add_mcp7940x_rtc_driver.patch b/patches/linux/3.16/0505-armadeus-add_mcp7940x_rtc_driver.patch
similarity index 100%
copy from patches/linux/3.14/0505-armadeus-add_mcp7940x_rtc_driver.patch
copy to patches/linux/3.16/0505-armadeus-add_mcp7940x_rtc_driver.patch
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-17 08:30:53
|
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 9d1495d3ac1526e85bd2779dec7e35c0f80b69e9 (commit)
from 8bacd195869d02d4a09c6612fb6b735878b28e6a (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 9d1495d3ac1526e85bd2779dec7e35c0f80b69e9
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 17 10:30:31 2014 +0200
[AS_DEVICES] Fixes some compilation warnings and do some beautifying while we are at it
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/Makefile | 8 +++++---
target/packages/as_devices/c/as_93lcxx.c | 27 ++++++++++-----------------
target/packages/as_devices/c/as_helpers.c | 8 +++++---
target/packages/as_devices/test_c.h | 27 ++++++++++-----------------
4 files changed, 30 insertions(+), 40 deletions(-)
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 53ba79a..8ea7426 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -37,14 +37,16 @@ ARCHIVE_CMD=ar
ARCHIVE_OPTS=-cvq
$(LIBNAME): $(OBJ)
- $(CC) -shared -Wl,-soname,$(SONAME) -o $(SONAME) $(OBJ)
- ln -sf $(SONAME) $(LIBNAME)
+ @$(CC) -shared -Wl,-soname,$(SONAME) -o $(SONAME) $(OBJ)
+ @ln -sf $(SONAME) $(LIBNAME)
+ @echo " LNK $@"
$(STAT_LIB): $(OBJ)
$(ARCHIVE_CMD) $(ARCHIVE_OPTS) $(STAT_LIB) $(OBJ)
%.o: %.c
- $(CC) -fPIC -o $@ -c $< $(CFLAGS)
+ @$(CC) -fPIC -o $@ -c $< $(CFLAGS)
+ @echo " CC $@"
clean:
rm -f $(OBJ) $(BINARY) $(LIBNAME) $(SONAME)
diff --git a/target/packages/as_devices/c/as_93lcxx.c b/target/packages/as_devices/c/as_93lcxx.c
index 3f463ce..a1d17b9 100644
--- a/target/packages/as_devices/c/as_93lcxx.c
+++ b/target/packages/as_devices/c/as_93lcxx.c
@@ -14,7 +14,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * Copyright (C) 2009 Fabien Marteau <fab...@ar...>
+ * Author: Fabien Marteau <fab...@ar...>
+ * Copyright (C) 2009-2014 The Armadeus Project & Armadeus Systems
*
*/
@@ -99,8 +100,7 @@ struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
return NULL;
dev = (struct as_93lcxx_device *)malloc(sizeof(struct as_93lcxx_device));
- if (dev == NULL)
- {
+ if (dev == NULL) {
ERROR("Can't allocate memory for eeprom structure device\n");
return NULL;
}
@@ -131,8 +131,7 @@ int32_t as_93lcxx_read(struct as_93lcxx_device *aDev, uint16_t aAddress)
data_out = as_spi_msg(aDev->fd, msg,
3 + add_length + aDev->word_size,
aDev->speed);
- if (data_out < 0)
- {
+ if (data_out < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -159,7 +158,7 @@ int32_t as_93lcxx_ewen(struct as_93lcxx_device *aDev)
ret = as_spi_msg(aDev->fd, msg,
3 + add_length,
aDev->speed);
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -184,8 +183,7 @@ int32_t as_93lcxx_erase(struct as_93lcxx_device *aDev, uint16_t aAddress)
ret = as_spi_msg(aDev->fd, msg,
3 + add_length + aDev->word_size,
aDev->speed);
- if (ret < 0)
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -213,8 +211,7 @@ int32_t as_93lcxx_erase_all(struct as_93lcxx_device *aDev)
ret = as_spi_msg(aDev->fd, msg,
3 + add_length,
aDev->speed);
- if (ret < 0)
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -246,8 +243,7 @@ int32_t as_93lcxx_write(struct as_93lcxx_device *aDev,
ret = as_spi_msg(aDev->fd, msg,
3 + add_length + aDev->word_size,
aDev->speed);
- if (ret < 0)
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -278,8 +274,7 @@ int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
ret = as_spi_msg(aDev->fd, msg,
3 + add_length + aDev->word_size,
aDev->speed);
- if (ret < 0)
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -306,8 +301,7 @@ int32_t as_93lcxx_ewds(struct as_93lcxx_device *aDev)
ret = as_spi_msg(aDev->fd, msg,
3 + add_length,
aDev->speed);
- if (ret < 0)
- {
+ if (ret < 0) {
ERROR("Error on forging spi message\n");
return -1;
}
@@ -323,4 +317,3 @@ void as_93lcxx_close(struct as_93lcxx_device *aDev)
free(aDev);
}
-
diff --git a/target/packages/as_devices/c/as_helpers.c b/target/packages/as_devices/c/as_helpers.c
index 9ae0b9e..068a64a 100644
--- a/target/packages/as_devices/c/as_helpers.c
+++ b/target/packages/as_devices/c/as_helpers.c
@@ -105,7 +105,8 @@ int as_read_int(int fd, int *value_res)
int value;
ret = as_read_buffer(fd, buf, SIZEOFBUFF);
- if (ret < 0) return ret;
+ if (ret < 0)
+ return ret;
buf[ret-1] = '\0';
value = strtol(buf, NULL, 10);
*value_res = value;
@@ -117,13 +118,12 @@ int as_helpers_get_platform(void)
{
FILE *plat_file;
char name[8];
- int ret;
plat_file = fopen("/etc/machine", "r");
if (!plat_file)
return APF_UNKNOWN;
- ret = fscanf(plat_file, "%s", name);
+ fscanf(plat_file, "%s", name);
fclose(plat_file);
if (!strcmp(name, "APF9328"))
@@ -139,8 +139,10 @@ int as_helpers_get_platform(void)
char *as_helpers_get_root()
{
char * root;
+
root = getenv("AS_DEVICES_ROOT");
if (root)
return root;
+
return "";
}
diff --git a/target/packages/as_devices/test_c.h b/target/packages/as_devices/test_c.h
index fb41a04..20ac106 100644
--- a/target/packages/as_devices/test_c.h
+++ b/target/packages/as_devices/test_c.h
@@ -437,10 +437,8 @@ void test_gpio()
struct as_gpio_device *gpio_dev;
int32_t ret;
int32_t value;
- int pin_num = 173; /* default F13 */
- int port_direction = 0;
- int port_value = 1;
- int platform;
+ int pin_num = 173; /* default: PF13 */
+ int pin_value = 1, platform;
platform = as_helpers_get_platform();
switch (platform) {
@@ -456,21 +454,19 @@ void test_gpio()
default:
break;
}
+
gpio_dev = as_gpio_open(pin_num);
- if (gpio_dev == NULL)
- {
+ if (gpio_dev == NULL) {
printf("Error can't open gpio %d\nHave you got gpiolib ?\n", pin_num);
pressEnterToContinue();
return ;
}
- ret = as_gpio_get_pin_value(gpio_dev);
- if (ret < 0)
- {
+
+ pin_value = as_gpio_get_pin_value(gpio_dev);
+ if (pin_value < 0) {
printf("Error, can't get pin value\n");
return;
}
- port_value = ret;
-
while(buffer[0] != 'q')
{
@@ -513,7 +509,6 @@ void test_gpio()
pressEnterToContinue();
break;
}
- port_direction = value;
printf("Ok direction changed\n");
pressEnterToContinue();
break;
@@ -530,15 +525,13 @@ void test_gpio()
pressEnterToContinue();
break;
case '4' : printf("Get value \n");
- ret = as_gpio_get_pin_value(gpio_dev);
- if (ret < 0)
- {
+ pin_value = as_gpio_get_pin_value(gpio_dev);
+ if (pin_value < 0) {
printf("Error, can't get pin value\n");
pressEnterToContinue();
break;
}
- printf("Value is %d\n", ret);
- port_value = ret;
+ printf("Value is %d\n", pin_value);
pressEnterToContinue();
break;
case '5':
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-17 07:23:33
|
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 8bacd195869d02d4a09c6612fb6b735878b28e6a (commit)
from 88751ec53f243b4d5445796962567272f789b6f4 (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 8bacd195869d02d4a09c6612fb6b735878b28e6a
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 17 09:23:11 2014 +0200
[BUILDROOT] 2013.11: fixes some comments in pygame package (Numeric has been deprecated for Numpy in Pygame)
-----------------------------------------------------------------------
Summary of changes:
.../2013.11/083-pygame-armadeus_addons.patch | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/patches/buildroot/2013.11/083-pygame-armadeus_addons.patch b/patches/buildroot/2013.11/083-pygame-armadeus_addons.patch
index 7b9b0e6..8242352 100644
--- a/patches/buildroot/2013.11/083-pygame-armadeus_addons.patch
+++ b/patches/buildroot/2013.11/083-pygame-armadeus_addons.patch
@@ -1,4 +1,4 @@
-Will be useful when smpeg and python-numeric packages will be available in BR.
+Will be useful when smpeg and python-numpy packages will be available in BR.
:-)
Signed-off-by: Julien Boibessot <jul...@ar...>
@@ -13,20 +13,20 @@ Index: buildroot/package/python-pygame/Config.in
+config BR2_PACKAGE_PYTHON_PYGAME_SNDARRAY
+ bool "pygame.sndarray"
-+ depends on BR2_PACKAGE_PYTHON_PYGAME_MIXER && BR2_PACKAGE_PYTHON_NUMERIC
++ depends on BR2_PACKAGE_PYTHON_PYGAME_MIXER && BR2_PACKAGE_PYTHON_NUMPY
+ help
+ pygame module for accessing sound sample data
+
-+comment "pygame.sndarray depends on Python's Numeric extension that is not (yet) supported"
++comment "pygame.sndarray depends on Python's Numpy extension that is not (yet) supported"
+ depends on !BR2_PACKAGE_PYTHON_PYGAME_SNDARRAY
+
+config BR2_PACKAGE_PYTHON_PYGAME_SURFARRAY
+ bool "pygame.surfarray"
-+ depends on BR2_PACKAGE_PYTHON_NUMERIC
++ depends on BR2_PACKAGE_PYTHON_NUMPY
+ help
+ pygame module for accessing surface pixel data using array interfaces
+
-+comment "pygame.surfarray depends on Python's Numeric extension that is not (yet) supported"
++comment "pygame.surfarray depends on Python's Numpy extension that is not (yet) supported"
+ depends on !BR2_PACKAGE_PYTHON_PYGAME_SURFARRAY
+
+config BR2_PACKAGE_PYTHON_PYGAME_MOVIE
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-17 07:00:29
|
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 88751ec53f243b4d5445796962567272f789b6f4 (commit)
from 9ad2bf81e004b8a4f50e5343e1279cbdbf8433da (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 88751ec53f243b4d5445796962567272f789b6f4
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 17 08:59:48 2014 +0200
[BUILDROOT] 2013.11: Add support for Tkinter in Python
-----------------------------------------------------------------------
Summary of changes:
...12-armadeus-add-tkinter-support-to-python.patch | 50 ++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
create mode 100644 patches/buildroot/2013.11/012-armadeus-add-tkinter-support-to-python.patch
diff --git a/patches/buildroot/2013.11/012-armadeus-add-tkinter-support-to-python.patch b/patches/buildroot/2013.11/012-armadeus-add-tkinter-support-to-python.patch
new file mode 100644
index 0000000..baeadaa
--- /dev/null
+++ b/patches/buildroot/2013.11/012-armadeus-add-tkinter-support-to-python.patch
@@ -0,0 +1,50 @@
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: buildroot/package/python/Config.in
+===================================================================
+--- buildroot.orig/package/python/Config.in 2014-06-17 08:26:47.723364227 +0200
++++ buildroot/package/python/Config.in 2014-06-17 08:34:11.573565170 +0200
+@@ -78,6 +78,18 @@
+ help
+ _ssl module for Python (required for https in urllib etc).
+
++config BR2_PACKAGE_PYTHON_TKINTER
++ depends on BR2_PACKAGE_XORG7
++ depends on BR2_PACKAGE_TCL
++ select BR2_PACKAGE_TK
++ bool "tkinter"
++ help
++ Tkinter module for Python.
++
++comment "tkinter needs a X server and tcl"
++ depends on !BR2_PACKAGE_XORG7
++ depends on !BR2_PACKAGE_TCL
++
+ config BR2_PACKAGE_PYTHON_UNICODEDATA
+ bool "unicodedata module"
+ default y
+Index: buildroot/package/python/python.mk
+===================================================================
+--- buildroot.orig/package/python/python.mk 2014-06-17 08:26:39.363322790 +0200
++++ buildroot/package/python/python.mk 2014-06-17 08:37:13.726468410 +0200
+@@ -112,6 +112,12 @@
+ PYTHON_DEPENDENCIES += openssl
+ endif
+
++ifeq ($(BR2_PACKAGE_PYTHON_TKINTER),y)
++PYTHON_DEPENDENCIES += tk
++else
++PYTHON_CONF_OPT += --disable-tk
++endif
++
+ PYTHON_CONF_ENV += \
+ PYTHON_FOR_BUILD=$(HOST_PYTHON_DIR)/python \
+ PGEN_FOR_BUILD=$(HOST_PYTHON_DIR)/Parser/pgen \
+@@ -125,7 +131,6 @@
+ --disable-test-modules \
+ --disable-lib2to3 \
+ --disable-gdbm \
+- --disable-tk \
+ --disable-nis \
+ --disable-dbm
+
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-17 05:51:11
|
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 9ad2bf81e004b8a4f50e5343e1279cbdbf8433da (commit)
via b5303ed94c6a802c969b020d2badab887bf386f3 (commit)
from e234251cf5233367e4b7fb8ed0482a324d6c853c (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 9ad2bf81e004b8a4f50e5343e1279cbdbf8433da
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 17 07:49:12 2014 +0200
[BUILDROOT] 2013.11: Add Tk package
commit b5303ed94c6a802c969b020d2badab887bf386f3
Author: Julien Boibessot <jul...@ar...>
Date: Mon Jun 16 20:19:17 2014 +0200
[AS_DEVICES] python/Makefile: indent
-----------------------------------------------------------------------
Summary of changes:
.../2013.11/011-armadeus-add-tk-package.patch | 71 ++++++++++++++++++++
patches/buildroot/2013.11/cleanup_buildroot.sh | 1 +
target/packages/as_devices/python/Makefile | 38 +++++-----
3 files changed, 91 insertions(+), 19 deletions(-)
create mode 100644 patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
diff --git a/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch b/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
new file mode 100644
index 0000000..3bb3ef5
--- /dev/null
+++ b/patches/buildroot/2013.11/011-armadeus-add-tk-package.patch
@@ -0,0 +1,71 @@
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: buildroot/package/Config.in
+===================================================================
+--- buildroot.orig/package/Config.in 2014-06-16 21:14:28.273941318 +0200
++++ buildroot/package/Config.in 2014-06-16 21:19:46.000000000 +0200
+@@ -441,6 +441,7 @@
+ if BR2_PACKAGE_TCL
+ menu "tcl libraries/modules"
+ source "package/tcllib/Config.in"
++source "package/tk/Config.in"
+ endmenu
+ endif
+ endmenu
+Index: buildroot/package/tk/Config.in
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ buildroot/package/tk/Config.in 2014-06-16 21:20:18.935680166 +0200
+@@ -0,0 +1,18 @@
++config BR2_PACKAGE_TK
++ bool "tk"
++ depends on BR2_PACKAGE_TCL
++ depends on BR2_PACKAGE_XORG7
++ help
++ Tk is a GUI toolkit for Tcl
++
++ http://www.tcl.tk/
++
++config BR2_PACKAGE_TK_NO_DEMOS
++ bool "remove demos"
++ default y
++ depends on BR2_PACKAGE_TK
++ help
++ Remove Tk demo files from target rootfs
++
++comment "Tk needs X.org, Tcl"
++ depends on !BR2_PACKAGE_TCL || !BR2_PACKAGE_XORG7
+Index: buildroot/package/tk/tk.mk
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ buildroot/package/tk/tk.mk 2014-06-16 21:20:26.187716126 +0200
+@@ -0,0 +1,29 @@
++################################################################################
++#
++# tk
++#
++################################################################################
++
++TK_VERSION_MAJOR = 8.4
++TK_VERSION = $(TK_VERSION_MAJOR).20
++TK_SOURCE = tk$(TK_VERSION)-src.tar.gz
++TK_SITE = http://downloads.sourceforge.net/project/tcl/Tcl/$(TK_VERSION)
++TK_LICENSE = tcl license
++TK_LICENSE_FILES = license.terms
++TK_INSTALL_STAGING = YES
++TK_DEPENDENCIES = tcl xlib_libX11
++
++# shouldn't be $(STAGING_DIR) ?
++TK_CONF_OPT = \
++ --with-tcl=$(TARGET_DIR)/usr/lib \
++ --with-x \
++ --x-includes=$(STAGING_DIR)/usr/include/X11
++
++ifeq ($(BR2_PACKAGE_TK_NO_DEMOS),y)
++define TCL_REMOVE_DEMOS
++ rm -rf $(TARGET_DIR)/usr/lib/tk$(TK_VERSION_MAJOR)/demos
++endef
++TK_POST_INSTALL_TARGET_HOOKS += TK_REMOVE_DEMOS
++endif
++
++$(eval $(autotools-package))
diff --git a/patches/buildroot/2013.11/cleanup_buildroot.sh b/patches/buildroot/2013.11/cleanup_buildroot.sh
index 859670a..553ee57 100755
--- a/patches/buildroot/2013.11/cleanup_buildroot.sh
+++ b/patches/buildroot/2013.11/cleanup_buildroot.sh
@@ -87,3 +87,4 @@ rm -rf buildroot/package/agg/
rm -rf buildroot/package/gnash/
rm -rf buildroot/package/xc3sprog/
rm -rf buildroot/package/sam7-pgm-ng/
+rm -rf buildroot/package/tk/
diff --git a/target/packages/as_devices/python/Makefile b/target/packages/as_devices/python/Makefile
index 7a6a3bd..ced0a44 100644
--- a/target/packages/as_devices/python/Makefile
+++ b/target/packages/as_devices/python/Makefile
@@ -1,31 +1,31 @@
# Default values for local compiling:
-ARMADEUS_BASE_DIR=../../../../
+ARMADEUS_BASE_DIR = ../../../../
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-CFLAGS=-Wall -g -O0
+CFLAGS = -Wall -g -O0
-LDFLAGS=
-CC:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
-CXX:=$(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
-STRIP:=$(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
+LDFLAGS =
+CC = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-gcc
+CXX = $(ARMADEUS_TOOLCHAIN_PATH)/arm-linux-g++
+STRIP = $(ARMADEUS_TOOLCHAIN_PATH)arm-linux-sstrip
-INCLUDE_LIB=../c/
+INCLUDE_LIB = ../c/
-AS_LIB=../c/libas_devices.so
+AS_LIB = ../c/libas_devices.so
-LIBNAME=AsDevices
+LIBNAME = AsDevices
-WRAPPER_LIBS=AsGpio_wrap.so
-WRAPPER_LIBS+= AsAdc_wrap.so
-WRAPPER_LIBS+= AsDac_wrap.so
-WRAPPER_LIBS+= AsI2c_wrap.so
-WRAPPER_LIBS+= AsSpi_wrap.so
-WRAPPER_DIR=src
+WRAPPER_LIBS = AsGpio_wrap.so
+WRAPPER_LIBS += AsAdc_wrap.so
+WRAPPER_LIBS += AsDac_wrap.so
+WRAPPER_LIBS += AsI2c_wrap.so
+WRAPPER_LIBS += AsSpi_wrap.so
+WRAPPER_DIR = src
-PYTHON_VERS=2.7
-PYTHON_SUBVERS=5
-PYINC=$(STAGING_DIR)/usr/include/python$(PYTHON_VERS)/
-PYLIB=$(ARMADEUS_TARGET_DIR)/usr/lib/python$(PYTHON_VERS)
+PYTHON_VERS = 2.7
+PYTHON_SUBVERS = 5
+PYINC = $(STAGING_DIR)/usr/include/python$(PYTHON_VERS)/
+PYLIB = $(ARMADEUS_TARGET_DIR)/usr/lib/python$(PYTHON_VERS)
.PHONY: all
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 15:40:45
|
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 e234251cf5233367e4b7fb8ed0482a324d6c853c (commit)
from f8b6409673043af0f7268f7aeff97e53b2f16d8e (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 e234251cf5233367e4b7fb8ed0482a324d6c853c
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 17:40:35 2014 +0200
[UBOOT] pps51: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/pps51_defconfig | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/buildroot/configs/pps51_defconfig b/buildroot/configs/pps51_defconfig
index 82a3cd1..38d23fe 100644
--- a/buildroot/configs/pps51_defconfig
+++ b/buildroot/configs/pps51_defconfig
@@ -101,10 +101,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="apf51"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(ARMADEUS_PATH)/apf51/apf51-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(ARMADEUS_PATH)/apf51/apf51-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-nand-spl.imx"
BR2_TARGET_UBOOT_NETWORK=y
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 15:38:55
|
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 f8b6409673043af0f7268f7aeff97e53b2f16d8e (commit)
from 52194c5693b3c7470f70ecd21a9d53b4eb4f0dbf (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 f8b6409673043af0f7268f7aeff97e53b2f16d8e
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 17:38:29 2014 +0200
[UBOOT] pps27: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/pps_defconfig | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/buildroot/configs/pps_defconfig b/buildroot/configs/pps_defconfig
index e72a797..ab02021 100644
--- a/buildroot/configs/pps_defconfig
+++ b/buildroot/configs/pps_defconfig
@@ -84,10 +84,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="apf27"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2 "
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 15:36:00
|
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 52194c5693b3c7470f70ecd21a9d53b4eb4f0dbf (commit)
from 84bf3d2bf304a2726f2cdc7f34916f0dcede5631 (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 52194c5693b3c7470f70ecd21a9d53b4eb4f0dbf
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 17:35:31 2014 +0200
[UBOOT] apf28: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf28_defconfig | 6 +++---
buildroot/configs/apf28mainline_defconfig | 6 +++---
buildroot/configs/apf28test_defconfig | 6 +++---
...ot-2014.04.h => apf28mainline-u-boot-2014.04.h} | 4 ++--
4 files changed, 11 insertions(+), 11 deletions(-)
copy buildroot/target/device/armadeus/apf28/{apf28-u-boot-2014.04.h => apf28mainline-u-boot-2014.04.h} (99%)
diff --git a/buildroot/configs/apf28_defconfig b/buildroot/configs/apf28_defconfig
index 02da1dc..27ec9f9 100644
--- a/buildroot/configs/apf28_defconfig
+++ b/buildroot/configs/apf28_defconfig
@@ -81,10 +81,10 @@ BR2_TARGET_ROOTFS_UBI_SUBSIZE=0
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2 "
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_SB=y
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
diff --git a/buildroot/configs/apf28mainline_defconfig b/buildroot/configs/apf28mainline_defconfig
index da8bec8..eed6cc7 100644
--- a/buildroot/configs/apf28mainline_defconfig
+++ b/buildroot/configs/apf28mainline_defconfig
@@ -83,10 +83,10 @@ BR2_TARGET_ROOTFS_UBI_SUBSIZE=0
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2 "
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)mainline-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)mainline-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_SB=y
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
diff --git a/buildroot/configs/apf28test_defconfig b/buildroot/configs/apf28test_defconfig
index 7454f92..dc2bf3d 100644
--- a/buildroot/configs/apf28test_defconfig
+++ b/buildroot/configs/apf28test_defconfig
@@ -146,10 +146,10 @@ BR2_TARGET_ROOTFS_UBI_SUBSIZE=0
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2 "
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_SB=y
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
diff --git a/buildroot/target/device/armadeus/apf28/apf28-u-boot-2014.04.h b/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2014.04.h
similarity index 99%
copy from buildroot/target/device/armadeus/apf28/apf28-u-boot-2014.04.h
copy to buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2014.04.h
index 8b6facf..fa9b4a0 100644
--- a/buildroot/target/device/armadeus/apf28/apf28-u-boot-2014.04.h
+++ b/buildroot/target/device/armadeus/apf28/apf28mainline-u-boot-2014.04.h
@@ -136,7 +136,7 @@
#define CONFIG_KERNEL_OFFSET 0x00500000 /* 8MB */
#define CONFIG_ROOTFS_OFFSET 0x00D00000
-#define CONFIG_MTDMAP "gpmi-nfc-main"
+#define CONFIG_MTDMAP "gpmi-nand"
#define MTDIDS_DEFAULT "nand0=" CONFIG_MTDMAP
#define MTDPARTS_DEFAULT \
"mtdparts=" CONFIG_MTDMAP \
@@ -169,7 +169,7 @@
__stringify(CONFIG_BAUDRATE) " " MTDPARTS_DEFAULT \
" ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs "
-#define ACFG_CONSOLE_DEV ttyAM0
+#define ACFG_CONSOLE_DEV ttyAMA0
#define CONFIG_BOOTCOMMAND "run ubifsboot"
#define CONFIG_SYS_AUTOLOAD "no"
/*
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 14:16:33
|
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 84bf3d2bf304a2726f2cdc7f34916f0dcede5631 (commit)
from b08ccef36d81f0550f51ba425d97b00e272c4f9d (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 84bf3d2bf304a2726f2cdc7f34916f0dcede5631
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 16:15:54 2014 +0200
[UBOOT] apf51: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf51_defconfig | 6 +++---
buildroot/configs/apf51mainline_defconfig | 6 +++---
buildroot/configs/apf51test_defconfig | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/buildroot/configs/apf51_defconfig b/buildroot/configs/apf51_defconfig
index db06d14..ad6a626 100644
--- a/buildroot/configs/apf51_defconfig
+++ b/buildroot/configs/apf51_defconfig
@@ -88,10 +88,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-nand-spl.imx"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf51mainline_defconfig b/buildroot/configs/apf51mainline_defconfig
index ccf45de..e29426e 100644
--- a/buildroot/configs/apf51mainline_defconfig
+++ b/buildroot/configs/apf51mainline_defconfig
@@ -81,10 +81,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-nand-spl.imx"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf51test_defconfig b/buildroot/configs/apf51test_defconfig
index a4741c1..94986ad 100644
--- a/buildroot/configs/apf51test_defconfig
+++ b/buildroot/configs/apf51test_defconfig
@@ -163,10 +163,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-nand-spl.imx"
BR2_TARGET_UBOOT_NETWORK=y
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 14:02:22
|
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 b08ccef36d81f0550f51ba425d97b00e272c4f9d (commit)
from 3728f6e27c585e41cdec91829424d403ff8008d0 (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 b08ccef36d81f0550f51ba425d97b00e272c4f9d
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 16:02:07 2014 +0200
[UBOOT] apf27: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf27_defconfig | 6 +++---
buildroot/configs/apf27_webradio_defconfig | 6 +++---
buildroot/configs/apf27mainline_defconfig | 6 +++---
buildroot/configs/apf27test_defconfig | 6 +++---
buildroot/configs/apf27xenomai_defconfig | 9 +++++----
buildroot/configs/apf27xenomaimainline_defconfig | 6 +++---
6 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/buildroot/configs/apf27_defconfig b/buildroot/configs/apf27_defconfig
index b865f7a..b38430c 100644
--- a/buildroot/configs/apf27_defconfig
+++ b/buildroot/configs/apf27_defconfig
@@ -82,10 +82,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf27_webradio_defconfig b/buildroot/configs/apf27_webradio_defconfig
index e8c0b7f..c095656 100644
--- a/buildroot/configs/apf27_webradio_defconfig
+++ b/buildroot/configs/apf27_webradio_defconfig
@@ -87,10 +87,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf27mainline_defconfig b/buildroot/configs/apf27mainline_defconfig
index b893752..97c0d95 100644
--- a/buildroot/configs/apf27mainline_defconfig
+++ b/buildroot/configs/apf27mainline_defconfig
@@ -85,10 +85,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf27test_defconfig b/buildroot/configs/apf27test_defconfig
index 362aa65..d19b0c9 100644
--- a/buildroot/configs/apf27test_defconfig
+++ b/buildroot/configs/apf27test_defconfig
@@ -159,10 +159,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
diff --git a/buildroot/configs/apf27xenomai_defconfig b/buildroot/configs/apf27xenomai_defconfig
index d108d21..1d9fa90 100644
--- a/buildroot/configs/apf27xenomai_defconfig
+++ b/buildroot/configs/apf27xenomai_defconfig
@@ -83,11 +83,12 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
-BR2_TARGET_UBOOT_FORMAT_NAND_BIN=y
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
BR2_TARGET_UBOOT_IPADDR="192.168.0.10"
diff --git a/buildroot/configs/apf27xenomaimainline_defconfig b/buildroot/configs/apf27xenomaimainline_defconfig
index 4392cfb..cacf619 100644
--- a/buildroot/configs/apf27xenomaimainline_defconfig
+++ b/buildroot/configs/apf27xenomaimainline_defconfig
@@ -87,10 +87,10 @@ BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-with-spl.bin"
BR2_TARGET_UBOOT_NETWORK=y
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 13:28:32
|
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 3728f6e27c585e41cdec91829424d403ff8008d0 (commit)
from 66eaf06a5578596bed1a657768b6e5054fd5b6f8 (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 3728f6e27c585e41cdec91829424d403ff8008d0
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 15:28:06 2014 +0200
[UBOOT] apf9328: bump to U-Boot 2014.04
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf9328_defconfig | 6 +++---
buildroot/configs/apf9328test_defconfig | 6 +++---
buildroot/configs/apf9328xenomai_defconfig | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/buildroot/configs/apf9328_defconfig b/buildroot/configs/apf9328_defconfig
index a1fce98..d40c971 100644
--- a/buildroot/configs/apf9328_defconfig
+++ b/buildroot/configs/apf9328_defconfig
@@ -68,10 +68,10 @@ BR2_TARGET_ROOTFS_JFFS2_PAD=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
BR2_TARGET_UBOOT_IPADDR="192.168.0.10"
diff --git a/buildroot/configs/apf9328test_defconfig b/buildroot/configs/apf9328test_defconfig
index d6cc866..8c6db0c 100644
--- a/buildroot/configs/apf9328test_defconfig
+++ b/buildroot/configs/apf9328test_defconfig
@@ -126,10 +126,10 @@ BR2_TARGET_ROOTFS_JFFS2_PAD=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
BR2_TARGET_UBOOT_IPADDR="192.168.0.10"
diff --git a/buildroot/configs/apf9328xenomai_defconfig b/buildroot/configs/apf9328xenomai_defconfig
index 8ce2a08..5df6d35 100644
--- a/buildroot/configs/apf9328xenomai_defconfig
+++ b/buildroot/configs/apf9328xenomai_defconfig
@@ -72,10 +72,10 @@ BR2_TARGET_ROOTFS_JFFS2_PAD=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="$(BR2_BOARD_NAME)"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2013.04.tar.bz2"
-BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2013.04"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="ftp://ftp.denx.de/pub/u-boot/u-boot-2014.04.tar.bz2"
+BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="../patches/u-boot/2014.04"
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
-BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2013.04.h"
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-u-boot-2014.04.h"
BR2_TARGET_UBOOT_NETWORK=y
BR2_TARGET_UBOOT_SERVERIP="192.168.0.2"
BR2_TARGET_UBOOT_IPADDR="192.168.0.10"
hooks/post-receive
--
armadeus
|
|
From: jorasse <jo...@us...> - 2014-06-16 12:42:21
|
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 66eaf06a5578596bed1a657768b6e5054fd5b6f8 (commit)
from fddab1c0e77239099c8f24c939a3877e4ec34a2f (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 66eaf06a5578596bed1a657768b6e5054fd5b6f8
Author: Eric Jarrige <eri...@ar...>
Date: Mon Jun 16 14:42:05 2014 +0200
[UBOOT] 2014.04: pps27: add board configuration
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/pps/pps-u-boot-2014.04.h | 939 ++++++++++++++++++++
1 files changed, 939 insertions(+), 0 deletions(-)
create mode 100644 buildroot/target/device/armadeus/pps/pps-u-boot-2014.04.h
diff --git a/buildroot/target/device/armadeus/pps/pps-u-boot-2014.04.h b/buildroot/target/device/armadeus/pps/pps-u-boot-2014.04.h
new file mode 100644
index 0000000..8a5d811
--- /dev/null
+++ b/buildroot/target/device/armadeus/pps/pps-u-boot-2014.04.h
@@ -0,0 +1,939 @@
+/*
+ *
+ * Configuration settings for the Armadeus Project motherboard PPS27
+ *
+ * Copyright (C) 2008-2014 Eric Jarrige <eri...@ar...>
+ *
+ * SPDX-License-Identifier:Â Â Â Â Â GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_ENV_VERSION 12
+#define CONFIG_IDENT_STRING " pps patch 3.20"
+#define CONFIG_BOARD_NAME pps
+#define CONFIG_SYS_GENERIC_BOARD
+#define __APF27_H /* force overide apf27.h defines */
+
+/*
+ * SoC configurations
+ */
+#define CONFIG_ARM926EJS /* this is an ARM926EJS CPU */
+#define CONFIG_MX27 /* in a Freescale i.MX27 Chip */
+#define CONFIG_MACH_TYPE 1698 /* APF27 */
+
+/*
+ * Enable the call to miscellaneous platform dependent initialization.
+ */
+#define CONFIG_SYS_NO_FLASH /* to be define before <config_cmd_default.h> */
+
+/*
+ * Board display option
+ */
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_DISPLAY_CPUINFO
+
+/*
+ * SPL
+ */
+/* Copy SPL+U-Boot here */
+#define CONFIG_SPL
+#define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
+#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"
+#define CONFIG_SPL_MAX_SIZE 2048
+#define CONFIG_SPL_TEXT_BASE 0xA0000000
+
+/* NAND boot config */
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x800
+#define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_NAND_U_BOOT_SIZE CONFIG_SYS_MONITOR_LEN - 0x800
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+
+#define CONFIG_HOSTNAME CONFIG_BOARD_NAME
+#define CONFIG_ROOTPATH "/tftpboot/" __stringify(CONFIG_BOARD_NAME) "-root"
+
+/*
+ * U-Boot Commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV /* ask for env variable */
+#define CONFIG_CMD_BSP /* Board Specific functions */
+#define CONFIG_CMD_CACHE /* icache, dcache */
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_DHCP /* DHCP Support */
+#define CONFIG_CMD_DNS
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT /* FAT support */
+#define CONFIG_CMD_IMX_FUSE /* imx iim fuse */
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII /* MII support */
+/*#define CONFIG_CMD_MMC*/
+#define CONFIG_CMD_MTDPARTS /* MTD partition support */
+#define CONFIG_CMD_NAND /* NAND support */
+#define CONFIG_CMD_NAND_LOCK_UNLOCK
+#define CONFIG_CMD_NAND_TRIMFFS
+#define CONFIG_CMD_NFS /* NFS support */
+#define CONFIG_CMD_PING /* ping support */
+#define CONFIG_CMD_SETEXPR /* setexpr support */
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+
+/*
+ * Memory configurations
+ */
+#define CONFIG_NR_DRAM_POPULATED 1
+#define CONFIG_NR_DRAM_BANKS 2
+
+#define ACFG_SDRAM_MBYTE_SYZE 64
+
+#define PHYS_SDRAM_1 0xA0000000
+#define PHYS_SDRAM_2 0xB0000000
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (2 * 1024 * 1024))
+#define CONFIG_SYS_MEMTEST_START 0xA0000000 /* memtest test area */
+#define CONFIG_SYS_MEMTEST_END 0xA0300000 /* 3 MiB RAM test */
+
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE \
+ + PHYS_SDRAM_1_SIZE - 0x0100000)
+
+#define CONFIG_SYS_TEXT_BASE 0xA0000800
+
+/*
+ * FLASH organization
+ */
+#define ACFG_MONITOR_OFFSET 0x00000000
+#define CONFIG_SYS_MONITOR_LEN 0x00100000 /* 1MiB */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_ENV_OFFSET 0x00100000 /* NAND offset */
+#define CONFIG_ENV_SIZE 0x00020000 /* 128kB */
+#define CONFIG_ENV_RANGE 0X00080000 /* 512kB */
+#define CONFIG_ENV_OFFSET_REDUND \
+ (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) /* +512kB */
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE /* 512kB */
+#define CONFIG_FIRMWARE_OFFSET 0x00200000
+#define CONFIG_FIRMWARE_SIZE 0x00080000 /* 512kB */
+#define CONFIG_KERNEL_OFFSET 0x00300000
+#define CONFIG_ROOTFS_OFFSET 0x00800000
+
+#define CONFIG_MTDMAP "mxc_nand.0"
+#define MTDIDS_DEFAULT "nand0=" CONFIG_MTDMAP
+#define MTDPARTS_DEFAULT "mtdparts=" CONFIG_MTDMAP \
+ ":1M(u-boot)ro," \
+ "512K(env)," \
+ "512K(env2)," \
+ "512K(firmware)," \
+ "512K(dtb)," \
+ "5M(kernel)," \
+ "-(rootfs)"
+
+/*
+ * U-Boot general configurations
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_PROMPT "BIOS> " /* prompt string */
+#define CONFIG_SYS_CBSIZE 2048 /* console I/O buffer */
+#define CONFIG_SYS_PBSIZE \
+ (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
+ /* Print buffer size */
+#define CONFIG_SYS_MAXARGS 16 /* max command args */
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
+ /* Boot argument buffer size */
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_SYS_HUSH_PARSER /* enable the "hush" shell */
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " /* secondary prompt string */
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_PREBOOT "run check_flash checknload_firmware " \
+ "check_env ;"
+
+
+/*
+ * Boot Linux
+ */
+#define CONFIG_CMDLINE_TAG /* send commandline to Kernel */
+#define CONFIG_SETUP_MEMORY_TAGS /* send memory definition to kernel */
+#define CONFIG_INITRD_TAG /* send initrd params */
+
+#define CONFIG_OF_LIBFDT
+
+#define CONFIG_BOOTDELAY 1
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_BOOTFILE __stringify(CONFIG_BOARD_NAME) "-linux.bin"
+#define CONFIG_BOOTARGS "console=" __stringify(ACFG_CONSOLE_DEV) "," \
+ __stringify(CONFIG_BAUDRATE) " " MTDPARTS_DEFAULT \
+ " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs "
+
+#define ACFG_CONSOLE_DEV ttySMX0
+#define CONFIG_BOOTCOMMAND "run ubifsboot"
+#define CONFIG_SYS_AUTOLOAD "no"
+/*
+ * Default load address for user programs and kernel
+ */
+#define CONFIG_LOADADDR 0xA0000000
+#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+
+/*
+ * Extra Environments
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "env_version=" __stringify(CONFIG_ENV_VERSION) "\0" \
+ "consoledev=" __stringify(ACFG_CONSOLE_DEV) "\0" \
+ "mtdparts=" MTDPARTS_DEFAULT "\0" \
+ "partition=nand0,6\0" \
+ "u-boot_addr=" __stringify(ACFG_MONITOR_OFFSET) "\0" \
+ "env_addr=" __stringify(CONFIG_ENV_OFFSET) "\0" \
+ "firmware_addr=" __stringify(CONFIG_FIRMWARE_OFFSET) "\0" \
+ "firmware_size=" __stringify(CONFIG_FIRMWARE_SIZE) "\0" \
+ "kernel_addr=" __stringify(CONFIG_KERNEL_OFFSET) "\0" \
+ "rootfs_addr=" __stringify(CONFIG_ROOTFS_OFFSET) "\0" \
+ "board_name=" __stringify(CONFIG_BOARD_NAME) "\0" \
+ "kernel_addr_r=A0000000\0" \
+ "extrabootargs=otg_mode=device\0" \
+ "check_env=if test -n ${flash_env_version}; " \
+ "then env default env_version; " \
+ "else env set flash_env_version ${env_version}; env save; "\
+ "fi; " \
+ "if itest ${flash_env_version} < ${env_version}; then " \
+ "echo \"*** Warning - Environment version" \
+ " change suggests: run flash_reset_env; reset\"; "\
+ "env default flash_reset_env; " \
+ "else exit; fi; \0" \
+ "check_flash=nand lock; nand unlock ${env_addr}; \0" \
+ "flash_reset_env=env default -f -a && saveenv &&" \
+ "echo Flash environment variables erased!\0" \
+ "download_uboot=tftpboot ${loadaddr} ${board_name}" \
+ "-u-boot-with-spl.bin\0" \
+ "flash_uboot=nand unlock ${u-boot_addr} ;" \
+ "nand erase.part u-boot;" \
+ "if nand write.trimffs ${fileaddr} ${u-boot_addr} ${filesize};"\
+ "then nand lock; nand unlock ${env_addr};" \
+ "echo Flashing of uboot succeed;" \
+ "else echo Flashing of uboot failed;" \
+ "fi; \0" \
+ "update_uboot=run download_uboot flash_uboot\0" \
+ "download_env=tftpboot ${loadaddr} ${board_name}" \
+ "-u-boot-env.txt\0" \
+ "flash_env=env import -t ${loadaddr} && env save; \0" \
+ "update_env=run download_env flash_env\0" \
+ "download_firmware=tftpboot ${loadaddr} ${board_name}-firmware.bin\0"\
+ "flash_firmware=nand erase.part firmware;" \
+ "if nand write.trimffs ${fileaddr} ${firmware_addr} " \
+ "${filesize};" \
+ "then echo Flashing of Firmware succeed;" \
+ "else echo Flashing of Firmware failed;" \
+ "fi\0" \
+ "update_firmware=run download_firmware flash_firmware\0" \
+ "load_firmware=nand read ${loadaddr} firmware && " \
+ "fpga loadb 0 ${loadaddr} ${firmware_size} || " \
+ "fpga load 0 ${loadaddr} ${firmware_size}; " \
+ "if test $? -eq 0; " \
+ "then echo Firmware successfully loaded;" \
+ "else echo Loading firmware failed!;" \
+ "fi;\0" \
+ "checknload_firmware=if test -n ${firmware_autoload};" \
+ "then run load_firmware; else exit; fi;\0"\
+ "download_dtb=tftpboot ${loadaddr} ${board_name}.dtb\0" \
+ "flash_dtb=nand erase.part dtb;" \
+ "if nand write.trimffs ${fileaddr} dtb ${filesize};" \
+ "then echo Flashing dtb succeed;" \
+ "else echo Flashing dtb failed;" \
+ "fi;\0" \
+ "update_dtb=run download_dtb flash_dtb\0" \
+ "download_kernel=tftpboot ${loadaddr} ${board_name}-linux.bin\0"\
+ "flash_kernel=nand erase.part kernel;" \
+ "if nand write.trimffs ${fileaddr} ${kernel_addr} " \
+ "${filesize};" \
+ "then echo Flashing of kernel succeed;" \
+ "else echo Flashing of kernel failed;" \
+ "fi\0" \
+ "update_kernel=run download_kernel flash_kernel\0" \
+ "download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ubi\0"\
+ "flash_rootfs=nand erase.part rootfs;" \
+ "if nand write.trimffs ${fileaddr} ${rootfs_addr} " \
+ "${filesize};" \
+ "then echo Flashing of rootfs succeed;" \
+ "else echo Flashing of rootfs failed;" \
+ "fi\0" \
+ "update_rootfs=run download_rootfs flash_rootfs\0" \
+ "update_all=run update_kernel update_rootfs update_uboot &&" \
+ "if test -n ${fdt_addr_r};" \
+ "then run update_dtb; else exit; fi &&" \
+ "if test -n ${firmware_autoload};" \
+ "then run update_firmware; else exit; fi;\0" \
+ "addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:"\
+ "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
+ "addmmcargs=setenv bootargs ${bootargs} root=/dev/mmcblk0p1 " \
+ "rootfstype=ext2\0" \
+ "mmcboot=setenv bootargs console=${consoledev},${baudrate} " \
+ "${mtdparts} ${extrabootargs}; run addmmcargs addipargs;"\
+ "mmc dev 0 &&" \
+ "if test -n ${fdt_addr_r} ;" \
+ "then ext2load mmc 0 ${fdt_addr_r} " \
+ "/boot/${board_name}.dtb;" \
+ "else echo no fdt_addr_r;" \
+ "fi &&" \
+ "ext2load mmc 0 ${kernel_addr_r} " \
+ "/boot/${board_name}-linux.bin &&" \
+ "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
+ "addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw " \
+ "nfsroot=${serverip}:${rootpath}\0" \
+ "nfsboot=setenv bootargs console=${consoledev},${baudrate} " \
+ "${mtdparts} ${extrabootargs}; run addnfsargs addipargs;"\
+ "nfs ${kernel_addr_r} ${serverip}:${rootpath}/boot/" \
+ "${board_name}-linux.bin &&" \
+ "if test -n ${fdt_addr_r};" \
+ "then nfs ${fdt_addr_r} ${serverip}:${rootpath}/boot/" \
+ "${board_name}.dtb;" \
+ "else echo no fdt_addr_r;" \
+ "fi &&" \
+ "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
+ "addubifsargs=setenv bootargs ${bootargs} ubi.mtd=rootfs " \
+ "root=ubi0:rootfs rootfstype=ubifs\0" \
+ "ubifsboot=setenv bootargs console=${consoledev},${baudrate} " \
+ "${mtdparts} ${extrabootargs};run addubifsargs addipargs;"\
+ "if test -n ${fdt_addr_r};" \
+ "then nand read ${fdt_addr_r} dtb;" \
+ "else echo no fdt_addr_r;" \
+ "fi &&" \
+ "nboot ${kernel_addr_r} kernel;bootm ${kernel_addr_r} - "\
+ "${fdt_addr_r}\0" \
+ "unlock_regs=mw 10000008 0; mw 10020008 0\0" \
+
+/*
+ * Serial Driver
+ */
+#define CONFIG_MXC_UART
+#define CONFIG_CONS_INDEX 1
+#define CONFIG_BAUDRATE 115200
+#define CONFIG_MXC_UART_BASE UART1_BASE
+
+/*
+ * GPIO
+ */
+#define CONFIG_MXC_GPIO
+
+/*
+ * NOR
+ */
+
+/*
+ * NAND
+ */
+#define CONFIG_NAND_MXC
+
+#define CONFIG_MXC_NAND_REGS_BASE 0xD8000000
+#define CONFIG_SYS_NAND_BASE CONFIG_MXC_NAND_REGS_BASE
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+
+#define CONFIG_MXC_NAND_HWECC
+#define CONFIG_SYS_NAND_LARGEPAGE
+#define CONFIG_SYS_NAND_USE_FLASH_BBT
+#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
+#define CONFIG_SYS_NAND_PAGE_SIZE 2048
+#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
+#define CONFIG_SYS_NAND_PAGE_COUNT CONFIG_SYS_NAND_BLOCK_SIZE / \
+ CONFIG_SYS_NAND_PAGE_SIZE
+#define CONFIG_SYS_NAND_SIZE (256 * 1024 * 1024)
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS 11
+#define NAND_MAX_CHIPS 1
+
+
+#define CONFIG_SYS_DIRECT_FLASH_TFTP
+#define CONFIG_FLASH_SHOW_PROGRESS 45
+#define CONFIG_SYS_NAND_QUIET 1
+
+/*
+ * Partitions & Filsystems
+ */
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_DOS_PARTITION
+#define CONFIG_SUPPORT_VFAT
+
+/*
+ * UBIFS
+ */
+#define CONFIG_RBTREE
+#define CONFIG_LZO
+
+/*
+ * Ethernet (on SOC imx FEC)
+ */
+#define CONFIG_FEC_MXC
+/*#define CONFIG_PHYLIB
+#define CONFIG_PHY_SMSC*/
+#define CONFIG_FEC_MXC_PHYADDR 0x1f
+#define CONFIG_MII /* MII PHY management */
+
+/*
+ * FPGA
+ */
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_FPGA
+#endif
+#define CONFIG_FPGA_COUNT 1
+#define CONFIG_FPGA_XILINX
+#define CONFIG_FPGA_SPARTAN3
+#define CONFIG_SYS_FPGA_WAIT 250 /* 250 ms */
+#define CONFIG_SYS_FPGA_PROG_FEEDBACK
+#define CONFIG_SYS_FPGA_CHECK_CTRLC
+#define CONFIG_SYS_FPGA_CHECK_ERROR
+
+/* FPGA program pin configuration */
+#define ACFG_FPGA_PWR (GPIO_PORTF | 19) /* FPGA prog pin */
+#define ACFG_FPGA_PRG (GPIO_PORTF | 11) /* FPGA prog pin */
+#define ACFG_FPGA_CLK (GPIO_PORTF | 15) /* FPGA clk pin */
+#define ACFG_FPGA_RDATA 0xD6000000 /* FPGA data addr */
+#define ACFG_FPGA_WDATA 0xD6000000 /* FPGA data addr */
+#define ACFG_FPGA_INIT (GPIO_PORTF | 12) /* FPGA init pin */
+#define ACFG_FPGA_DONE (GPIO_PORTF | 9) /* FPGA done pin */
+#define ACFG_FPGA_RW (GPIO_PORTF | 21) /* FPGA done pin */
+#define ACFG_FPGA_CS (GPIO_PORTF | 22) /* FPGA done pin */
+#define ACFG_FPGA_SUSPEND (GPIO_PORTF | 10) /* FPGA done pin */
+#define ACFG_FPGA_RESET (GPIO_PORTF | 7) /* FPGA done pin */
+
+/*
+ * Fuses - IIM
+ */
+#ifdef CONFIG_CMD_IMX_FUSE
+#define IIM_MAC_BANK 0
+#define IIM_MAC_ROW 5
+#define IIM0_SCC_KEY 11
+#define IIM1_SUID 1
+#endif
+
+/*
+ * I2C
+ */
+
+#ifdef CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_MXC_I2C1_SPEED 100000 /* 100 kHz */
+#define CONFIG_SYS_MXC_I2C1_SLAVE 0x7F
+#define CONFIG_SYS_MXC_I2C2_SPEED 100000 /* 100 kHz */
+#define CONFIG_SYS_MXC_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_I2C_NOPROBES { }
+
+#ifdef CONFIG_CMD_EEPROM
+# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM 24LC02 */
+# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* bytes of address */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* msec */
+#endif /* CONFIG_CMD_EEPROM */
+#endif /* CONFIG_CMD_I2C */
+
+/*
+ * SD/MMC
+ */
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MXC_MMC
+#define CONFIG_MXC_MCI_REGS_BASE 0x10014000
+#define PC_PWRON (GPIO_PORTF | 16)
+#endif
+
+/*
+ * RTC
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_DS1374
+#define CONFIG_SYS_RTC_BUS_NUM 0
+#endif /* CONFIG_CMD_DATE */
+
+/*
+ * PLL
+ *
+ * 31 | x |x| x x x x |x x x x x x x x x x |x x|x x x x|x x x x x x x x x x| 0
+ * |CPLM|X|----PD---|--------MFD---------|XXX|--MFI--|-----MFN-----------|
+ */
+#define CONFIG_MX27_CLK32 32768 /* 32768 or 32000 Hz crystal */
+
+/*
+ * MPU CLOCK source before PLL
+ * ACFG_CLK_FREQ (2/3 MPLL clock or ext 266 MHZ)
+ */
+#define ACFG_MPCTL0_VAL 0x01EF15D5 /* 399.000 MHz */
+#define ACFG_MPCTL1_VAL 0
+#define CONFIG_MPLL_FREQ 399
+
+#define ACFG_CLK_FREQ (CONFIG_MPLL_FREQ*2/3) /* 266 MHz */
+
+/* Serial clock source before PLL (should be named ACFG_SYSPLL_CLK_FREQ)*/
+#define ACFG_SPCTL0_VAL 0x0475206F /* 299.99937 MHz */
+#define ACFG_SPCTL1_VAL 0
+#define CONFIG_SPLL_FREQ 300 /* MHz */
+
+/* ARM bus frequency (have to be a CONFIG_MPLL_FREQ ratio) */
+#define CONFIG_ARM_FREQ 399 /* up to 400 MHz */
+
+/* external bus frequency (have to be a ACFG_CLK_FREQ ratio) */
+#define CONFIG_HCLK_FREQ 133 /* (ACFG_CLK_FREQ/2) */
+
+#define CONFIG_PERIF1_FREQ 16 /* 16.625 MHz UART, GPT, PWM */
+#define CONFIG_PERIF2_FREQ 33 /* 33.25 MHz CSPI and SDHC */
+#define CONFIG_PERIF3_FREQ 33 /* 33.25 MHz LCD */
+#define CONFIG_PERIF4_FREQ 33 /* 33.25 MHz CSI */
+#define CONFIG_SSI1_FREQ 66 /* 66.50 MHz SSI1 */
+#define CONFIG_SSI2_FREQ 66 /* 66.50 MHz SSI2 */
+#define CONFIG_MSHC_FREQ 66 /* 66.50 MHz MSHC */
+#define CONFIG_H264_FREQ 66 /* 66.50 MHz H264 */
+#define CONFIG_CLK0_DIV 3 /* Divide CLK0 by 4 */
+#define CONFIG_CLK0_EN 1 /* CLK0 enabled */
+
+/* external bus frequency (have to be a CONFIG_HCLK_FREQ ratio) */
+#define CONFIG_NFC_FREQ 44 /* NFC Clock up to 44 MHz wh 133MHz */
+
+/* external serial bus frequency (have to be a CONFIG_SPLL_FREQ ratio) */
+#define CONFIG_USB_FREQ 60 /* 60 MHz */
+
+/*
+ * SDRAM
+ */
+#if (ACFG_SDRAM_MBYTE_SYZE == 64) /* micron MT46H16M32LF -6 */
+/* micron 64MB */
+#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
+#define PHYS_SDRAM_2_SIZE 0x04000000 /* 64 MB */
+#define ACFG_SDRAM_NUM_COL 9 /* 8, 9, 10 or 11
+ * column address bits
+ */
+#define ACFG_SDRAM_NUM_ROW 13 /* 11, 12 or 13
+ * row address bits
+ */
+#define ACFG_SDRAM_REFRESH 3 /* 0=OFF 1=2048
+ * 2=4096 3=8192 refresh
+ */
+#define ACFG_SDRAM_EXIT_PWD 25 /* ns exit power
+ * down delay
+ */
+#define ACFG_SDRAM_W2R_DELAY 1 /* write to read
+ * cycle delay > 0
+ */
+#define ACFG_SDRAM_ROW_PRECHARGE_DELAY 18 /* ns */
+#define ACFG_SDRAM_TMRD_DELAY 2 /* Load mode register
+ * cycle delay 1..4
+ */
+#define ACFG_SDRAM_TWR_DELAY 1 /* LPDDR: 0=2ck 1=3ck
+ * SDRAM: 0=1ck 1=2ck
+ */
+#define ACFG_SDRAM_RAS_DELAY 42 /* ns ACTIVE-to-PRECHARGE delay */
+#define ACFG_SDRAM_RRD_DELAY 12 /* ns ACTIVE-to-ACTIVE delay */
+#define ACFG_SDRAM_RCD_DELAY 18 /* ns Row to Column delay */
+#define ACFG_SDRAM_RC_DELAY 70 /* ns Row cycle delay (tRFC
+ * refresh to command)
+ */
+#define ACFG_SDRAM_CLOCK_CYCLE_CL_1 0 /* ns clock cycle time
+ * estimated fo CL=1
+ * 0=force 3 for lpddr
+ */
+#define ACFG_SDRAM_PARTIAL_ARRAY_SR 0 /* 0=full 1=half 2=quater
+ * 3=Eighth 4=Sixteenth
+ */
+#define ACFG_SDRAM_DRIVE_STRENGH 0 /* 0=Full-strength 1=half
+ * 2=quater 3=Eighth
+ */
+#define ACFG_SDRAM_BURST_LENGTH 3 /* 2^N BYTES (N=0..3) */
+#define ACFG_SDRAM_SINGLE_ACCESS 0 /* 1= single access
+ * 0 = Burst mode
+ */
+#endif
+
+#if (ACFG_SDRAM_MBYTE_SYZE == 128)
+/* micron 128MB */
+#define PHYS_SDRAM_1_SIZE 0x08000000 /* 128 MB */
+#define PHYS_SDRAM_2_SIZE 0x08000000 /* 128 MB */
+#define ACFG_SDRAM_NUM_COL 9 /* 8, 9, 10 or 11
+ * column address bits
+ */
+#define ACFG_SDRAM_NUM_ROW 14 /* 11, 12 or 13
+ * row address bits
+ */
+#define ACFG_SDRAM_REFRESH 3 /* 0=OFF 1=2048
+ * 2=4096 3=8192 refresh
+ */
+#define ACFG_SDRAM_EXIT_PWD 25 /* ns exit power
+ * down delay
+ */
+#define ACFG_SDRAM_W2R_DELAY 1 /* write to read
+ * cycle delay > 0
+ */
+#define ACFG_SDRAM_ROW_PRECHARGE_DELAY 18 /* ns */
+#define ACFG_SDRAM_TMRD_DELAY 2 /* Load mode register
+ * cycle delay 1..4
+ */
+#define ACFG_SDRAM_TWR_DELAY 1 /* LPDDR: 0=2ck 1=3ck
+ * SDRAM: 0=1ck 1=2ck
+ */
+#define ACFG_SDRAM_RAS_DELAY 42 /* ns ACTIVE-to-PRECHARGE delay */
+#define ACFG_SDRAM_RRD_DELAY 12 /* ns ACTIVE-to-ACTIVE delay */
+#define ACFG_SDRAM_RCD_DELAY 18 /* ns Row to Column delay */
+#define ACFG_SDRAM_RC_DELAY 70 /* ns Row cycle delay (tRFC
+ * refresh to command)
+ */
+#define ACFG_SDRAM_CLOCK_CYCLE_CL_1 0 /* ns clock cycle time
+ * estimated fo CL=1
+ * 0=force 3 for lpddr
+ */
+#define ACFG_SDRAM_PARTIAL_ARRAY_SR 0 /* 0=full 1=half 2=quater
+ * 3=Eighth 4=Sixteenth
+ */
+#define ACFG_SDRAM_DRIVE_STRENGH 0 /* 0=Full-strength 1=half
+ * 2=quater 3=Eighth
+ */
+#define ACFG_SDRAM_BURST_LENGTH 3 /* 2^N BYTES (N=0..3) */
+#define ACFG_SDRAM_SINGLE_ACCESS 0 /* 1= single access
+ * 0 = Burst mode
+ */
+#endif
+
+#if (ACFG_SDRAM_MBYTE_SYZE == 256)
+/* micron 256MB */
+#define PHYS_SDRAM_1_SIZE 0x10000000 /* 256 MB */
+#define PHYS_SDRAM_2_SIZE 0x10000000 /* 256 MB */
+#define ACFG_SDRAM_NUM_COL 10 /* 8, 9, 10 or 11
+ * column address bits
+ */
+#define ACFG_SDRAM_NUM_ROW 14 /* 11, 12 or 13
+ * row address bits
+ */
+#define ACFG_SDRAM_REFRESH 3 /* 0=OFF 1=2048
+ * 2=4096 3=8192 refresh
+ */
+#define ACFG_SDRAM_EXIT_PWD 25 /* ns exit power
+ * down delay
+ */
+#define ACFG_SDRAM_W2R_DELAY 1 /* write to read cycle
+ * delay > 0
+ */
+#define ACFG_SDRAM_ROW_PRECHARGE_DELAY 18 /* ns */
+#define ACFG_SDRAM_TMRD_DELAY 2 /* Load mode register
+ * cycle delay 1..4
+ */
+#define ACFG_SDRAM_TWR_DELAY 1 /* LPDDR: 0=2ck 1=3ck
+ * SDRAM: 0=1ck 1=2ck
+ */
+#define ACFG_SDRAM_RAS_DELAY 42 /* ns ACTIVE-to-PRECHARGE delay */
+#define ACFG_SDRAM_RRD_DELAY 12 /* ns ACTIVE-to-ACTIVE delay */
+#define ACFG_SDRAM_RCD_DELAY 18 /* ns Row to Column delay */
+#define ACFG_SDRAM_RC_DELAY 70 /* ns Row cycle delay (tRFC
+ * refresh to command)
+ */
+#define ACFG_SDRAM_CLOCK_CYCLE_CL_1 0 /* ns clock cycle time
+ * estimated fo CL=1
+ * 0=force 3 for lpddr
+ */
+#define ACFG_SDRAM_PARTIAL_ARRAY_SR 0 /* 0=full 1=half 2=quater
+ * 3=Eighth 4=Sixteenth
+ */
+#define ACFG_SDRAM_DRIVE_STRENGH 0 /* 0=Full-strength
+ * 1=half
+ * 2=quater
+ * 3=Eighth
+ */
+#define ACFG_SDRAM_BURST_LENGTH 3 /* 2^N BYTES (N=0..3) */
+#define ACFG_SDRAM_SINGLE_ACCESS 0 /* 1= single access
+ * 0 = Burst mode
+ */
+#endif
+
+/*
+ * External interface
+ */
+/*
+ * CSCRxU_VAL:
+ * 31| x | x | x x |x x x x| x x | x | x |x x x x|16
+ * |SP |WP | BCD | BCS | PSZ |PME|SYNC| DOL |
+ *
+ * 15| x x | x x x x x x | x | x x x x | x x x x |0
+ * | CNC | WSC |EW | WWS | EDC |
+ *
+ * CSCRxL_VAL:
+ * 31| x x x x | x x x x | x x x x | x x x x |16
+ * | OEA | OEN | EBWA | EBWN |
+ * 15|x x x x| x |x x x |x x x x| x | x | x | x | 0
+ * | CSA |EBC| DSZ | CSN |PSR|CRE|WRAP|CSEN|
+ *
+ * CSCRxA_VAL:
+ * 31| x x x x | x x x x | x x x x | x x x x |16
+ * | EBRA | EBRN | RWA | RWN |
+ * 15| x | x x |x x x|x x|x x|x x| x | x | x | x | 0
+ * |MUM| LAH | LBN |LBA|DWW|DCT|WWU|AGE|CNC2|FCE|
+ */
+
+/* CS0 configuration for 16 bit nor flash */
+#define ACFG_CS0U_VAL 0x0000CC03
+#define ACFG_CS0L_VAL 0xa0330D01
+#define ACFG_CS0A_VAL 0x00220800
+
+#define ACFG_CS1U_VAL 0x00000f00
+#define ACFG_CS1L_VAL 0x00000D01
+#define ACFG_CS1A_VAL 0
+
+#define ACFG_CS2U_VAL 0
+#define ACFG_CS2L_VAL 0
+#define ACFG_CS2A_VAL 0
+
+#define ACFG_CS3U_VAL 0
+#define ACFG_CS3L_VAL 0
+#define ACFG_CS3A_VAL 0
+
+#define ACFG_CS4U_VAL 0
+#define ACFG_CS4L_VAL 0
+#define ACFG_CS4A_VAL 0
+
+/* FPGA 16 bit data bus */
+#define ACFG_CS5U_VAL 0x00000600
+#define ACFG_CS5L_VAL 0x00000D01
+#define ACFG_CS5A_VAL 0
+
+#define ACFG_EIM_VAL 0x00002200
+
+
+/*
+ * FPGA specific settings
+ */
+
+/* CLKO */
+#define ACFG_CCSR_VAL 0x00000305
+/* drive strength CLKO set to 2 */
+#define ACFG_DSCR10_VAL 0x00020000
+/* drive strength A1..A12 set to 2 */
+#define ACFG_DSCR3_VAL 0x02AAAAA8
+/* drive strength ctrl */
+#define ACFG_DSCR7_VAL 0x00020880
+/* drive strength data */
+#define ACFG_DSCR2_VAL 0xAAAAAAAA
+
+
+/*
+ * Default configuration for GPIOs and peripherals
+ */
+#define ACFG_DDIR_A_VAL 0x00000000
+#define ACFG_OCR1_A_VAL 0x00000000
+#define ACFG_OCR2_A_VAL 0x00000000
+#define ACFG_ICFA1_A_VAL 0xFFFFFFFF
+#define ACFG_ICFA2_A_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_A_VAL 0xFFFFFFFF
+#define ACFG_ICFB2_A_VAL 0xFFFFFFFF
+#define ACFG_DR_A_VAL 0x00000000
+#define ACFG_GIUS_A_VAL 0xFFFFFFFF
+#define ACFG_ICR1_A_VAL 0x00000000
+#define ACFG_ICR2_A_VAL 0x00000000
+#define ACFG_IMR_A_VAL 0x00000000
+#define ACFG_GPR_A_VAL 0x00000000
+#define ACFG_PUEN_A_VAL 0xFFFFFFFF
+
+#define ACFG_DDIR_B_VAL 0x000001F0
+#define ACFG_OCR1_B_VAL 0x0003ff00
+#define ACFG_OCR2_B_VAL 0x00000000
+#define ACFG_ICFA1_B_VAL 0xFFFC00FF
+#define ACFG_ICFA2_B_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_B_VAL 0xFFFC00FF
+#define ACFG_ICFB2_B_VAL 0xFFFFFFFF
+#define ACFG_DR_B_VAL 0x000001F0
+#define ACFG_GIUS_B_VAL 0xFF3FFFF0
+#define ACFG_ICR1_B_VAL 0x00000000
+#define ACFG_ICR2_B_VAL 0x00000000
+#define ACFG_IMR_B_VAL 0x00000000
+#define ACFG_GPR_B_VAL 0x00000000
+#define ACFG_PUEN_B_VAL 0xFFFFFE0F
+
+#define ACFG_DDIR_C_VAL 0x00000000
+#define ACFG_OCR1_C_VAL 0x00000000
+#define ACFG_OCR2_C_VAL 0x00000000
+#define ACFG_ICFA1_C_VAL 0xFFFFFFFF
+#define ACFG_ICFA2_C_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_C_VAL 0xFFFFFFFF
+#define ACFG_ICFB2_C_VAL 0xFFFFFFFF
+#define ACFG_DR_C_VAL 0x00000000
+#define ACFG_GIUS_C_VAL 0xFFFFC07F
+#define ACFG_ICR1_C_VAL 0x00000000
+#define ACFG_ICR2_C_VAL 0x00000000
+#define ACFG_IMR_C_VAL 0x00000000
+#define ACFG_GPR_C_VAL 0x00000000
+#define ACFG_PUEN_C_VAL 0xFFFFFF87
+
+#define ACFG_DDIR_D_VAL 0x00000000
+#define ACFG_OCR1_D_VAL 0x00000000
+#define ACFG_OCR2_D_VAL 0x00000000
+#define ACFG_ICFA1_D_VAL 0xFFFFFFFF
+#define ACFG_ICFA2_D_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_D_VAL 0xFFFFFFFF
+#define ACFG_ICFB2_D_VAL 0xFFFFFFFF
+#define ACFG_DR_D_VAL 0x00000000
+#define ACFG_GIUS_D_VAL 0xFFFFFFFF
+#define ACFG_ICR1_D_VAL 0x00000000
+#define ACFG_ICR2_D_VAL 0x00000000
+#define ACFG_IMR_D_VAL 0x00000000
+#define ACFG_GPR_D_VAL 0x00000000
+#define ACFG_PUEN_D_VAL 0xFFFFFFFF
+
+#define ACFG_DDIR_E_VAL 0x00000000
+#define ACFG_OCR1_E_VAL 0x00000000
+#define ACFG_OCR2_E_VAL 0x00000000
+#define ACFG_ICFA1_E_VAL 0xFFFFFFFF
+#define ACFG_ICFA2_E_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_E_VAL 0xFFFFFFFF
+#define ACFG_ICFB2_E_VAL 0xFFFFFFFF
+#define ACFG_DR_E_VAL 0x00000000
+#define ACFG_GIUS_E_VAL 0xFCFFCCF8
+#define ACFG_ICR1_E_VAL 0x00000000
+#define ACFG_ICR2_E_VAL 0x00000000
+#define ACFG_IMR_E_VAL 0x00000000
+#define ACFG_GPR_E_VAL 0x00000000
+#define ACFG_PUEN_E_VAL 0xFFFFFFFF
+
+#define ACFG_DDIR_F_VAL 0x00000000
+#define ACFG_OCR1_F_VAL 0x00000000
+#define ACFG_OCR2_F_VAL 0x00000000
+#define ACFG_ICFA1_F_VAL 0xFFFFFFFF
+#define ACFG_ICFA2_F_VAL 0xFFFFFFFF
+#define ACFG_ICFB1_F_VAL 0xFFFFFFFF
+#define ACFG_ICFB2_F_VAL 0xFFFFFFFF
+#define ACFG_DR_F_VAL 0x00000000
+#define ACFG_GIUS_F_VAL 0xFF7F8000
+#define ACFG_ICR1_F_VAL 0x00000000
+#define ACFG_ICR2_F_VAL 0x00000000
+#define ACFG_IMR_F_VAL 0x00000000
+#define ACFG_GPR_F_VAL 0x00000000
+#define ACFG_PUEN_F_VAL 0xFFFFFFFF
+
+/* Enforce DDR signal strengh & enable USB/PP/DMA burst override bits */
+#define ACFG_GPCR_VAL 0x0003000F
+
+#define ACFG_ESDMISC_VAL ESDMISC_LHD+ESDMISC_MDDREN
+
+/* FMCR select num LPDDR RAMs and nand 16bits, 2KB pages */
+#if (CONFIG_NR_DRAM_BANKS == 1)
+#define ACFG_FMCR_VAL 0xFFFFFFF9
+#elif (CONFIG_NR_DRAM_BANKS == 2)
+#define ACFG_FMCR_VAL 0xFFFFFFFB
+#endif
+
+#define ACFG_AIPI1_PSR0_VAL 0x20040304
+#define ACFG_AIPI1_PSR1_VAL 0xDFFBFCFB
+#define ACFG_AIPI2_PSR0_VAL 0x00000000
+#define ACFG_AIPI2_PSR1_VAL 0xFFFFFFFF
+
+/* PCCR enable DMA FEC I2C1 IIM SDHC1 */
+#define ACFG_PCCR0_VAL 0x05070410
+#define ACFG_PCCR1_VAL 0xA14A0608
+
+/*
+ * From here, there should not be any user configuration.
+ * All Equations are automatic
+ */
+
+/* fixme none integer value (7.5ns) => 2*hclock = 15ns */
+#define ACFG_2XHCLK_LGTH (2000/CONFIG_HCLK_FREQ) /* ns */
+
+/* USB 60 MHz ; ARM up to 400; HClK up to 133MHz*/
+#define CSCR_MASK 0x0300800D
+
+#define ACFG_CSCR_VAL \
+ (CSCR_MASK \
+ |((((CONFIG_SPLL_FREQ/CONFIG_USB_FREQ)-1)&0x07) << 28) \
+ |((((CONFIG_MPLL_FREQ/CONFIG_ARM_FREQ)-1)&0x03) << 12) \
+ |((((ACFG_CLK_FREQ/CONFIG_HCLK_FREQ)-1)&0x03) << 8))
+
+/* SSIx CLKO NFC H264 MSHC */
+#define ACFG_PCDR0_VAL\
+ (((((ACFG_CLK_FREQ/CONFIG_MSHC_FREQ)-1)&0x3F)<<0) \
+ |((((CONFIG_HCLK_FREQ/CONFIG_NFC_FREQ)-1)&0x0F)<<6) \
+ |(((((ACFG_CLK_FREQ/CONFIG_H264_FREQ)-2)*2)&0x3F)<<10)\
+ |(((((ACFG_CLK_FREQ/CONFIG_SSI1_FREQ)-2)*2)&0x3F)<<16)\
+ |(((CONFIG_CLK0_DIV)&0x07)<<22)\
+ |(((CONFIG_CLK0_EN)&0x01)<<25)\
+ |(((((ACFG_CLK_FREQ/CONFIG_SSI2_FREQ)-2)*2)&0x3F)<<26))
+
+/* PERCLKx */
+#define ACFG_PCDR1_VAL\
+ (((((ACFG_CLK_FREQ/CONFIG_PERIF1_FREQ)-1)&0x3F)<<0) \
+ |((((ACFG_CLK_FREQ/CONFIG_PERIF2_FREQ)-1)&0x3F)<<8) \
+ |((((ACFG_CLK_FREQ/CONFIG_PERIF3_FREQ)-1)&0x3F)<<16) \
+ |((((ACFG_CLK_FREQ/CONFIG_PERIF4_FREQ)-1)&0x3F)<<24))
+
+/* SDRAM controller programming Values */
+#if (((2*ACFG_SDRAM_CLOCK_CYCLE_CL_1) > (3*ACFG_2XHCLK_LGTH)) || \
+ (ACFG_SDRAM_CLOCK_CYCLE_CL_1 < 1))
+#define REG_FIELD_SCL_VAL 3
+#define REG_FIELD_SCLIMX_VAL 0
+#else
+#define REG_FIELD_SCL_VAL\
+ ((2*ACFG_SDRAM_CLOCK_CYCLE_CL_1+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)
+#define REG_FIELD_SCLIMX_VAL REG_FIELD_SCL_VAL
+#endif
+
+#if ((2*ACFG_SDRAM_RC_DELAY) > (16*ACFG_2XHCLK_LGTH))
+#define REG_FIELD_SRC_VAL 0
+#else
+#define REG_FIELD_SRC_VAL\
+ ((2*ACFG_SDRAM_RC_DELAY+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)
+#endif
+
+/* TBD Power down timer ; PRCT Bit Field Encoding; burst length 8 ; FP = 0*/
+#define REG_ESDCTL_BASE_CONFIG (0x80020485\
+ | (((ACFG_SDRAM_NUM_ROW-11)&0x7)<<24)\
+ | (((ACFG_SDRAM_NUM_COL-8)&0x3)<<20)\
+ | (((ACFG_SDRAM_REFRESH)&0x7)<<13))
+
+#define ACFG_NORMAL_RW_CMD ((0x0<<28)+REG_ESDCTL_BASE_CONFIG)
+#define ACFG_PRECHARGE_CMD ((0x1<<28)+REG_ESDCTL_BASE_CONFIG)
+#define ACFG_AUTOREFRESH_CMD ((0x2<<28)+REG_ESDCTL_BASE_CONFIG)
+#define ACFG_SET_MODE_REG_CMD ((0x3<<28)+REG_ESDCTL_BASE_CONFIG)
+
+/* ESDRAMC Configuration Registers : force CL=3 to lpddr */
+#define ACFG_SDRAM_ESDCFG_REGISTER_VAL (0x0\
+ | (((((2*ACFG_SDRAM_EXIT_PWD+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)-1)&0x3)<<21)\
+ | (((ACFG_SDRAM_W2R_DELAY-1)&0x1)<<20)\
+ | (((((2*ACFG_SDRAM_ROW_PRECHARGE_DELAY+ \
+ ACFG_2XHCLK_LGTH-1)/ACFG_2XHCLK_LGTH)-1)&0x3)<<18) \
+ | (((ACFG_SDRAM_TMRD_DELAY-1)&0x3)<<16)\
+ | (((ACFG_SDRAM_TWR_DELAY)&0x1)<<15)\
+ | (((((2*ACFG_SDRAM_RAS_DELAY+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)-1)&0x7)<<12) \
+ | (((((2*ACFG_SDRAM_RRD_DELAY+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)-1)&0x3)<<10) \
+ | (((REG_FIELD_SCLIMX_VAL)&0x3)<<8)\
+ | (((((2*ACFG_SDRAM_RCD_DELAY+ACFG_2XHCLK_LGTH-1)/ \
+ ACFG_2XHCLK_LGTH)-1)&0x7)<<4) \
+ | (((REG_FIELD_SRC_VAL)&0x0F)<<0))
+
+/* Issue Mode register Command to SDRAM */
+#define ACFG_SDRAM_MODE_REGISTER_VAL\
+ ((((ACFG_SDRAM_BURST_LENGTH)&0x7)<<(0))\
+ | (((REG_FIELD_SCL_VAL)&0x7)<<(4))\
+ | ((0)<<(3)) /* sequentiql access */ \
+ /*| (((ACFG_SDRAM_SINGLE_ACCESS)&0x1)<<(1))*/)
+
+/* Issue Extended Mode register Command to SDRAM */
+#define ACFG_SDRAM_EXT_MODE_REGISTER_VAL\
+ ((ACFG_SDRAM_PARTIAL_ARRAY_SR<<0)\
+ | (ACFG_SDRAM_DRIVE_STRENGH<<(5))\
+ | (1<<(ACFG_SDRAM_NUM_COL+ACFG_SDRAM_NUM_ROW+1+2)))
+
+/* Issue Precharge all Command to SDRAM */
+#define ACFG_SDRAM_PRECHARGE_ALL_VAL (1<<10)
+
+#endif /* __CONFIG_H */
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-13 16:22:51
|
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 fddab1c0e77239099c8f24c939a3877e4ec34a2f (commit)
via 092679aba3e4372a35f161265ba896767a4b8132 (commit)
from 05a35cba698c2c7a7d04ceb01217465b10eaf480 (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 fddab1c0e77239099c8f24c939a3877e4ec34a2f
Author: Julien Boibessot <jul...@ar...>
Date: Fri Jun 13 18:22:28 2014 +0200
[DEBUG] fpgaregs: cleanup (code & BR package)
commit 092679aba3e4372a35f161265ba896767a4b8132
Author: Julien Boibessot <jul...@ar...>
Date: Fri Jun 13 18:18:05 2014 +0200
[DEBUG] fpgaregs: cleanup
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/fpgaregs/fpgaregs.mk | 48 ++++--------
target/linux/debug/fpgaregs/fpgaregs.c | 92 +++++++++++------------
2 files changed, 58 insertions(+), 82 deletions(-)
diff --git a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
index 80696d5..faeb44b 100644
--- a/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
+++ b/buildroot/package/armadeus/fpgaregs/fpgaregs.mk
@@ -4,46 +4,28 @@
#
#############################################################
-FPGAREGS_VER:=1.1
-FPGAREGS_SOURCE:=$(TOPDIR)/../target/linux/debug/fpgaregs/
-FPGAREGS_DIR:=$(BUILD_DIR)/fpgaregs-$(FPGAREGS_VER)
-FPGAREGS_CAT:=zcat
+FPGAREGS_VERSION = 2014.06
+FPGAREGS_SITE = $(TOPDIR)/../target/linux/debug/fpgaregs/
+FPGAREGS_SITE_METHOD = local
+FPGAREGS_LICENSE = GPLv2+
+
ifeq ($(BR2_CPU_NAME),"imx27")
-FPGAREGS_BINARY:=fpga27regs
+FPGAREGS_BINARY = fpga27regs
else
ifeq ($(BR2_CPU_NAME),"imx51")
- FPGAREGS_BINARY:=fpga51regs
+ FPGAREGS_BINARY = fpga51regs
else
- FPGAREGS_BINARY:=fpgaregs
+ FPGAREGS_BINARY = fpgaregs
endif
endif
FPGAREGS_TARGET_BINARY:=usr/bin/fpgaregs
-$(FPGAREGS_DIR)/fpgaregs.c:
- mkdir -p $(FPGAREGS_DIR)/
- cp $(FPGAREGS_SOURCE)/* $(FPGAREGS_DIR)/
-
-$(FPGAREGS_DIR)/$(FPGAREGS_BINARY): $(FPGAREGS_DIR)/fpgaregs.c
- $(TARGET_CONFIGURE_OPTS) $(MAKE) CC="$(TARGET_CC)" -C $(FPGAREGS_DIR)
-
-$(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY): $(FPGAREGS_DIR)/$(FPGAREGS_BINARY)
- install -D $< $@
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
-
-fpgaregs: $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
-
-fpgaregs-clean:
- rm -f $(TARGET_DIR)/$(FPGAREGS_TARGET_BINARY)
- -$(MAKE) -C $(FPGAREGS_DIR) clean
+define FPGAREGS_BUILD_CMDS
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) CC="$(TARGET_CC)" -C $(@D)
+endef
-fpgaregs-dirclean:
- rm -rf $(FPGAREGS_DIR)
+define FPGAREGS_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 644 $(@D)/$(FPGAREGS_BINARY) $(TARGET_DIR)/usr/bin/fpgaregs
+endef
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(strip $(BR2_PACKAGE_FPGAREGS)),y)
-TARGETS+=fpgaregs
-endif
+$(eval $(generic-package))
diff --git a/target/linux/debug/fpgaregs/fpgaregs.c b/target/linux/debug/fpgaregs/fpgaregs.c
index d8ac89c..b0abb4d 100644
--- a/target/linux/debug/fpgaregs/fpgaregs.c
+++ b/target/linux/debug/fpgaregs/fpgaregs.c
@@ -1,9 +1,10 @@
/************************************************************************
*
* fpgaregs.c
- * a program to write/read 16/32 bits values on FPGA address map using mmap()
+ * A program to write/read 16/32 bits values to/from APF's FPGA address map
+ * using mmap().
*
- * (c) Copyright 2008-2011 The Armadeus Project - ARMadeus Systems
+ * (c) Copyright 2008-2014 The Armadeus Project - ARMadeus Systems
* Fabien Marteau <fab...@ar...>
* Modified by Sebastien Van Cauwenberghe <sv...@gm...>
*
@@ -24,20 +25,17 @@
#include <stdio.h>
#include <stdlib.h>
-#include <sys/stat.h> /* file management */
-#include <fcntl.h>
-#include <signal.h>
-#include <unistd.h> /* sleep, write(), read() */
-#include <string.h> /* converting string */
-#include <sys/mman.h> /* memory management */
+#include <fcntl.h> /* open() */
+#include <unistd.h> /* close() */
+#include <sys/mman.h> /* mmap() */
#ifdef IMX27
# define PLATFORM "APF27"
-# define FPGA_ADDRESS 0xD6000000
+# define FPGA_ADDRESS 0xd6000000
# define FPGA_MAP_SIZE 0x2000
#elif IMX51
# define PLATFORM "APF51"
-# define FPGA_ADDRESS 0xB8000000
+# define FPGA_ADDRESS 0xb8000000
# define FPGA_MAP_SIZE 0x10000
#else
# define PLATFORM "APF9328"
@@ -48,8 +46,7 @@
#define WORD_ACCESS (2)
#define LONG_ACCESS (4)
-
-void displayResult(const char* text, unsigned int accesstype, unsigned int value, unsigned int address)
+void display_result(const char* text, unsigned int accesstype, unsigned int value, unsigned int address)
{
if (accesstype == WORD_ACCESS)
printf("%s 0x%04x at 0x%08x\n", text, (unsigned short)value, address);
@@ -57,7 +54,6 @@ void displayResult(const char* text, unsigned int accesstype, unsigned int value
printf("%s 0x%08x at 0x%08x\n", text, value, address);
}
-
int main(int argc, char *argv[])
{
unsigned short address;
@@ -67,12 +63,14 @@ int main(int argc, char *argv[])
if ((argc < 3) || (argc > 4)) {
printf("invalid arguments number\n");
- printf("fpgaregs for %s platform\n\n", PLATFORM);
- printf("Usage: fpgaregs [w,l] address [value]\n\n");
- printf("Reads or writes a value at given FPGA's relative address.\n\n");
- printf("Options:\n");
+ printf("fpgaregs v2014.06 for %s platform\n\n", PLATFORM);
+ printf("Usage: fpgaregs w/l address [value]\n\n");
+ printf("Reads/writes a value from/to a given FPGA's relative address.\n\n");
+ printf("Arguments:\n");
printf(" w word (16 bits) access\n");
printf(" l long (32 bits) access\n");
+ printf(" address FPGA relative address to read from/write to\n");
+ printf("Options:\n");
printf(" value value to write\n\n");
printf("Examples:\n");
printf(" fpgaregs w 0x10 --> read @ 0x10\n");
@@ -95,42 +93,38 @@ int main(int argc, char *argv[])
address = (unsigned int)strtol(argv[2], (char **)NULL, 16);
- if (argc < 3) {
- printf("invalid command line");
+ if (*(argv[1]) == 'w')
+ accesstype = WORD_ACCESS;
+ if (accesstype == WORD_ACCESS) {
+ if (address%2 != 0) {
+ printf("Can't do word access at odd address (%d). Please use a 16bits aligned one.\n", address);
+ return -1;
+ }
} else {
- if (*(argv[1]) == 'w')
- accesstype = WORD_ACCESS;
- if (accesstype == WORD_ACCESS) {
- if (address%2 != 0) {
- printf("Can't do word access at odd address (%d). Use a 16bits aligned one.\n", address);
- return -1;
- }
- } else { /* LONG_ACCESS */
- if (address%4 != 0) {
- printf("Can't do long access at non-32bits-aligned address (%d)\n", address);
- return -1;
- }
+ /* LONG_ACCESS */
+ if (address%4 != 0) {
+ printf("Can't do long access at non-32bits-aligned address (%d)\n", address);
+ return -1;
}
+ }
- /* write value at given address */
- if (argc == 4) {
- value = strtoul(argv[3], (char **)NULL, 16);
- if (accesstype == WORD_ACCESS)
- *((unsigned short*)(ptr_fpga + address)) = (unsigned short)value;
- else
- *((unsigned int*)(ptr_fpga + address)) = (unsigned int)value;
-
- displayResult("Write", accesstype, value, address);
- /* read at given address */
- } else if (argc == 3) {
- if (accesstype == WORD_ACCESS)
- value = *((unsigned short*)(ptr_fpga + address));
- else
- value = *((unsigned int*)(ptr_fpga + address));
-
- displayResult("Read", accesstype, value, address);
- }
+ if (argc == 4) { /* write value to given address */
+ value = strtoul(argv[3], (char **)NULL, 16);
+ if (accesstype == WORD_ACCESS)
+ *((unsigned short*)(ptr_fpga + address)) = (unsigned short)value;
+ else
+ *((unsigned int*)(ptr_fpga + address)) = (unsigned int)value;
+
+ display_result("Write", accesstype, value, address);
+ } else if (argc == 3) { /* read at given address */
+ if (accesstype == WORD_ACCESS)
+ value = *((unsigned short*)(ptr_fpga + address));
+ else
+ value = *((unsigned int*)(ptr_fpga + address));
+
+ display_result("Read", accesstype, value, address);
}
+
munmap(ptr_fpga, FPGA_MAP_SIZE);
close(ffpga);
return 0;
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2014-06-13 16:10:13
|
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 05a35cba698c2c7a7d04ceb01217465b10eaf480 (commit)
from 30d0a009be4caa37ac33b25d368d30aafbff2ecf (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 05a35cba698c2c7a7d04ceb01217465b10eaf480
Author: Julien Boibessot <jul...@ar...>
Date: Fri Jun 13 18:09:19 2014 +0200
[DEBUG] fpgaregs: fixes bug introduced by previous commit (g++ warning removal)
-----------------------------------------------------------------------
Summary of changes:
target/linux/debug/fpgaregs/fpgaregs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/linux/debug/fpgaregs/fpgaregs.c b/target/linux/debug/fpgaregs/fpgaregs.c
index 9b72918..d8ac89c 100644
--- a/target/linux/debug/fpgaregs/fpgaregs.c
+++ b/target/linux/debug/fpgaregs/fpgaregs.c
@@ -116,17 +116,17 @@ int main(int argc, char *argv[])
if (argc == 4) {
value = strtoul(argv[3], (char **)NULL, 16);
if (accesstype == WORD_ACCESS)
- *((unsigned short*)ptr_fpga + address) = (unsigned short)value;
+ *((unsigned short*)(ptr_fpga + address)) = (unsigned short)value;
else
- *((unsigned int*)ptr_fpga + address) = (unsigned int)value;
+ *((unsigned int*)(ptr_fpga + address)) = (unsigned int)value;
displayResult("Write", accesstype, value, address);
/* read at given address */
} else if (argc == 3) {
if (accesstype == WORD_ACCESS)
- value = *((unsigned short*)ptr_fpga + address);
+ value = *((unsigned short*)(ptr_fpga + address));
else
- value = *((unsigned int*)ptr_fpga + address);
+ value = *((unsigned int*)(ptr_fpga + address));
displayResult("Read", accesstype, value, address);
}
hooks/post-receive
--
armadeus
|
|
From: Sébastien S. <ss...@us...> - 2014-06-11 08:22:03
|
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 30d0a009be4caa37ac33b25d368d30aafbff2ecf (commit)
via 1d045049055b294d39379472f6ec74f2e933caeb (commit)
from 96af776e04caa35cbd327233364a94d43c8037f5 (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 30d0a009be4caa37ac33b25d368d30aafbff2ecf
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Jun 11 10:17:19 2014 +0200
[LINUX] 3.15: move to 3.15
commit 1d045049055b294d39379472f6ec74f2e933caeb
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Jun 11 10:07:47 2014 +0200
[LINUX] 3.15: apf6: dts: fix gsm muxing and add gpios node
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf6_defconfig | 2 +-
.../armadeus/apf27/apf27-linux-3.15-rc8.config | 1 -
.../armadeus/apf28/apf28-linux-3.15-rc8.config | 1 -
.../armadeus/apf51/apf51-linux-3.15-rc8.config | 1 -
patches/linux/3.15-rc8 | 1 -
...rmadeus-add-apf6q-and-apf6dl-device-trees.patch | 62 +++++++++++---------
6 files changed, 35 insertions(+), 33 deletions(-)
delete mode 120000 buildroot/target/device/armadeus/apf27/apf27-linux-3.15-rc8.config
delete mode 120000 buildroot/target/device/armadeus/apf28/apf28-linux-3.15-rc8.config
delete mode 120000 buildroot/target/device/armadeus/apf51/apf51-linux-3.15-rc8.config
delete mode 120000 patches/linux/3.15-rc8
diff --git a/buildroot/configs/apf6_defconfig b/buildroot/configs/apf6_defconfig
index a1e3d67..9919cbe 100644
--- a/buildroot/configs/apf6_defconfig
+++ b/buildroot/configs/apf6_defconfig
@@ -22,7 +22,7 @@ BR2_TARGET_ARMADEUS_NR_SDRAM="2"
BR2_TARGET_ARMADEUS_SDRAM_SIZE="512"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.15-rc8"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.15"
BR2_LINUX_KERNEL_PATCH="../patches/linux/$(BR2_LINUX_KERNEL_VERSION)"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-linux-$(BR2_LINUX_KERNEL_VERSION).config"
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-3.15-rc8.config b/buildroot/target/device/armadeus/apf27/apf27-linux-3.15-rc8.config
deleted file mode 120000
index badcea0..0000000
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-3.15-rc8.config
+++ /dev/null
@@ -1 +0,0 @@
-apf27-linux-3.15.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.15-rc8.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.15-rc8.config
deleted file mode 120000
index 3ba4223..0000000
--- a/buildroot/target/device/armadeus/apf28/apf28-linux-3.15-rc8.config
+++ /dev/null
@@ -1 +0,0 @@
-apf28-linux-3.15.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-3.15-rc8.config b/buildroot/target/device/armadeus/apf51/apf51-linux-3.15-rc8.config
deleted file mode 120000
index 4865fee..0000000
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-3.15-rc8.config
+++ /dev/null
@@ -1 +0,0 @@
-apf51-linux-3.15.config
\ No newline at end of file
diff --git a/patches/linux/3.15-rc8 b/patches/linux/3.15-rc8
deleted file mode 120000
index 230693c..0000000
--- a/patches/linux/3.15-rc8
+++ /dev/null
@@ -1 +0,0 @@
-3.15
\ No newline at end of file
diff --git a/patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch b/patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
index fdf1e6b..e6f4a52 100644
--- a/patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
+++ b/patches/linux/3.15/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
@@ -1,7 +1,7 @@
-Index: linux-3.15-rc5/arch/arm/boot/dts/imx6q-apf6dev.dts
+Index: linux-3.15-rc8/arch/arm/boot/dts/imx6q-apf6dev.dts
===================================================================
--- /dev/null
-+++ linux-3.15-rc5/arch/arm/boot/dts/imx6q-apf6dev.dts
++++ linux-3.15-rc8/arch/arm/boot/dts/imx6q-apf6dev.dts
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014 Armadeus Systems
@@ -31,10 +31,10 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6q-apf6dev.dts
+&sata {
+ status = "okay";
+};
-Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6.dtsi
+Index: linux-3.15-rc8/arch/arm/boot/dts/imx6qdl-apf6.dtsi
===================================================================
--- /dev/null
-+++ linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6.dtsi
++++ linux-3.15-rc8/arch/arm/boot/dts/imx6qdl-apf6.dtsi
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2014 Armadeus Systems
@@ -167,11 +167,11 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6.dtsi
+ };
+ };
+};
-Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+Index: linux-3.15-rc8/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
===================================================================
--- /dev/null
-+++ linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
-@@ -0,0 +1,445 @@
++++ linux-3.15-rc8/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+@@ -0,0 +1,451 @@
+/*
+ * Copyright 2014 Armadeus Systems
+ *
@@ -396,7 +396,8 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+/* GSM */
+&uart3 {
+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_uart3>;
++ pinctrl-0 = <&pinctrl_uart3 &pinctrl_gsm>;
++ fsl,uart-has-rtscts;
+ status = "okay";
+};
+
@@ -444,24 +445,7 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+
+&iomuxc {
+ pinctrl-names = "default";
-+ pinctrl-0 = <&pinctrl_hog>;
-+
-+ hog {
-+ pinctrl_hog: hoggrp {
-+ fsl,pins = <
-+ MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x80000000
-+ MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13 0x80000000
-+ MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14 0x80000000
-+ MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x80000000
-+ MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16 0x80000000
-+ MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17 0x80000000
-+ MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18 0x80000000
-+ MX6QDL_PAD_CSI0_MCLK__GPIO5_IO19 0x80000000
-+ MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x80000000
-+ MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21 0x80000000
-+ >;
-+ };
-+ };
++ pinctrl-0 = <&pinctrl_gpios>;
+
+ apf6dev {
+ pinctrl_audmux: audmuxgrp {
@@ -503,6 +487,28 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+ >;
+ };
+
++ pinctrl_gpios: gpiosgrp {
++ fsl,pins = <
++ MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x80000000
++ MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13 0x80000000
++ MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14 0x80000000
++ MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x80000000
++ MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16 0x80000000
++ MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17 0x80000000
++ MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18 0x80000000
++ MX6QDL_PAD_CSI0_MCLK__GPIO5_IO19 0x80000000
++ MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x80000000
++ MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21 0x80000000
++ >;
++ };
++
++ pinctrl_gsm: gsmgrp {
++ fsl,pins = <
++ MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 /* GSM_POKIN */
++ MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x80000000 /* GSM_PWR_EN */
++ >;
++ };
++
+ pinctrl_i2c1: i2c1grp {
+ fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
@@ -617,10 +623,10 @@ Index: linux-3.15-rc5/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+ };
+ };
+};
-Index: linux-3.15-rc5/arch/arm/boot/dts/imx6dl-apf6dev.dts
+Index: linux-3.15-rc8/arch/arm/boot/dts/imx6dl-apf6dev.dts
===================================================================
--- /dev/null
-+++ linux-3.15-rc5/arch/arm/boot/dts/imx6dl-apf6dev.dts
++++ linux-3.15-rc8/arch/arm/boot/dts/imx6dl-apf6dev.dts
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2014 Armadeus Systems
hooks/post-receive
--
armadeus
|