![]() |
Qwiic_MAX3010x_Py
2.0.0-1-gf948e6e
Python for SFE Qwiic MAX3010x
|
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) | |
| address | The I2C address to use for the device. If not provided, the default address is used. |
| i2c_driver | An existing i2c driver object. If not provided a driver object is created. |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.__init__ | ( | self, | |
address = None, |
|||
i2c_driver = None |
|||
| ) |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.available | ( | self | ) |
Tell caller how many samples are available.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.begin | ( | self | ) |
Initialize the operation of the Qwiic MAX3010x module.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.bit_mask | ( | self, | |
| reg, | |||
| mask, | |||
| thing | |||
| ) |
Given a register, read it, mask it, and then set the thing.
| reg | the register you'd like to effect |
| mask | the mask needed to zero-out the portion of the register we're interested in |
| thing | the thing we are affecting aka the control bits of the register |
| 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.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.checkForBeat | ( | self, | |
| sample | |||
| ) |
Wrapper function to allow access to function within supporting heart_rate.py file.
| sample | IR sample |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.clearFIFO | ( | self | ) |
Resets all points to start in a known state.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableAFULL | ( | self | ) |
Disable AFULL Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableALCOVF | ( | self | ) |
Disable ALCOVF Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableDATARDY | ( | self | ) |
Disable DATARDY Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableDIETEMPRDY | ( | self | ) |
Disable DIETEMPRDY Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableFIFORollover | ( | self | ) |
Disable roll over if FIFO over flows.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disablePROXINT | ( | self | ) |
Disable PROXINT Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.disableSlots | ( | self | ) |
Clears all slot assignments.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableAFULL | ( | self | ) |
Enable AFULL Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableALCOVF | ( | self | ) |
Enable ALCOVF Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableDATARDY | ( | self | ) |
Enable DATARDY Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableDIETEMPRDY | ( | self | ) |
Enable DIETEMPRDY Interrupt.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enableFIFORollover | ( | self | ) |
Enable roll over if FIFO over flows.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.enablePROXINT | ( | self | ) |
Enable PROXINT Interrupt.
| 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 ??
| slotNumber | slot number as int 1,2,3,4 |
| device | which device (aka led) you'd like to assign to the given slot |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFOGreen | ( | self | ) |
Report the next Green value in the FIFO.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFOIR | ( | self | ) |
Report the next IR value in the FIFO.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getFIFORed | ( | self | ) |
Report the next Red value in the FIFO.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getGreen | ( | self | ) |
Report the most recent GREEN value.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getINT1 | ( | self | ) |
Returns the value of the INTSTAT1 Register.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getINT2 | ( | self | ) |
Returns the value of the INTSTAT2 Register.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getIR | ( | self | ) |
Report the most recent IR value.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getReadPointer | ( | self | ) |
Read the FIFO Read Pointer.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getRed | ( | self | ) |
Report the most recent red value.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getRevisionID | ( | self | ) |
Report Revision ID from current variable in this class.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.getWritePointer | ( | self | ) |
Read the FIFO Write Pointer.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.is_connected | ( | self | ) |
Determine if a device is conntected to the system.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.millis | ( | self | ) |
Returns the current time in milliseconds.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.nextSample | ( | self | ) |
Advance the tail.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readPartID | ( | self | ) |
Report Part ID from the sensor.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readRevisionID | ( | self | ) |
Report Revision ID from the sensor.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readTemperature | ( | self | ) |
Report Die Temperature in C.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.readTemperatureF | ( | self | ) |
Returns die temp in F.
| 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.
| maxTimeToCheck | milliseconds to timeout |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setADCRange | ( | self, | |
| adcRange | |||
| ) |
Set adcRange: one of MAX30105_ADCRANGE_2048, _4096, _8192, _16384.
| adcRange | MAX30105_ADCRANGE_2048, _4096, _8192, _16384 |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setFIFOAlmostFull | ( | self, | |
| numberOfSamples | |||
| ) |
Set number of samples to trigger the almost full interrupt.
| numberOfSamples | default is 32 samples. Note it's reverse (0x00 is 32 samples, 0x0F is 17 samples) |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setFIFOAverage | ( | self, | |
| numberOfSamples | |||
| ) |
Set sample average.
| numberOfSamples | MAX30105_SAMPLEAVG_1, _2, _4, _8, _16, _32 |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setLEDMode | ( | self, | |
| mode | |||
| ) |
Set which LEDs are used for sampling - Red only, RED+IR only, or custom.
| mode | Red only, RED+IR only, or custom |
| 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
| threshMSB | threshold of ADC count to cause trigger |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeGreen | ( | self, | |
| amplitude | |||
| ) |
Set pulse amplitude (mA) of green LED.
| amplitude | 0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical) |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeIR | ( | self, | |
| amplitude | |||
| ) |
Set pulse amplitude (mA) of IR LED.
| amplitude | 0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical) |
| 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.
| amplitude | amplitude |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseAmplitudeRed | ( | self, | |
| amplitude | |||
| ) |
Set pulse amplitude (mA) of red LED.
| amplitude | 0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA (typical) |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setPulseWidth | ( | self, | |
| pulseWidth | |||
| ) |
Set pulseWidth: one of MAX30105_PULSEWIDTH_69, _188, _215, _411.
| pulseWidth | MAX30105_PULSEWIDTH_69, _188, _215, _411 |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.setSampleRate | ( | self, | |
| sampleRate | |||
| ) |
Set sampleRate: one of MAX30105_SAMPLERATE_50, _100, _200, _400, _800, _1000, _1600, _3200.
| sampleRate | MAX30105_SAMPLERATE_50, _100, _200, _400, _800, _1000, _1600, _3200 |
| 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.
| powerLevel | 0x00 = 0mA, 0x7F = 25.4mA, 0xFF = 50mA |
| sampleAverage | int, 1,2,4,8,16,32, default is 4 |
| ledMode | 1 = RED, 2=RED+IR , 3=RED+IR+GREEN |
| sampleRate | 0-3200 |
| pulseWidth | 0-411 (microseconds) |
| adcRange | 2048,4096,8192,16384 |
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.shutDown | ( | self | ) |
Put IC into low power mode.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.softReset | ( | self | ) |
Command a soft reset.
| def qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.wakeUp | ( | self | ) |
Pull IC out of low power mode.
|
static |
| qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.activeLEDs |
| qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.address |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| qwiic_max3010x.qwiic_max3010x.QwiicMax3010x.revisionID |
|
static |
|
static |
|
static |
|
static |