upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Public Member Functions
MAX44000 Class Reference

API for the MAX44000 Ambient and Infrared Proximity Sensor. More...

Detailed Description

Maxim Integrated* MAX44000 is an ambient and infrared proximity sensor. This module was tested on the Maxim Integrated MAX44000PMB1 PMOD module from the analog PMOD kit.

upm::MAX44000 *sensor = new upm::MAX44000(0, ADDR);
std::cout << "proximity value = " << sensor->getAmbient () << std::endl;

Public Member Functions

 MAX44000 (int bus, int devAddr=ADDR)
 
uint16_t getProximity ()
 
uint16_t getAmbient ()
 
std::string name ()
 
uint8_t i2cReadReg_8 (int reg)
 
uint16_t i2cReadReg_16 (int reg)
 
mraa::Result i2cWriteReg (uint8_t reg, uint8_t value)
 

Constructor & Destructor Documentation

MAX44000 ( int  bus,
int  devAddr = ADDR 
)

Instantiates an MAX44000 object

Parameters
busNumber of the used bus
devAddrAddress of the used I2C device

Member Function Documentation

uint16_t getProximity ( )

MAX44000 object destructor; basically, it closes the I2C connection. ~MAX44000 (); no need for the destructor - the I2c connection will be closed when m_i2cMaxControlCtx variable will be out of context Reads the proximity value from the sensor (based on ambient data).

Here is the call graph for this function:

uint16_t getAmbient ( )

Reads the ambient value from the sensor (based on ambient data).

Here is the call graph for this function:

std::string name ( )
inline

Returns the name of the component

uint8_t i2cReadReg_8 ( int  reg)

Reads a one-byte register

Parameters
regAddress of the register

Here is the caller graph for this function:

uint16_t i2cReadReg_16 ( int  reg)

Reads a two-byte register

Parameters
regAddress of the register
mraa::Result i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Writes to a one-byte register

Parameters
regAddress of the register
valueByte to be written

The documentation for this class was generated from the following files: