Srinivas Kandagatla
b2e8af641b
i2c.c: make use of no_bus_mux flag
...
This patch makes use of no_bus_mux flag in mraa_board_t to skip
unnessary mux checks.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-12-14 10:59:54 +00:00
Mihai Tudor Panu
efc79d13c0
i2c.c: Fix identation/style and simplify logic in mraa_i2c_read
...
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-12-01 12:01:25 +00:00
Mihai Tudor Panu
e8cb060f4e
i2c.c: call correct adv func in mraa_i2c_read_byte
...
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-12-01 12:01:16 +00:00
Henry Bruce
df8492a8f7
i2c.c: Added missing adv_func support to some functions
...
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-10-26 15:46:54 +00:00
Henry Bruce
1a29dc9910
i2c.c: Added check for NULL i2c context
...
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-17 11:34:35 +01:00
Brendan Le Foll
07343e2ee7
mraa: Remove global advance_func struct and place it in platform configuration
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:04 +01:00
Henry Bruce
4031124081
api: Renamed some sub-platform API calls.
...
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:04 +01:00
Henry Bruce
b20a685b0c
i2c: mraa_i2c_init_raw fixed and sub-platform updates.
...
mraa_i2c_init_raw now works again without platfrorm defined.
More API calls now support sub-platform
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:04 +01:00
Henry Bruce
11bf69e29a
i2c.c: Refactored init calls to use mraa_i2c_init_internal()
...
mraa_i2c_init_internal() implenents logic of mraa_i2c_init_raw()
allowing mraa_adv_func_t to be passed in as a parameter
instead of of being global.
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:03 +01:00
Henry Bruce
4a6bf832bc
usb: Converted sub-platform bus/pin helper macros to functions.
...
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:03 +01:00
Henry Bruce
8f48df0533
usb: Skeleton platform code for FTDI FT4222 USB to i2c bridge
...
Signed-off-by: Henry Bruce <henry.bruce@intel.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-09-08 14:42:03 +01:00
Brendan Le Foll
3f51ebaaf1
i2c.c: add debug syslog message for i2c bus path
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-08-14 11:18:24 +01:00
Brendan Le Foll
ffcf3d7d07
clang-format: run clang-format on C/C++ code
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-03-23 15:15:48 +00:00
Brendan Le Foll
228b7b672d
i2c: flip the msg flags for mraa_i2c_read_bytes_data
...
Fixes 168.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-03-13 16:02:04 +00:00
Gabriel Smith
caf1383325
i2c: Add functions for bulk read from register
...
Functions issue a write command for the register to read from and then a read
command without a stop signal in between
Signed-off-by: Gabriel Smith <ga29smith@gmail.com >
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-03-03 16:26:57 +00:00
Brendan Le Foll
e3dba949b6
i2c.c: Fix resource leak when I2C_FUNCS ioctl fails
...
This isn't a true failure condition just assume we have no features and carry
on
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-20 17:15:13 +00:00
Brendan Le Foll
3eb0a8dbf7
i2c: use I2C_FUNCS to store funcs map
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:49:48 +00:00
Brendan Le Foll
a65a906e9e
i2c: fix brackets around if statement
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:38:50 +00:00
Brendan Le Foll
cc9a4f59b5
edison: add mraa_i2c_frequency replace hook for i2c-6
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:38:50 +00:00
Brendan Le Foll
ab3af9cc2d
i2c: add busnum to context
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:38:49 +00:00
Brendan Le Foll
836d953cb7
i2c: remove hz from context
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:38:48 +00:00
Brendan Le Foll
fc5d37d391
i2c: set_frequency now takes a mraa_i2c_mode_t
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2015-01-05 14:38:48 +00:00
Brendan Le Foll
276b0a8920
i2c.c: fix typo in mraa_i2c_read_word_data
...
Fixes #45
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-11-26 07:52:40 +00:00
Brendan Le Foll
19d7dad364
i2c: remove smbus helper library & clean up command use in API
...
This commit changes the mraa_i2c_read() API call behaviour, a register should
now always be set when using this call. The smbus helper library is no longer
required since the code is now all contained from i2c.c which avoids multiple
function calls
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-11-20 12:03:31 +00:00
Brendan Le Foll
ac1c60d4fe
i2c: add clean {write, read}data functions
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-11-20 12:03:31 +00:00
Thomas Ingleby
ffd38bb68c
i2c: move i2c setup from core into module
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-11-17 17:40:48 +00:00
Brendan Le Foll
274d5b2d50
i2c: use uint8_t when appropriate and remove char
...
Object APIs used signed chars for some operations which are not appropriate
when using i2c.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-11-05 11:25:38 +00:00
Anton Krasovsky
cbf4c7447f
i2c: add api call to read byte from a specified register
...
Signed-off-by: Anton Krasovsky <anton@no-mad.net >
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-10-31 01:17:17 +00:00
Brendan Le Foll
535d92ab79
i2c: use default i2c bus in board config if invalid
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-10-23 18:05:07 +01:00
Brendan Le Foll
a6b3d384b2
syslog: unify error msg style
...
syslog messages should be written as <module>: Message in order to increase
readability and usefulness
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-10-22 21:09:11 +01:00
Brendan Le Foll
d49f20b7ba
i2c: mraa_i2c_frequency now returns correct returns
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-10-20 10:01:53 +01:00
Brendan Le Foll
2b5e38b40c
coverity: Fix issues found by coverity scan
...
* Fix a few resource leaks in error conditions
* Makes strtol() calls safer in pwm module
* Make sure buffer is terminated after read() in aio
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-10-03 22:50:18 +01:00
Brendan Le Foll
32d8a6f0ca
syslog: remove all fprintf calls and use syslog instead
...
Syslog is now used for all error messages, return values in the code should be
used by programmers to see the status of the library/board and syslog can be
used to see quickly from a debugging perspective what has gone wrong. A few
cosmetics where improved as well as a mraa_set_log_level() call where the
syslog log mask can be set directly from libmraa.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-09-25 14:31:04 +01:00
Thomas Ingleby
57d58b66ca
i2c: add init(pre-post) hooks
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-07-14 18:19:07 +01:00
Thomas Ingleby
00f188c235
i2c: internal structure to mraa_internal_types
...
* For use in hooks
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-07-14 17:52:08 +01:00
Thomas Ingleby
dc7dde857b
i2c: add Brendan's email to header
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-07-14 17:49:31 +01:00
Brendan Le Foll
c0b8360698
i2c.c: add newlines at the end of all error msgs
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-07-11 14:47:52 +01:00
Thomas Ingleby
6853997a92
mraa: rename from maa to mraa
...
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-06-24 17:24:54 +01:00
Brendan Le Foll
ab071e64de
i2c: make maa_i2c_read always return the length of the read
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-06-11 10:49:23 +01:00
Brendan Le Foll
d847ae7847
i2c: use uint8_t throughout to make code clearer
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-05-23 14:21:53 +01:00
Thomas Ingleby
2b8ab38418
maa: hide and rename internal maa functions
...
Based on feedback received. All check functions renamed to setup.
Update all modules to use new name and header.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-05-21 13:17:16 +01:00
Brendan Le Foll
adcefeaba1
i2c: fix write API to use const char*
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-05-19 10:34:36 +01:00
Brendan Le Foll
e491f99228
i2c.hpp: Add C++ wrapper around I2c
...
* maa_i2c_context bcomes an opaque pointer
* C++ wrapper class I2c created
* swig now uses C++ wrapper I2c to generate API
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-05-16 14:31:33 +01:00
Brendan Le Foll
19415ff2e4
i2c: fixed impossible unsigned comparisons
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-05-13 22:17:42 +00:00
Thomas Ingleby
64d3c78ca9
i2c: Work started on using pinmap with i2c
...
* Update examples and swig interface.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com >
2014-05-02 16:07:18 +01:00
Brendan Le Foll
35c98aed6d
api: Change api licensing as it now has nothing to do with mbed
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-04-30 14:50:01 +01:00
Brendan Le Foll
e86916ab91
i2c: add doxygen documentation and make return types use maa_result_t
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-04-30 11:35:29 +01:00
Brendan Le Foll
6ad98d23e7
i2c.c: fix return type in _init function
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-04-29 14:01:30 +01:00
Brendan Le Foll
f280b3c0f6
maa: change struct names to be more unique and fix allocs
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-04-28 11:31:53 +01:00
Brendan Le Foll
1ba2d6040c
i2c: clarify our usage of the result of the assignment
...
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com >
2014-04-27 23:15:54 +01:00