From 77ee9ffff55e647f78127d2b8c04278a775ea998 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Mon, 28 Apr 2014 18:39:07 +0100 Subject: [PATCH] doc: initial documentation of api Signed-off-by: Brendan Le Foll --- Doxyfile.in | 4 ++-- README => README.md | 5 +++++ api/gpio.h | 6 ++++++ api/i2c.h | 17 ++++++++++++++++- api/maa.h | 6 ++++++ api/pwm.h | 6 ++++++ 6 files changed, 41 insertions(+), 3 deletions(-) rename README => README.md (95%) diff --git a/Doxyfile.in b/Doxyfile.in index 3d340cb..5237e8b 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/api/ +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/api/ @CMAKE_CURRENT_SOURCE_DIR@/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -930,7 +930,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing diff --git a/README b/README.md similarity index 95% rename from README rename to README.md index 724cc38..a0b7abf 100644 --- a/README +++ b/README.md @@ -1,4 +1,5 @@ MAA - Low Level Skeleton Library for Communication on Intel platforms +============== Library in C/C++ to interface with Galileo & other Intel platforms over: @@ -16,6 +17,7 @@ their sensors & actuators on top of supported hardware and to allow control of low level communication protocol by high level languages & constructs. === ENV RECOMENDATIONS === +-------------- node.js 0.10.26 python 3.3.x or 2.7.x @@ -24,6 +26,7 @@ I'm using f31c1dce7a45c4b8ed7e6ff845f4c74539e056f1 from http://github.com:oliver----/swig-v8 === COMPILING === +-------------- NOTE: The only supported cmake build configuration is to have the build/ dir inside of the repo/tarball. @@ -39,11 +42,13 @@ Install is currently unsuported. Javascript and python modules will be in build/src/{javascript, python} === DEVELOPMENT === +-------------- Unit tests for all features must be completed prior to implementations, please run `ctest -V` from the build dir in order to see current implementation status === USING === +-------------- see examples/ diff --git a/api/gpio.h b/api/gpio.h index 190b60c..5475126 100644 --- a/api/gpio.h +++ b/api/gpio.h @@ -18,6 +18,12 @@ #pragma once +/** @file + * + * This file defines the gpio interface for libmaa + * + */ + #include #include "maa.h" diff --git a/api/i2c.h b/api/i2c.h index a4332af..e0c46cc 100644 --- a/api/i2c.h +++ b/api/i2c.h @@ -18,6 +18,12 @@ #pragma once +/** @file + * + * This file defines the i2c interface for libmaa + * + */ + #include #include #include @@ -36,12 +42,14 @@ maa_i2c_context* maa_i2c_init(); /** Set the frequency of the I2C interface * + * @param dev the i2c context * @param hz The bus frequency in hertz */ void maa_i2c_frequency(maa_i2c_context* dev, int hz); /** Checks to see if this I2C Slave has been addressed. * + * @param dev the i2c context * @returns * A status indicating if the device has been addressed, and how * - NoData - the slave has not been addressed @@ -53,6 +61,7 @@ int maa_i2c_receive(maa_i2c_context* dev); /** Read from an I2C master. * + * @param dev the i2c context * @param data pointer to the byte array to read data in to * @param length maximum number of bytes to read * @@ -64,13 +73,15 @@ int maa_i2c_read(maa_i2c_context* dev, char *data, int length); /** Read a single byte from an I2C master. * + * @param dev the i2c context * @returns * the byte read */ int maa_i2c_read_byte(maa_i2c_context* dev); -/** Write to an I2C master. +/** Write to an I2C master * + * @param dev the i2c context * @param data pointer to the byte array to be transmitted * @param length the number of bytes to transmite * @@ -82,6 +93,7 @@ int maa_i2c_write(maa_i2c_context* dev, const char *data, int length); /** Write a single byte to an I2C master. * + * @param dev the i2c context * @data the byte to write * * @returns @@ -92,6 +104,7 @@ int maa_i2c_write_byte(maa_i2c_context* dev, int data); /** Sets the I2C slave address. * + * @param dev the i2c context * @param address The address to set for the slave (ignoring the least * signifcant bit). If set to 0, the slave will only respond to the * general call address. @@ -99,5 +112,7 @@ int maa_i2c_write_byte(maa_i2c_context* dev, int data); void maa_i2c_address(maa_i2c_context* dev, int address); /** De-inits an maa_i2c_context device + * + * @param dev the i2c context */ void maa_i2c_stop(maa_i2c_context* dev); diff --git a/api/maa.h b/api/maa.h index ad4ee47..4bf0989 100644 --- a/api/maa.h +++ b/api/maa.h @@ -24,6 +24,12 @@ #pragma once +/** @file + * + * This file defines the basic shared values for libmaa + * + */ + typedef enum { MAA_SUCCESS = 0, MAA_ERROR_FEATURE_NOT_IMPLEMENTED = 1, diff --git a/api/pwm.h b/api/pwm.h index 2dbdf51..0c66f1e 100644 --- a/api/pwm.h +++ b/api/pwm.h @@ -18,6 +18,12 @@ #pragma once +/** @file + * + * This file defines the pwm interface for libmaa + * + */ + #include #include