Private
Public Access
2
0

api: add proper doxygen comments to C++ headers and normalise doc

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-30 17:10:52 +01:00
parent fac705768d
commit 5b191ab6cd
16 changed files with 572 additions and 301 deletions

View File

@@ -24,8 +24,8 @@
#pragma once
/** @file
*
/**
* @file
* @brief Inter-Integrated Circuit
*
* This file defines the i2c/Iic interface for libmaa. A context represents a
@@ -54,82 +54,84 @@ extern "C" {
*/
typedef struct _i2c* maa_i2c_context;
/** Initialise i2c context, using board defintions
/**
* Initialise i2c context, using board defintions
*
* @param bus i2c bus to use
* @return maa_i2c_context i2c context ready for other calls.
* @return i2c context or NULL
*/
maa_i2c_context maa_i2c_init(int bus);
/** Initialise i2c context, passing in spi bus to use.
/**
* Initialise i2c context, passing in spi bus to use.
*
* @param bus The i2c bus to use i.e. /dev/i2c-2 would be "2"
* @return maa_i2c_context i2c context ready for other calls.
* @return i2c context or NULL
*/
maa_i2c_context maa_i2c_init_raw(unsigned int bus);
/** Sets the frequency of the i2c context
/**
* Sets the frequency of the i2c context
*
* @param dev the i2c context
* @param hz The bus frequency in hertz
*
* @return maa_result_t the maa result.
* @param dev The i2c context
* @param hz The bus frequency in hertz
* @return Result of operation
*/
maa_result_t maa_i2c_frequency(maa_i2c_context dev, int hz);
/** Read from an i2c context
/**
* Read from an i2c context
*
* @param dev the i2c context
* @param data pointer to the byte array to read data in to
* @param length max number of bytes to read
*
* @return maa_result_t the maa result.
* @param dev The i2c context
* @param data pointer to the byte array to read data in to
* @param length max number of bytes to read
* @return Result of operation
*/
maa_result_t maa_i2c_read(maa_i2c_context dev, uint8_t *data, int length);
/** Read a single byte from the i2c context
/**
* Read a single byte from the i2c context
*
* @param dev the i2c context
*
* @return byte the result of the read or -1 if failed.
* @param dev The i2c context
* @return The result of the read or -1 if failed
*/
uint8_t maa_i2c_read_byte(maa_i2c_context dev);
/** Write to an i2c context
/**
* Write to an i2c context
*
* @param dev the i2c context
* @param data pointer to the byte array to be written
* @param length the number of bytes to transmit
*
* @return maa_result_t the maa result.
* @param dev The i2c context
* @param data pointer to the byte array to be written
* @param length the number of bytes to transmit
* @return Result of operation
*/
maa_result_t maa_i2c_write(maa_i2c_context dev, const uint8_t *data, int length);
/** Write a single byte to an i2c context
/**
* Write a single byte to an i2c context
*
* @param dev the i2c context
* @data the byte to write
*
* @return maa_result_t the maa result.
* @param dev The i2c context
* @param data The byte to write
* @return Result of operation
*/
maa_result_t maa_i2c_write_byte(maa_i2c_context dev, const uint8_t data);
/** Sets the i2c context address.
/**
* Sets the i2c context 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.
*
* @return maa_result_t the maa result.
* @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.
* @return Result of operation
*/
maa_result_t maa_i2c_address(maa_i2c_context dev, int address);
/** De-inits an maa_i2c_context device
/**
* De-inits an maa_i2c_context device
*
* @param dev the i2c context
*
* @return maa_result_t the maa result.
* @param dev The i2c context
* @return Result of operation
*/
maa_result_t maa_i2c_stop(maa_i2c_context dev);