DUDS
Distributed Update of Data from Something
duds::hardware::devices::instruments::APDS9301_internal Namespace Reference

Prevent Doxygen from mixing this up with other source-file specific items from other files. More...

Classes

struct  PeriodData
 Information on a particular sampling rate. More...
 

Enumerations

enum  CmdFlags { Cmd = 0x80, ClearInt = 0x40, Word = 0x20, AddrMask = 0x0F }
 The flags refered to as commands in the documentation. More...
 
enum  ConfigFlags {
  HighGain = 0x10, Intgrate = 0x08, InegrateTimeManual = 3, InegrateTime402ms = 2,
  InegrateTime101ms = 1, InegrateTime13ms7 = 0
}
 
enum  Regs {
  RegControl, RegConfig, RegInt = 6, RegCh0 = 0xC,
  RegCh1 = 0xE
}
 The device's registers. More...
 

Variables

static const std::map< float, PeriodDataIntegPeriodVals
 Integration period values. More...
 

Detailed Description

Prevent Doxygen from mixing this up with other source-file specific items from other files.

Enumeration Type Documentation

◆ CmdFlags

The flags refered to as commands in the documentation.

Enumerator
Cmd 

Always set in command byte.

ClearInt 

Clear interrupt flags.

Word 

Transfer two bytes instead of one.

AddrMask 

Spot for the address of register to read or write.

Definition at line 54 of file APDS9301.cpp.

◆ ConfigFlags

Enumerator
HighGain 

Use a 16x gain.

Intgrate 

Set to start manual integration, and clear to stop.

Documentation ommits time taken by analog to digital conversion.

InegrateTimeManual 
InegrateTime402ms 
InegrateTime101ms 
InegrateTime13ms7 

Definition at line 61 of file APDS9301.cpp.

◆ Regs

The device's registers.

Enumerator
RegControl 

Control register.

It is 0 when suspended, and 3 when operating. It can be read to verify operation and communication.

RegConfig 

What the documentation calls timing register; really a general configuration register.

RegInt 

Interrupt control; set to zero if not using.

RegCh0 

Channel 0: sensitive to full visible and near IR spectrum.

RegCh1 

Channel 1: sensitive to near IR spectrum.

Definition at line 26 of file APDS9301.cpp.

Variable Documentation

◆ IntegPeriodVals

const std::map<float, PeriodData> duds::hardware::devices::instruments::APDS9301_internal::IntegPeriodVals
static
Initial value:
= {
{ 13.7 * 0.001, { 101.0 / 13.7, 0, 5047 } },
{ 101.0 * 0.001, { 1.0, 1, 37177 } },
{ 402.0 * 0.001, { 101.0 / 402.0, 2, 65535 } }
}

Integration period values.

Definition at line 103 of file APDS9301.cpp.

Referenced by duds::hardware::devices::instruments::APDS9301::init(), duds::hardware::devices::instruments::APDS9301::irradiance(), and duds::hardware::devices::instruments::APDS9301::maxIrradiance().