#include "CirquePinnacle.h"
void PinnacleTouch::anymeasModeConfig(uint8_t gain = PINNACLE_GAIN_200, uint8_t frequency = PINNACLE_FREQ_0, uint32_t sampleLength = 512, uint8_t muxControl = PINNACLE_MUX_PNP, uint32_t apertureWidth = 500, uint8_t controlPowerCount = 1);

This function configures the Pinnacle ASIC for taking raw ADC measurements. Be sure that setDataMode() is given PINNACLE_ANYMEAS before calling this function otherwise it will do nothing.

Note

The apertureWidth parameter has an inverse relationship/affect on the frequency parameter. The approximated frequencies described in this documentation are based on an aperture width of 500 nanoseconds, and they will shrink as the aperture width grows or grow as the aperture width shrinks.

Parameters:
uint8_t gain = PINNACLE_GAIN_200

Sets the sensitivity of the ADC matrix. Valid values are the constants defined in PinnacleAnyMeasGain. Defaults to PINNACLE_GAIN_200.

uint8_t frequency = PINNACLE_FREQ_0

Sets the frequency of measurements made by the ADC matrix. Valid values are the constants defined in PinnacleAnyMeasFreq. Defaults to PINNACLE_FREQ_0.

uint32_t sampleLength = 512

Sets the maximum bit length of the measurements made by the ADC matrix. Valid values are 128, 256, or 512. Defaults to 512.

uint8_t muxControl = PINNACLE_MUX_PNP

The Pinnacle ASIC can employ different bipolar junctions and/or reference capacitors. Valid values are the constants defined in PinnacleAnyMeasMuxing. Additional combination of these constants is also allowed. Defaults to PINNACLE_MUX_PNP.

uint32_t apertureWidth = 500

Sets the window of time (in nanoseconds) to allow for the ADC to take a measurement. Valid values are multiples of 125 in range [250, 1875]. Erroneous values are clamped/truncated to this range.

uint8_t controlPowerCount = 1

Configure the Pinnacle to perform a number of measurements for each call to measureAdc(). Defaults to 1. Constants defined in PinnacleAnyMeasCtrl can be added (with +) to specify if sleep is allowed (PINNACLE_CRTL_PWR_IDLE – this is not default) or if repetitive measurements is allowed (PINNACLE_CRTL_REPEAT) when number of measurements is more than 1.

Warning

There is no bounds checking on the number of measurements specified here. Specifying more than 63 will trigger sleep mode after performing measurements.

Hint

Be aware that allowing the Pinnacle to enter sleep mode after taking measurements will cause a latency in consecutive calls to measureAdc() as the Pinnacle requires about 300 milliseconds to wake up.