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

@@ -22,6 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//! [Interesting]
#include "aio.hpp"
int main ()
@@ -41,3 +42,4 @@ int main ()
return MAA_SUCCESS;
}
//! [Interesting]

View File

@@ -30,7 +30,6 @@
#include <unistd.h>
#include "gpio.hpp"
#define DEFAULT_IOPIN 8
static int iopin;
@@ -44,7 +43,6 @@ sig_handler(int signo)
running = -1;
}
}
int main (int argc, char **argv)
{
if (argc < 2) {
@@ -53,6 +51,10 @@ int main (int argc, char **argv)
} else {
iopin = strtol(argv[1], NULL, 10);
}
signal(SIGINT, sig_handler);
//! [Interesting]
maa::Gpio* gpio = new maa::Gpio(iopin);
if (gpio == NULL) {
return MAA_ERROR_UNSPECIFIED;
@@ -61,8 +63,6 @@ int main (int argc, char **argv)
if (response != MAA_SUCCESS)
maa_result_print((maa_result_t) MAA_SUCCESS);
signal(SIGINT, sig_handler);
while (running == 0) {
response = gpio->write(1);
sleep(1);
@@ -71,4 +71,5 @@ int main (int argc, char **argv)
}
delete gpio;
return response;
//! [Interesting]
}

View File

@@ -93,6 +93,7 @@ sig_handler(int signo)
int main ()
{
//! [Interesting]
maa::I2c* i2c;
i2c = new maa::I2c(0);
float direction = 0;
@@ -103,7 +104,7 @@ int main ()
rx_tx_buf[0] = HMC5883L_CONF_REG_B;
rx_tx_buf[1] = GA_1_3_REG;
i2c->write(rx_tx_buf, 2);
//! [Interesting]
signal(SIGINT, sig_handler);
while (running == 0) {

View File

@@ -40,6 +40,8 @@ sig_handler(int signo)
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
maa::Pwm* pwm;
pwm = new maa::Pwm(3);
@@ -48,8 +50,6 @@ int main ()
}
fprintf(stdout, "Cycling PWM on IO3 (pwm3) \n");
signal(SIGINT, sig_handler);
float value = 0.0f;
while (running == 0) {
value = value + 0.01f;
@@ -60,6 +60,7 @@ int main ()
}
}
delete pwm;
//! [Interesting]
return MAA_SUCCESS;
}

View File

@@ -41,12 +41,13 @@ sig_handler(int signo)
int main ()
{
signal(SIGINT, sig_handler);
//! [Interesting]
maa::Spi* spi;
spi = new maa::Spi(0);
signal(SIGINT, sig_handler);
uint8_t data[] = {0x00, 100};
uint8_t *recv;
while (running == 0) {
@@ -68,6 +69,7 @@ int main ()
}
delete spi;
//! [Interesting]
return MAA_SUCCESS;
}