Qwiic_MAX3010x_Py  packaging_test1-4-gad4e667
Python for SFE Qwiic MAX3010x
Loading...
Searching...
No Matches
qwiic_max3010x.qwiic_max3010x.QwiicMax3010x Class Reference

QwiicMax3010x. More...

Inheritance diagram for qwiic_max3010x.qwiic_max3010x.QwiicMax3010x:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 
def is_connected (self)
 Determine if a device is conntected to the system. More...
 
def begin (self)
 Initialize the operation of the Qwiic MAX3010x module. More...
 
def bit_mask (self, reg, mask, thing)
 Given a register, read it, mask it, and then set the thing. More...
 
def millis (self)
 Returns the current time in milliseconds. More...
 
def softReset (self)
 Command a soft reset. More...
 
def getINT1 (self)
 Returns the value of the INTSTAT1 Register. More...
 
def getINT2 (self)
 Returns the value of the INTSTAT2 Register. More...
 
def enableAFULL (self)
 Enable AFULL Interrupt. More...
 
def disableAFULL (self)
 Disable AFULL Interrupt. More...
 
def enableDATARDY (self)
 Enable DATARDY Interrupt. More...
 
def disableDATARDY (self)
 Disable DATARDY Interrupt. More...
 
def enableALCOVF (self)
 Enable ALCOVF Interrupt. More...
 
def disableALCOVF (self)
 Disable ALCOVF Interrupt. More...
 
def enablePROXINT (self)
 Enable PROXINT Interrupt. More...
 
def disablePROXINT (self)
 Disable PROXINT Interrupt. More...
 
def enableDIETEMPRDY (self)
 Enable DIETEMPRDY Interrupt. More...
 
def disableDIETEMPRDY (self)
 Disable DIETEMPRDY Interrupt. More...
 
def shutDown (self)
 Put IC into low power mode. More...
 
def wakeUp (self)
 Pull IC out of low power mode. More...
 
def setLEDMode (self, mode)
 Set which LEDs are used for sampling - Red only, RED+IR only, or custom. More...
 
def setADCRange (self, adcRange)
 Set adcRange: one of MAX30105_ADCRANGE_2048, _4096, _8192, _16384. More...
 
def setSampleRate (self, sampleRate)
 Set sampleRate: one of MAX30105_SAMPLERATE_50, _100, _200, _400, _800, _1000, _1600, _3200. More...
 
def setPulseWidth (self, pulseWidth)
 Set pulseWidth: one of MAX30105_PULSEWIDTH_69, _188, _215, _411. More...
 
def setPulseAmplitudeRed (self, amplitude)
 Set pulse amplitude (mA) of red LED. More...
 
def setPulseAmplitudeIR (self, amplitude)
 Set pulse amplitude (mA) of IR LED. More...
 
def setPulseAmplitudeGreen (self, amplitude)
 Set pulse amplitude (mA) of green LED. More...
 
def setPulseAmplitudeProximity (self, amplitude)
 Set pulse aplitude while in proximity mode (only MAX30105) Note, this is specific to the MAX30105, and not included in the MAX30101. More...
 
def setProximityThreshold (self, threshMSB)
 Set the IR ADC count that will trigger the beginning of particle-sensing mode. More...
 
def enableSlot (self, slotNumber, device)
 Given a slot number assign a thing to it Devices are SLOT_RED_LED or SLOT_RED_PILOT (proximity) Assigning a SLOT_RED_LED will pulse LED Assigning a SLOT_RED_PILOT will ?? More...
 
def disableSlots (self)
 Clears all slot assignments. More...
 
def setFIFOAverage (self, numberOfSamples)
 Set sample average. More...
 
def clearFIFO (self)
 Resets all points to start in a known state. More...
 
def enableFIFORollover (self)
 Enable roll over if FIFO over flows. More...
 
def disableFIFORollover (self)
 Disable roll over if FIFO over flows. More...
 
def setFIFOAlmostFull (self, numberOfSamples)
 Set number of samples to trigger the almost full interrupt. More...
 
def getWritePointer (self)
 Read the FIFO Write Pointer. More...
 
def getReadPointer (self)
 Read the FIFO Read Pointer. More...
 
def setup (self, powerLevel=0x1F, sampleAverage=4, ledMode=3, sampleRate=400, pulseWidth=411, adcRange=4096)
 Setup the MAX3010x with default or custom settings. More...
 
def available (self)
 Tell caller how many samples are available. More...
 
def nextSample (self)
 Advance the tail. More...
 
def check (self)
 Polls the sensor for new data Call regularly If new data is available, it updates the head and tail in the main lists of data. More...
 
def safeCheck (self, maxTimeToCheck)
 Check for new data but give up after a certain amount of time Returns true if new data was found Returns false if new data was not found. More...
 
def getRed (self)
 Report the most recent red value. More...
 
def getIR (self)
 Report the most recent IR value. More...
 
def getGreen (self)
 Report the most recent GREEN value. More...
 
def getFIFORed (self)
 Report the next Red value in the FIFO. More...
 
def getFIFOIR (self)
 Report the next IR value in the FIFO. More...
 
def getFIFOGreen (self)
 Report the next Green value in the FIFO. More...
 
def readPartID (self)
 Report Part ID from the sensor. More...
 
def readRevisionID (self)
 Report Revision ID from the sensor. More...
 
def getRevisionID (self)
 Report Revision ID from current variable in this class. More...
 
def readTemperature (self)
 Report Die Temperature in C. More...
 
def readTemperatureF (self)
 Returns die temp in F. More...
 
def checkForBeat (self, sample)
 Wrapper function to allow access to function within supporting heart_rate.py file. More...
 

Public Attributes

 address
 
 activeLEDs
 
 revisionID
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int activeLEDs = 0
 
int STORAGE_SIZE = 4
 
list red = [0,0,0,0]
 
list IR = [0,0,0,0]
 
list green = [0,0,0,0]
 
int head = 0
 
int tail = 0
 
int readPointer = 0
 
int writePointer = 0
 
int numberOfSamples = 0
 

Properties

 connected = property(is_connected)
 

Detailed Description

QwiicMax3010x.

Parameters
addressThe I2C address to use for the device. If not provided, the default address is used.
i2c_driverAn existing i2c driver object. If not provided a driver object is created.
Returns
The QwiicMax3010x device object.

Constructor & Destructor Documentation

◆ __init__()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Member Function Documentation

◆ available()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.available (   self)

Tell caller how many samples are available.

Returns
integer number of samples available

◆ begin()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.begin (   self)

Initialize the operation of the Qwiic MAX3010x module.

Returns
bool Returns true of the initializtion was successful, otherwise False.

◆ bit_mask()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.bit_mask (   self,
  reg,
  mask,
  thing 
)

Given a register, read it, mask it, and then set the thing.

Parameters
regthe register you'd like to effect
maskthe mask needed to zero-out the portion of the register we're interested in
thingthe thing we are affecting aka the control bits of the register
Returns
bool Returns true of the register write was successful, otherwise False.

◆ check()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.check (   self)

Polls the sensor for new data Call regularly If new data is available, it updates the head and tail in the main lists of data.

Returns
integer number of new samples obtained

◆ checkForBeat()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.checkForBeat (   self,
  sample 
)

Wrapper function to allow access to function within supporting heart_rate.py file.

Parameters
sampleIR sample
Returns
boolean True if a beat is detected, otherwise False

◆ clearFIFO()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.clearFIFO (   self)

Resets all points to start in a known state.

Returns
no return value

◆ disableAFULL()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableAFULL (   self)

Disable AFULL Interrupt.

Returns
no return value

◆ disableALCOVF()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableALCOVF (   self)

Disable ALCOVF Interrupt.

Returns
no return value

◆ disableDATARDY()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableDATARDY (   self)

Disable DATARDY Interrupt.

Returns
no return value

◆ disableDIETEMPRDY()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableDIETEMPRDY (   self)

Disable DIETEMPRDY Interrupt.

Returns
no return value

◆ disableFIFORollover()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableFIFORollover (   self)

Disable roll over if FIFO over flows.

Returns
no return value

◆ disablePROXINT()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disablePROXINT (   self)

Disable PROXINT Interrupt.

Returns
no return value

◆ disableSlots()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableSlots (   self)

Clears all slot assignments.

Returns
no return value

◆ enableAFULL()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableAFULL (   self)

Enable AFULL Interrupt.

Returns
no return value

◆ enableALCOVF()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableALCOVF (   self)

Enable ALCOVF Interrupt.

Returns
no return value

◆ enableDATARDY()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableDATARDY (   self)

Enable DATARDY Interrupt.

Returns
no return value

◆ enableDIETEMPRDY()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableDIETEMPRDY (   self)

Enable DIETEMPRDY Interrupt.

Returns
no return value

◆ enableFIFORollover()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableFIFORollover (   self)

Enable roll over if FIFO over flows.

Returns
no return value

◆ enablePROXINT()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enablePROXINT (   self)

Enable PROXINT Interrupt.

Returns
no return value

◆ enableSlot()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableSlot (   self,
  slotNumber,
  device 
)

Given a slot number assign a thing to it Devices are SLOT_RED_LED or SLOT_RED_PILOT (proximity) Assigning a SLOT_RED_LED will pulse LED Assigning a SLOT_RED_PILOT will ??

Parameters
slotNumberslot number as int 1,2,3,4
devicewhich device (aka led) you'd like to assign to the given slot
Returns
bool Whether or not the configuration write was successful

◆ getFIFOGreen()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFOGreen (   self)

Report the next Green value in the FIFO.

Returns
integer the next Green value in the FIFO

◆ getFIFOIR()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFOIR (   self)

Report the next IR value in the FIFO.

Returns
integer the next IR value in the FIFO

◆ getFIFORed()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFORed (   self)

Report the next Red value in the FIFO.

Returns
integer the next Red value in the FIFO

◆ getGreen()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getGreen (   self)

Report the most recent GREEN value.

Returns
integer value of GREEN light sensor from most recent sample

◆ getINT1()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getINT1 (   self)

Returns the value of the INTSTAT1 Register.

Returns
integer value of the INTSTAT1 Register

◆ getINT2()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getINT2 (   self)

Returns the value of the INTSTAT2 Register.

Returns
integer value of the INTSTAT2 Register

◆ getIR()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getIR (   self)

Report the most recent IR value.

Returns
integer value of IR light sensor from most recent sample

◆ getReadPointer()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getReadPointer (   self)

Read the FIFO Read Pointer.

Returns
integer FIFO read pointer value

◆ getRed()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getRed (   self)

Report the most recent red value.

Returns
integer value of RED light sensor from most recent sample

◆ getRevisionID()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getRevisionID (   self)

Report Revision ID from current variable in this class.

Returns
integer Revision ID

◆ getWritePointer()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getWritePointer (   self)

Read the FIFO Write Pointer.

Returns
integer FIFO write pointer value

◆ is_connected()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.is_connected (   self)

Determine if a device is conntected to the system.

Returns
bool True if the device is connected, otherwise False.

◆ millis()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.millis (   self)

Returns the current time in milliseconds.

Returns
int32_t Returns current system time in milliseconds

◆ nextSample()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.nextSample (   self)

Advance the tail.

Returns
no return value

◆ readPartID()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readPartID (   self)

Report Part ID from the sensor.

Returns
integer Part ID

◆ readRevisionID()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readRevisionID (   self)

Report Revision ID from the sensor.

Returns
integer Revision ID

◆ readTemperature()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readTemperature (   self)

Report Die Temperature in C.

Returns
float die temp in C

◆ readTemperatureF()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readTemperatureF (   self)

Returns die temp in F.

Returns
float die temp in F

◆ safeCheck()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.safeCheck (   self,
  maxTimeToCheck 
)

Check for new data but give up after a certain amount of time Returns true if new data was found Returns false if new data was not found.

Parameters
maxTimeToCheckmilliseconds to timeout
Returns
boolean True if new data was found, otherwise False

◆ setADCRange()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setADCRange (   self,
  adcRange 
)

Set adcRange: one of MAX30105_ADCRANGE_2048, _4096, _8192, _16384.

Parameters
adcRangeMAX30105_ADCRANGE_2048, _4096, _8192, _16384
Returns
no return value

◆ setFIFOAlmostFull()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setFIFOAlmostFull (   self,
  numberOfSamples 
)

Set number of samples to trigger the almost full interrupt.

Parameters
numberOfSamplesdefault is 32 samples. Note it's reverse (0x00 is 32 samples, 0x0F is 17 samples)
Returns
no return value

◆ setFIFOAverage()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setFIFOAverage (   self,
  numberOfSamples 
)

Set sample average.

Parameters
numberOfSamplesMAX30105_SAMPLEAVG_1, _2, _4, _8, _16, _32
Returns
no return value

◆ setLEDMode()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setLEDMode (   self,
  mode 
)

Set which LEDs are used for sampling - Red only, RED+IR only, or custom.

Parameters
modeRed only, RED+IR only, or custom
Returns
no return value

◆ setProximityThreshold()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setProximityThreshold (   self,
  threshMSB 
)

Set the IR ADC count that will trigger the beginning of particle-sensing mode.

The threshMSB signifies only the 8 most significant-bits of the ADC count. Note, this is specific to the MAX30105, and not included in the MAX30101

Parameters
threshMSBthreshold of ADC count to cause trigger
Returns
no return value

◆ setPulseAmplitudeGreen()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeGreen (   self,
  amplitude 
)

Set pulse amplitude (mA) of green LED.

Parameters
amplitude0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical)
Returns
no return value

◆ setPulseAmplitudeIR()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeIR (   self,
  amplitude 
)

Set pulse amplitude (mA) of IR LED.

Parameters
amplitude0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical)
Returns
no return value

◆ setPulseAmplitudeProximity()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeProximity (   self,
  amplitude 
)

Set pulse aplitude while in proximity mode (only MAX30105) Note, this is specific to the MAX30105, and not included in the MAX30101.

Parameters
amplitudeamplitude
Returns
no return value

◆ setPulseAmplitudeRed()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeRed (   self,
  amplitude 
)

Set pulse amplitude (mA) of red LED.

Parameters
amplitude0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical)
Returns
no return value

◆ setPulseWidth()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseWidth (   self,
  pulseWidth 
)

Set pulseWidth: one of MAX30105_PULSEWIDTH_69, _188, _215, _411.

Parameters
pulseWidthMAX30105_PULSEWIDTH_69, _188, _215, _411
Returns
no return value

◆ setSampleRate()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setSampleRate (   self,
  sampleRate 
)

Set sampleRate: one of MAX30105_SAMPLERATE_50, _100, _200, _400, _800, _1000, _1600, _3200.

Parameters
sampleRateMAX30105_SAMPLERATE_50, _100, _200, _400, _800, _1000, _1600, _3200
Returns
no return value

◆ setup()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setup (   self,
  powerLevel = 0x1F,
  sampleAverage = 4,
  ledMode = 3,
  sampleRate = 400,
  pulseWidth = 411,
  adcRange = 4096 
)

Setup the MAX3010x with default or custom settings.

Parameters
powerLevel0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA
sampleAverageint, 1,2,4,8,16,32, default is 4
ledMode1 = RED, 2=RED+IR , 3=RED+IR+GREEN
sampleRate0-3200
pulseWidth0-411 (microseconds)
adcRange2048,4096,8192,16384
Returns
no return value

◆ shutDown()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.shutDown (   self)

Put IC into low power mode.

Returns
no return value

◆ softReset()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.softReset (   self)

Command a soft reset.

Returns
bool Returns true of the soft reset was successful, otherwise False.

◆ wakeUp()

def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.wakeUp (   self)

Pull IC out of low power mode.

Returns
no return value

Member Data Documentation

◆ activeLEDs [1/2]

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.activeLEDs = 0
static

◆ activeLEDs [2/2]

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.activeLEDs

◆ address

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.address

◆ available_addresses

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ device_name

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.device_name = _DEFAULT_NAME
static

◆ green

list qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.green = [0,0,0,0]
static

◆ head

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.head = 0
static

◆ IR

list qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.IR = [0,0,0,0]
static

◆ numberOfSamples

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.numberOfSamples = 0
static

◆ readPointer

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readPointer = 0
static

◆ red

list qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.red = [0,0,0,0]
static

◆ revisionID

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.revisionID

◆ STORAGE_SIZE

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.STORAGE_SIZE = 4
static

◆ tail

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.tail = 0
static

◆ writePointer

int qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.writePointer = 0
static

Property Documentation

◆ connected

qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.connected = property(is_connected)
static

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