upm  0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions
MAX44000 Class Reference

C++ API for MAX44000 chip (Ambient and Infrared Proximity Sensor) More...

Detailed Description

The Maxim Integrated MAX44000 is 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;
max44000.jpeg

Public Member Functions

 MAX44000 (int bus, int devAddr)
 
 ~MAX44000 ()
 
uint16_t getProximity ()
 
uint16_t getAmbient ()
 
std::string name ()
 
uint8_t i2cReadReg_8 (int reg)
 
uint16_t i2cReadReg_16 (int reg)
 
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value)
 

Constructor & Destructor Documentation

MAX44000 ( int  bus,
int  devAddr 
)

Instanciates a MAX44000 object

Parameters
busnumber of used bus
devAddraddres of used i2c device
~MAX44000 ( )

MAX44000 object destructor, basicaly it close i2c connection.

Member Function Documentation

uint16_t getProximity ( )

Read the proximity value from the chip (based on ambient data).

Here is the call graph for this function:

uint16_t getAmbient ( )

Read the ambient value from the chip (based on ambient data).

Here is the call graph for this function:

std::string name ( )
inline

Return name of the component

uint8_t i2cReadReg_8 ( int  reg)

Read one byte register

Parameters
regaddress of a register

Here is the caller graph for this function:

uint16_t i2cReadReg_16 ( int  reg)

Read two bytes register

Parameters
regaddress of a register
mraa_result_t i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Write to one byte register

Parameters
regaddress of a register
valuebyte to be written

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