Driver for the capacitive sense slider available on the EFM32 Giant, Wonder and Leopard starter kits.

Dependents:   EFM32 RDA5807M RDS Radio EMF32-Segment-Touch-Demo EFM32_Bugs MFALHIMOHAMMED ... more

Embed: (wiki syntax)

« Back to documentation index

caplesense.c File Reference

caplesense.c File Reference

Capacitive sense driver. More...

Go to the source code of this file.

Functions

void CAPLESENSE_setupCMU (void)
 Prototypes.
void CAPLESENSE_setupGPIO (void)
 Setup the GPIO.
void CAPLESENSE_setupACMP (void)
 Setup the ACMP.
void CAPLESENSE_setupLESENSE (bool sleep)
 Setup the LESENSE for capavitive sensing.
void CAPLESENSE_setupCallbacks (void(*scanCb)(void), void(*chCb)(void))
 LESENSE callback setup.
void LESENSE_IRQHandler (void)
 LESENSE interrupt handler.
uint8_t CAPLESENSE_getSegmentChannel (uint8_t capSegment)
 Get the channelValue for a sensor segment.
uint32_t CAPLESENSE_getVal (uint8_t channel)
 Get the current channelValue for a channel.
uint32_t CAPLESENSE_getNormalizedVal (uint8_t channel)
 Get the current normalized channelValue for a channel.
int32_t CAPLESENSE_getSliderPosition (void)
 Get the position of the slider.
void CAPLESENSE_Sleep (void)
 Send the capacative sense system to sleep mode.
void CAPLESENSE_Init (bool sleep)
 Initializes the capacative sense system without LESENSE.

Variables

static volatile uint32_t channelValues [LESENSE_CHANNELS]
 This vector stores the latest read values from LESENSE.
static volatile uint32_t channelMaxValues [LESENSE_CHANNELS]
 This stores the maximum values seen by a channel.
static const bool channelsInUse [LESENSE_CHANNELS] = LESENSE_CAPSENSE_CH_IN_USE
 A bit vector which represents the channels to iterate through.
static void(* lesenseScanCb )(void)
 Local variables.
static void(* lesenseChCb )(void)
 Callback function for LESENSE interrupts.
static volatile uint8_t currentChannel
 The current channel we are sensing.

Detailed Description

Capacitive sense driver.

Version:
3.20.9

License

(C) Copyright 2014 Silicon Labs, http://www.silabs.com

This file is licensensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file caplesense.c.


Function Documentation

void CAPLESENSE_setupACMP ( void   )

Setup the ACMP.

Definition at line 136 of file caplesense.c.

void CAPLESENSE_setupCMU ( void   )

Prototypes.

Setup the CMU.

Definition at line 93 of file caplesense.c.

void CAPLESENSE_setupGPIO ( void   )

Setup the GPIO.

Definition at line 119 of file caplesense.c.

void LESENSE_IRQHandler ( void   )

LESENSE interrupt handler.

Definition at line 347 of file caplesense.c.


Variable Documentation

volatile uint32_t channelMaxValues[LESENSE_CHANNELS] [static]
Initial value:
{

  1, 1, 1, 1, 1, 1, 1, 1,

  1, 1, 1, 1, 1, 1, 1, 1
}

This stores the maximum values seen by a channel.

Parameters:
LESENSE_CHANNELSVector of channels.

Definition at line 54 of file caplesense.c.

const bool channelsInUse[LESENSE_CHANNELS] = LESENSE_CAPSENSE_CH_IN_USE [static]

A bit vector which represents the channels to iterate through.

Parameters:
LESENSE_CHANNELSVector of channels.

Definition at line 66 of file caplesense.c.

volatile uint32_t channelValues[LESENSE_CHANNELS] [static]
Initial value:
{

  0, 0, 0, 0, 0, 0, 0, 0,

  0, 0, 0, 0, 0, 0, 0, 0
}

This vector stores the latest read values from LESENSE.

Parameters:
LESENSE_CHANNELSVector of channels.

Definition at line 41 of file caplesense.c.

volatile uint8_t currentChannel [static]

The current channel we are sensing.

Definition at line 86 of file caplesense.c.

void(* lesenseChCb)(void) [static]

Callback function for LESENSE interrupts.

Definition at line 83 of file caplesense.c.

void(* lesenseScanCb)(void) [static]

Local variables.

Callback function for LESENSE interrupts.

Definition at line 81 of file caplesense.c.