examples: added missing snippets and paired them with right examples

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu 2015-03-13 16:27:26 -07:00
parent dc932b61e7
commit e2b3cbc0f1
14 changed files with 55 additions and 11 deletions

View File

@ -2,6 +2,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples)
add_executable (hmc5883l-example hmc5883l.cxx)
add_executable (groveled-example groveled.cxx)
add_executable (groveled-multi-example groveled-multi.cxx)
add_executable (groverelay-example groverelay.cxx)
add_executable (grovelight-example grovelight.cxx)
add_executable (grovetemp-example grovetemp.cxx)
@ -12,9 +13,11 @@ add_executable (lcm1602-lcd-example lcm1602-lcd.cxx)
add_executable (jhd1313m1-lcd-example jhd1313m1-lcd.cxx)
add_executable (buzzer-sound-example buzzer-sound.cxx)
add_executable (my9221-ledbar-example my9221-ledbar.cxx)
add_executable (my9221-updown-example my9221-updown.cxx)
add_executable (tm1637-example tm1637.cxx)
add_executable (nrf24l01-transmitter-example nrf24l01-transmitter.cxx)
add_executable (nrf24l01-receiver-example nrf24l01-receiver.cxx)
add_executable (nrf24l01-broadcast-example nrf24l01-broadcast.cxx)
add_executable (es08a-example es08a.cxx)
add_executable (son-hcsr04-example hcsr04.cxx)
add_executable (ssd1308-oled-example ssd1308-oled.cxx)
@ -31,8 +34,8 @@ add_executable (mpu9150-example mpu9150.cxx)
add_executable (maxds3231m-example maxds3231m.cxx)
add_executable (max31723-example max31723.cxx)
add_executable (max5487-example max5487.cxx)
add_executable (nrf8001-broadcast-example nrf8001_broadcast.cxx)
add_executable (nrf8001-helloworld-example nrf8001_helloworld.cxx)
add_executable (nrf8001-broadcast-example nrf8001-broadcast.cxx)
add_executable (nrf8001-helloworld-example nrf8001-helloworld.cxx)
add_executable (lpd8806-example lpd8806.cxx)
add_executable (mlx90614-example mlx90614.cxx)
add_executable (ecs1030-example ecs1030.cxx)
@ -47,7 +50,6 @@ add_executable (ttp223-example ttp223.cxx)
add_executable (lsm303-example lsm303.cxx)
add_executable (joystick12-example joystick12-example.cxx)
add_executable (lol-example lol-example.cxx)
add_executable (nrf_ble_broadcast-example ble_broadcast.cxx)
add_executable (tsl2561-example tsl2561.cxx)
add_executable (htu21d-example htu21d.cxx)
add_executable (mpl3115a2-example mpl3115a2.cxx)
@ -76,8 +78,6 @@ add_executable (mq303a-example mq303a.cxx)
add_executable (grovespeaker-example grovespeaker.cxx)
add_executable (rfr359f-example rfr359f.cxx)
add_executable (biss0001-example biss0001.cxx)
add_executable (my9221-example my9221.cxx)
add_executable (grove_mcfled-example grove_mcfled.cxx)
add_executable (rotaryencoder-example rotaryencoder.cxx)
add_executable (adxl345-example adxl345.cxx)
add_executable (rpr220-example rpr220.cxx)
@ -149,7 +149,6 @@ include_directories (${PROJECT_SOURCE_DIR}/src/mq303a)
include_directories (${PROJECT_SOURCE_DIR}/src/grovespeaker)
include_directories (${PROJECT_SOURCE_DIR}/src/rfr359f)
include_directories (${PROJECT_SOURCE_DIR}/src/biss0001)
include_directories (${PROJECT_SOURCE_DIR}/src/my9221)
include_directories (${PROJECT_SOURCE_DIR}/src/rotaryencoder)
include_directories (${PROJECT_SOURCE_DIR}/src/adxl345)
include_directories (${PROJECT_SOURCE_DIR}/src/rpr220)
@ -162,6 +161,7 @@ include_directories (${PROJECT_SOURCE_DIR}/src/otp538u)
target_link_libraries (hmc5883l-example hmc5883l ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveled-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groveled-multi-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (groverelay-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovelight-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovetemp-example grove ${CMAKE_THREAD_LIBS_INIT})
@ -172,9 +172,11 @@ target_link_libraries (lcm1602-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (jhd1313m1-lcd-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (buzzer-sound-example buzzer ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (my9221-ledbar-example my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (my9221-updown-example my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tm1637-example tm1637 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-transmitter-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-receiver-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf24l01-broadcast-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (es08a-example servo ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (son-hcsr04-example hcsr04 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ssd1308-oled-example i2clcd ${CMAKE_THREAD_LIBS_INIT})
@ -207,7 +209,6 @@ target_link_libraries (ttp223-example ttp223 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lsm303-example lsm303 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (joystick12-example joystick12 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (lol-example lol ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (nrf_ble_broadcast-example nrf24l01 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (tsl2561-example tsl2561 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (htu21d-example htu21d ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (mpl3115a2-example mpl3115a2 ${CMAKE_THREAD_LIBS_INIT})
@ -236,8 +237,6 @@ target_link_libraries (mq303a-example mq303a ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grovespeaker-example grovespeaker ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rfr359f-example rfr359f ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (biss0001-example biss0001 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (my9221-example my9221 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (grove_mcfled-example grove ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rotaryencoder-example rotaryencoder ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (adxl345-example adxl345 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (rpr220-example rpr220 ${CMAKE_THREAD_LIBS_INIT})

View File

@ -49,6 +49,8 @@ void nrf_handler () {
int
main(int argc, char **argv)
{
//! [Interesting]
sensor = new upm::NRF24L01(7, 8);
sensor->setBeaconingMode ();
@ -77,5 +79,8 @@ main(int argc, char **argv)
msgs.clear();
delete sensor;
//! [Interesting]
return 0;
}

View File

@ -25,7 +25,7 @@
#include <unistd.h>
#include <iostream>
#include "nrf8001.h"
#include "nrf8001_broadcast.h"
#include "nrf8001-broadcast.h"
#include <lib_aci.h>
#include <aci_setup.h>
#include <signal.h>

View File

@ -25,7 +25,7 @@
#include <unistd.h>
#include <iostream>
#include "nrf8001.h"
#include "nrf8001_helloworld.h"
#include "nrf8001-helloworld.h"
#include <lib_aci.h>
#include <aci_setup.h>
#include <signal.h>

View File

@ -58,6 +58,7 @@ class Grove {
*
* @ingroup grove gpio
* @snippet groveled.cxx Interesting
* @snippet groveled-multi.cxx Interesting
*/
class GroveLed: public Grove {
public:

View File

@ -71,6 +71,7 @@ struct Time3231 {
* @brief C++ API for MAXDS3231M chip (Ambient and Infrared Proximity Sensor)
*
* @ingroup maxds3231m i2c
* @snippet maxds3231m.cxx Interesting
*/
class MAXDS3231M {
public:

View File

@ -49,6 +49,7 @@ namespace upm {
*
* @ingroup my9221 gpio
* @snippet my9221-ledbar.cxx Interesting
* @snippet my9221-updown.cxx Interesting
*/
class MY9221 {
public:

View File

@ -163,6 +163,7 @@ typedef enum {
* @ingroup nrf24l01
* @snippet nrf24l01-receiver.cxx Interesting
* @snippet nrf24l01-transmitter.cxx Interesting
* @snippet nrf24l01-broadcast.cxx Interesting
*/
class NRF24L01 {
public:

View File

@ -31,5 +31,23 @@
#include <lib_aci.h>
#include <aci_setup.h>
/**
* @brief nrf8001 Bluetooth Low Energy library
* @defgroup nrf8001 libupm-nrf8001
*/
/**
* @brief C++ API for the Nordic Semiconductor NRF8001 Bluetooth Low Energy
*
* This file defines the NRF8001 C++ interface for lib-nrf8001.
* Most of the interaction with this device is done using the ACI classes
* provided by Nordic Semiconductor. Please see our examples for further
* details.
*
* @ingroup nrf8001 spi
* @snippet nrf8001-helloworld.cxx Interesting
* @snippet nrf8001-broadcast.cxx Interesting
*/
void init_local_interfaces (aci_state_t* aci, uint8_t reqn, uint8_t rdyn, uint8_t rst);
void close_local_interfaces (aci_state_t* aci);

View File

@ -39,6 +39,24 @@
#define TRUE HIGH
#define FALSE LOW
/**
* @brief pulsensor pulse sensor library
* @defgroup pulsensor libupm-pulsensor
*/
/**
* @brief C++ API for 3-wire pulse sensor
*
* This is a library for the 3-wire pulse sensor sold by several manufacturers.
* Usually, you can identify the sensor based on the round breakout and the
* distinctive heart symbol.
*
* @ingroup pulsensor analog
* @snippet pulsensor.cxx Interesting
*/
/*!
* @struct clbk_data
* @brief callback data