mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
mcp9808: updated doxygen tags and formatted sources
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
85b5c8a64e
commit
90bf469245
Binary file not shown.
Before Width: | Height: | Size: 319 KiB After Width: | Height: | Size: 49 KiB |
@ -1,24 +1,19 @@
|
||||
|
||||
#include "mraa.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include "mcp9808.h"
|
||||
|
||||
|
||||
#include "mraa.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
using namespace std;
|
||||
|
||||
//! [Interesting]
|
||||
int command;
|
||||
upm::MCP9808 *temp = new upm::MCP9808(6);
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
cout << endl;
|
||||
cout << "1 - read temp \t" ;
|
||||
cout << "2 - sleep mode \t";
|
||||
@ -43,7 +38,6 @@ int main()
|
||||
cout << "Enter a command: ";
|
||||
cin >> command;
|
||||
|
||||
|
||||
switch(command)
|
||||
{
|
||||
float t;
|
||||
@ -164,8 +158,6 @@ int main()
|
||||
}
|
||||
|
||||
}while (command != -1 );
|
||||
|
||||
|
||||
|
||||
//! [Interesting]
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
@ -42,16 +42,23 @@
|
||||
#define MCP9808_CONFIG_INTCLR 0x2000
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief MCP9808 precision temperature sensor library
|
||||
* @defgroup mcp9808 libupm-mcp9808
|
||||
* @ingroup adafruit i2c temp
|
||||
*/
|
||||
/**
|
||||
* @library mcp9808
|
||||
* @sensor MCP9808
|
||||
* @comname MCP9808
|
||||
* @type Temperature, precision.
|
||||
* @man https://learn.adafruit.com/adafruit-mcp9808-precision-i2c-temperature-sensor-guide/overview
|
||||
* @man http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf
|
||||
* @comname MCP9808 Temperature Sensor
|
||||
* @type temp
|
||||
* @man adafruit
|
||||
* @con i2c
|
||||
* @web https://learn.adafruit.com/adafruit-mcp9808-precision-i2c-temperature-sensor-guide/overview
|
||||
* @web http://ww1.microchip.com/downloads/en/DeviceDoc/25095A.pdf
|
||||
*
|
||||
* @brief API for MCP9808 precision temprature sensor
|
||||
*
|
||||
* The MCP9808 digital temperature sensor converts temperatures between -20°C and +100°C
|
||||
* to a digital word with ±0.5°C (max.) accuracy. The MCP9808 comes with user-programmable
|
||||
* registers that provide flexibility for temperature sensing applications. The registers
|
||||
@ -170,7 +177,6 @@ namespace upm {
|
||||
*/
|
||||
float getTemp(void);
|
||||
|
||||
|
||||
/**
|
||||
* Will cause the devices to either sleep or wakeup.
|
||||
*
|
||||
@ -307,9 +313,6 @@ namespace upm {
|
||||
*/
|
||||
uint16_t getDevicedId();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
bool m_celsius;
|
||||
@ -322,8 +325,5 @@ namespace upm {
|
||||
float getTempValue(uint16_t value);
|
||||
void updateConfigRegister(uint16_t update, bool on = true);
|
||||
uint16_t swapWord(uint16_t value);
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user