Capacitive touch controller (3 buttons)

class CAP1203.CAP1203[source]

Bases: object

Capacitive touch controller. Class for CAP1203 touch sensor.

MAIN_CTRL_REG = 0
SENSOR_INPUTS = 3
activeMode()[source]

Set the capacitive controller in active mode.

Parameters:none
Returns:none
checkSensorStatus()[source]

Check the current sensor status.

Parameters:none
Returns:status - Current chip status
clearInterrupt()[source]

Clear any active interrupts.

Parameters:none
Returns:none
configureMultiTouch(number, mulchan)[source]

Configure the capacitve touch for multitouch inputs.

Parameters:
  • number – number of simultaneous touches 2 or 3
  • chan – One of the three channels.
Returns:

none

deepSleep()[source]

Put the capacitive controller in deep sleep mode.

Parameters:none
Returns:none
enableInterrupt(pin)[source]

Enable the interrupt mode.

Parameters:pin – Enables interrupt on the specific pin
Returns:none
getStatusReg()[source]

Read the status register.

Parameters:none
Returns:status - Contents of status register
multitouchEvent()[source]

Return true if a multi-touch event happened.

Parameters:none
Returns:true if a multi-touch event happened
read(address, reg)[source]

Read the contents of the register.

Parameters:
  • address – Sensor address
  • reg – Register address to read from.
Returns:

data - Data content of register address

readID()[source]

Read the sensor manufacturer ID.

Parameters:none
Returns:id - Sensor ID as a number
readPressedButton()[source]

Read the pressed button, one of buttons 1 to 3.

Parameters:none
Returns:key - Button pressed
resumeFromDeepSleep()[source]

Take the capacitive controller out of deep sleep mode.

Parameters:none
Returns:none
setPowerButton(button)[source]

Configure the button for power button mode.

Parameters:button – One of the three buttons
Returns:none
setSensitivity(sensitivity)[source]

Configure the sensitivity of the controller.

Parameters:sensitivity
Returns:none
standbyMode()[source]

Set the capacitive controller in standby mode.

Parameters:none
Returns:none
write(address, reg, data)[source]

Write a byte to the register.

Parameters:
  • address – Sensor address
  • reg – Register address to write to.
  • data – Data to be written on byte sized register.
Returns:

none

Previous topic

1.8 inch display

This Page