EFM32 Jade Gecko 12 Software Documentation  efm32jg12-doc-5.1.2
capsense.c File Reference

Detailed Description

Capacitive sense driver.

Version
5.1.1

License

Copyright 2015 Silicon Labs, Inc. http://www.silabs.com

This file is licensed 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 capsense.c.

#include "em_device.h"
#include "em_acmp.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "capsense.h"

Go to the source code of this file.

Functions

uint32_t CAPSENSE_getNormalizedVal (uint8_t channel)
 Get the current normalized channelValue for a channel. More...
 
bool CAPSENSE_getPressed (uint8_t channel)
 Get the state of the Gecko Button. More...
 
int32_t CAPSENSE_getSliderPosition (void)
 Get the position of the slider. More...
 
uint32_t CAPSENSE_getVal (uint8_t channel)
 Get the current channelValue for a channel. More...
 
void CAPSENSE_Init (void)
 Initializes the capacitive sense system. More...
 
static void CAPSENSE_Measure (ACMP_Channel_TypeDef channel)
 Start a capsense measurement of a specific channel and waits for it to complete.
 
void CAPSENSE_Sense (void)
 This function iterates through all the capsensors and reads and initiates a reading. Uses EM1 while waiting for the result from each sensor.
 
void TIMER0_IRQHandler (void)
 TIMER0 interrupt handler. More...
 

Function Documentation

void TIMER0_IRQHandler ( void  )

TIMER0 interrupt handler.

When TIMER0 expires the number of pulses on TIMER1 is inserted into channelValues. If this values is bigger than what is recorded in channelMaxValues, channelMaxValues is updated. Finally, the next ACMP channel is selected.

Definition at line 92 of file capsense.c.

References channelMaxValues, channelValues, currentChannel, TIMER0, TIMER1, TIMER_CMD_STOP, and TIMER_IFC_OF.