si114x_algorithm.c File Reference
Configures and calculates gestures from Si1147.
License
Copyright 2018 Silicon Laboratories Inc. www.silabs.com
The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.
Definition in file
si114x_algorithm.c
.
#include "
si114x_algorithm.h
"
#include "
si114x_functions.h
"
#include "
si1147_i2c.h
"
Functions |
|
static gesture_t | ProcessSi1147Samples (Si114x_Sample_TypeDef *samples) |
Implements the algorithm for detecting gestures on the sensor STK. Should be called with new sample data every time an interrupt is received.
|
|
static void | readPSData (HANDLE si114x_handle , Si114x_Sample_TypeDef *sample) |
Reads the PS measurement data from the Si1147.
|
|
int | Si1147_ConfigureDetection ( I2C_TypeDef *i2c, uint8_t addr, int lowpower) |
Initializes and configures the Si1147 sensor.
|
|
int | Si1147_Detect_Device ( I2C_TypeDef *i2c, uint8_t addr) |
Detects whether Si1147 is on the i2c bus.
|
|
int | Si1147_GetInterruptOutputEnable ( I2C_TypeDef *i2c, uint8_t addr, int *enable) |
Get the enable status of the Si1147 interrupt pin.
|
|
int | Si1147_MeasureUVAndObjectPresent ( I2C_TypeDef *i2c, uint8_t addr, uint16_t *uvIndex, int *objectDetect) |
Reads the UV measurement data and checks for object in proximity to the Si1147.
|
|
gesture_t | Si1147_NewSample ( I2C_TypeDef *i2c, uint8_t addr, uint32_t timestamp) |
Reads new measurement data and processes a new sample. This function should be called every time an interrupt for a new sample is received.
|
|
int | Si1147_SetInterruptOutputEnable ( I2C_TypeDef *i2c, uint8_t addr, int enable) |
Enables or disables the Si1147 interrupt pin.
|
|
Variables |
|
static si114x_i2c_t * | si114x_handle = &si114x_i2c |
static si114x_i2c_t | si114x_i2c |
Function Documentation
|
static |
Implements the algorithm for detecting gestures on the sensor STK. Should be called with new sample data every time an interrupt is received.
- Parameters
-
[in] samples
New sample data received from the sensor.
- Returns
- Returns the type of gesture detected (as defined by gesture_t).
Definition at line
224
of file
si114x_algorithm.c
.
Referenced by Si1147_NewSample() .
|
static |
Reads the PS measurement data from the Si1147.
- Parameters
-
[in] si114x_handle
Contains i2c peripheral information. See definition of si114x_i2c_t. [out] sample
The sample data read from the sensor.
Definition at line
174
of file
si114x_algorithm.c
.
References Si114xReadFromRegister() .
Referenced by Si1147_NewSample() .