upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

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(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

Here is the call graph for this function:

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

Here is the caller graph for this function:

mraa::Result i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Writes to a one-byte register

Parameters
regAddress of the register
valueByte to be written

Here is the caller graph for this function:


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