#include "CirquePinnacle.h"
int16_t PinnacleTouch::measureAdc(unsigned int bitsToToggle, unsigned int togglePolarity);

This function instigates and returns the measurement (a signed short integer) from the Pinnacle ASIC’s ADC (Analog to Digital Converter) matrix (only applies to AnyMeas mode).

Internally, this function uses the non-blocking helper functions startMeasureAdc() and getMeasureAdc(), but blocks until ADC measurements are completed. Be sure that setDataMode() is given PINNACLE_ANYMEAS before calling this function otherwise it will do nothing and return 0.

Return:

A signed short integer. If setDataMode() is not given PINNACLE_ANYMEAS, then this function returns 0 and does nothing.

4-byte Integer Format (for use as each parameter):

Bits 29 and 28 represent the optional implementation of reference capacitors built into the Pinnacle ASIC. To use these capacitors, the corresponding constants (PINNACLE_MUX_REF0 and/or PINNACLE_MUX_REF1) must be passed to anymeasModeConfig() in the muxControl parameter, and their representative bits must be flagged in both the bitsToToggle and togglePolarity parameters.

byte 3 (MSByte)

bit position

31

30

29

28

27

26

25

24

representation

N/A

N/A

Ref1

Ref0

Y11

Y10

Y9

Y8

byte 2

bit position

23

22

21

20

19

18

17

16

representation

Y7

Y6

Y5

Y4

Y3

Y2

Y1

Y0

byte 1

bit position

15

14

13

12

11

10

9

8

representation

X15

X14

X13

X12

X11

X10

X9

X8

byte 0 (LSByte)

bit position

7

6

5

4

3

2

1

0

representation

X7

X6

X5

X4

X3

X2

X1

X0

See Also

Review the anymeas_mode.ino example to understand how to use these

Parameters:
unsigned int bitsToToggle

This 4-byte integer specifies which bits the Pinnacle touch controller should toggle. A bit of 1 flags that bit for toggling, and a bit of 0 signifies that the bit should remain unaffected.

unsigned int togglePolarity

This 4-byte integer specifies which polarity the specified bits (from bitsToToggle parameter) are toggled. A bit of 1 toggles that bit positive, and a bit of 0 toggles that bit negative.