doxygen: add basic doxygen documentation for upm

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll 2014-04-30 15:47:12 +01:00
parent b0684c98a8
commit 21991e3598
5 changed files with 2405 additions and 22 deletions

View File

@ -7,8 +7,20 @@ include (${SWIG_USE_FILE})
find_package (PkgConfig REQUIRED)
pkg_check_modules (MAA maa>=0.2.1)
message (INFO " found libmaa version: ${MAA_VERSION}")
set (CMAKE_SWIG_FLAGS "")
# add a target to generate API documentation with Doxygen
find_package (Doxygen)
if (DOXYGEN_FOUND)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target (doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif (DOXYGEN_FOUND)
add_subdirectory (src)
add_subdirectory (examples)

2354
Doxyfile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
UPM - Sensor/Actuator repository for Maa
==============
UPM is a high level repository for sensors that use maa. Each sensor links to
libmaa and are not meant to be interlinked although some groups of sensors may
@ -22,4 +23,4 @@ However implementation and API design is compeltely up to the developer, some
enumerable sensors for example may provide much clever instanciation. Displays
may also create more complex structures in order to interface with them.
For more information on maa, see the maa README
For more information on maa, see the maa documentation

View File

@ -79,17 +79,17 @@ using namespace upm;
Hmc5883l::Hmc5883l()
{
i2c = maa_i2c_init();
m_i2c = maa_i2c_init();
maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
rx_tx_buf[0] = HMC5883L_CONF_REG_B;
rx_tx_buf[1] = GA_1_3_REG;
maa_i2c_write(i2c, rx_tx_buf, 2);
maa_i2c_address(m_i2c, HMC5883L_I2C_ADDR);
m_rx_tx_buf[0] = HMC5883L_CONF_REG_B;
m_rx_tx_buf[1] = GA_1_3_REG;
maa_i2c_write(m_i2c, m_rx_tx_buf, 2);
maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
rx_tx_buf[0] = HMC5883L_MODE_REG;
rx_tx_buf[1] = HMC5883L_CONT_MODE;
maa_i2c_write(i2c, rx_tx_buf, 2);
maa_i2c_address(m_i2c, HMC5883L_I2C_ADDR);
m_rx_tx_buf[0] = HMC5883L_MODE_REG;
m_rx_tx_buf[1] = HMC5883L_CONT_MODE;
maa_i2c_write(m_i2c, m_rx_tx_buf, 2);
Hmc5883l::update();
}
@ -97,18 +97,18 @@ Hmc5883l::Hmc5883l()
int
Hmc5883l::update(void)
{
maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
maa_i2c_write_byte(i2c, HMC5883L_DATA_REG);
maa_i2c_address(m_i2c, HMC5883L_I2C_ADDR);
maa_i2c_write_byte(m_i2c, HMC5883L_DATA_REG);
maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
maa_i2c_read(i2c, rx_tx_buf, DATA_REG_SIZE);
maa_i2c_address(m_i2c, HMC5883L_I2C_ADDR);
maa_i2c_read(m_i2c, m_rx_tx_buf, DATA_REG_SIZE);
// x
coor[0] = (rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_X_LSB_REG] ;
m_coor[0] = (m_rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | m_rx_tx_buf[HMC5883L_X_LSB_REG];
// z
coor[2] = (rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Z_LSB_REG] ;
m_coor[2] = (m_rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | m_rx_tx_buf[HMC5883L_Z_LSB_REG];
// y
coor[1] = (rx_tx_buf[HMC5883L_Y_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Y_LSB_REG] ;
m_coor[1] = (m_rx_tx_buf[HMC5883L_Y_MSB_REG] << 8 ) | m_rx_tx_buf[HMC5883L_Y_LSB_REG];
return MAA_SUCCESS;
}
@ -116,7 +116,7 @@ Hmc5883l::update(void)
float
Hmc5883l::direction(void)
{
return atan2(coor[1] * SCALE_0_92_MG, coor[0] * SCALE_0_92_MG);
return atan2(m_coor[1] * SCALE_0_92_MG, m_coor[0] * SCALE_0_92_MG);
}
float
@ -128,5 +128,5 @@ Hmc5883l::heading(void)
int*
Hmc5883l::coordinates(void)
{
return &coor[0];
return &m_coor[0];
}

View File

@ -31,15 +31,31 @@ namespace upm {
class Hmc5883l {
public:
/// Creates a Hmc5883l object
Hmc5883l();
/// Returns the direction
float direction();
/// Returns the heading
float heading();
/**
* Returns a pointer to an int[3] that contains the coordinates as ints
* @return *int to an int[3]
*/
int* coordinates();
/**
* Updates the values by reading from i2c
*
* @return 0 for success
*/
int update();
private:
int coor[3];
char rx_tx_buf[MAX_BUFFER_LENGTH];
maa_i2c_context* i2c;
int m_coor[3];
char m_rx_tx_buf[MAX_BUFFER_LENGTH];
maa_i2c_context* m_i2c;
};
}