swipeswitch 2.0.0.0
swipeswitch.h File Reference

This file contains API for SwipeSwitch Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  swipeswitch_t
 Click ctx object definition. More...
 
struct  swipeswitch_cfg_t
 Click configuration structure definition. More...
 

Macros

#define SWIPESWITCH_MAP_MIKROBUS(cfg, mikrobus)
 
#define SWIPESWITCH_RETVAL   uint8_t
 
#define SWIPESWITCH_OK   0x00
 
#define SWIPESWITCH_INIT_ERROR   0xFF
 
#define SWIPESWITCH_REG_DEVICE_INFO   0x00
 
#define SWIPESWITCH_REG_SYS_FLAGS   0x01
 
#define SWIPESWITCH_REG_TP_FLAGS   0x02
 
#define SWIPESWITCH_REG_COORDINATES   0x03
 
#define SWIPESWITCH_REG_CHANNEL_BYTES   0x04
 
#define SWIPESWITCH_REG_ACF_CH0   0x05
 
#define SWIPESWITCH_REG_ACF_CH1   0x06
 
#define SWIPESWITCH_REG_ACF_CH2   0x07
 
#define SWIPESWITCH_REG_ACF_CH3   0x08
 
#define SWIPESWITCH_REG_ACF_CH4   0x09
 
#define SWIPESWITCH_REG_ACF_CH5   0x0A
 
#define SWIPESWITCH_REG_ACF_CH6   0x0B
 
#define SWIPESWITCH_REG_LTA_CH0   0x0C
 
#define SWIPESWITCH_REG_LTA_CH1   0x0D
 
#define SWIPESWITCH_REG_LTA_CH2   0x0E
 
#define SWIPESWITCH_REG_LTA_CH3   0x0F
 
#define SWIPESWITCH_REG_LTA_CH4   0x10
 
#define SWIPESWITCH_REG_LTA_CH5   0x11
 
#define SWIPESWITCH_REG_LTA_CH6   0x12
 
#define SWIPESWITCH_REG_DELTA_CH0   0x13
 
#define SWIPESWITCH_REG_DELTA_CH1   0x14
 
#define SWIPESWITCH_REG_DELTA_CH2   0x15
 
#define SWIPESWITCH_REG_DELTA_CH3   0x16
 
#define SWIPESWITCH_REG_DELTA_CH4   0x17
 
#define SWIPESWITCH_REG_DELTA_CH5   0x18
 
#define SWIPESWITCH_REG_DELTA_CH6   0x19
 
#define SWIPESWITCH_REG_PROXSETTINGS_01   0x80
 
#define SWIPESWITCH_REG_PROXSETTINGS_23   0x81
 
#define SWIPESWITCH_REG_EVENT_MASK   0x82
 
#define SWIPESWITCH_REG_TIMEOUT_PERIODS   0x83
 
#define SWIPESWITCH_REG_REPORT_RATES   0x84
 
#define SWIPESWITCH_REG_THRESHOLDS_CH0   0x85
 
#define SWIPESWITCH_REG_TOUCH_THR_CH1_CH2   0x86
 
#define SWIPESWITCH_REG_TOUCH_THR_CH3_CH4   0x87
 
#define SWIPESWITCH_REG_TOUCH_THR_CH5_CH6   0x88
 
#define SWIPESWITCH_REG_ATI_TARGETS   0x89
 
#define SWIPESWITCH_REG_CHANNEL_SETTINGS   0x8A
 
#define SWIPESWITCH_REG_TAP_SETTINGS   0x8B
 
#define SWIPESWITCH_REG_SWIPE_SETTINGS   0x8C
 
#define SWIPESWITCH_EVENT_PROX   0x01
 
#define SWIPESWITCH_EVENT_TOUCH   0x02
 
#define SWIPESWITCH_EVENT_TP   0x04
 
#define SWIPESWITCH_EVENT_ATI   0x08
 
#define SWIPESWITCH_EVENT_TAP   0x10
 
#define SWIPESWITCH_EVENT_SWIPE   0x20
 
#define SWIPESWITCH_EVENT_LP   0x80
 
#define SWIPESWITCH_EVENTS_ALL   0xFF
 
#define SWIPESWITCH_GESTURE_TP   0x01
 
#define SWIPESWITCH_GESTURE_TAP   0x02
 
#define SWIPESWITCH_GESTURE_SWIPE_UP   0x04
 
#define SWIPESWITCH_GESTURE_SWIPE_DOWN   0x08
 
#define SWIPESWITCH_GESTURE_SWIPE_LEFT   0x10
 
#define SWIPESWITCH_GESTURE_SWIPE_RIGHT   0x20
 
#define SWIPESWITCH_CH0_PROX   0x01
 
#define SWIPESWITCH_SHOW_RESET   0x80
 
#define SWIPESWITCH_ACK_RESET   0x80
 
#define SWIPESWITCH_REDO_ATI   0x10
 
#define SWIPESWITCH_EVENT_MODE   0x40
 
#define SWIPESWITCH_CH0_TOUCH   0x01
 
#define SWIPESWITCH_CH1_TOUCH   0x02
 
#define SWIPESWITCH_CH2_TOUCH   0x04
 
#define SWIPESWITCH_CH3_TOUCH   0x08
 
#define SWIPESWITCH_CH4_TOUCH   0x10
 
#define SWIPESWITCH_CH5_TOUCH   0x20
 
#define SWIPESWITCH_CH6_TOUCH   0x40
 
#define SWIPESWITCH_TPF_SEGMENT_0   0x00
 
#define SWIPESWITCH_TPF_SEGMENT_1   0x40
 
#define SWIPESWITCH_TPF_SEGMENT_2   0x80
 
#define SWIPESWITCH_TPF_SEGMENT_3   0xC0
 
#define SWIPESWITCH_TPF_SWIPE_RIGHT   0x20
 
#define SWIPESWITCH_TPF_SWIPE_LEFT   0x10
 
#define SWIPESWITCH_TPF_SWIPE_DOWN   0x08
 
#define SWIPESWITCH_TPF_SWIPE_UP   0x04
 
#define SWIPESWITCH_TPF_TAP   0x02
 
#define SWIPESWITCH_TPF_TP_ACTIVE   0x01
 
#define SWIPESWITCH_PS0_AUTO_ATI_ON   0x00
 
#define SWIPESWITCH_PS0_AUTO_ATI_OFF   0x80
 
#define SWIPESWITCH_PS0_NORMAL_ATI_ACTIVE   0x00
 
#define SWIPESWITCH_PS0_PARTIAL_ATI_ACTIVE   0x40
 
#define SWIPESWITCH_PS0_NORMAL_ATI_BAND   0x00
 
#define SWIPESWITCH_PS0_LARGE_ATI_BAND   0x20
 
#define SWIPESWITCH_PS0_REDO_AN_ATI   0x10
 
#define SWIPESWITCH_PS0_DEBUG_ATI_DISABLE   0x00
 
#define SWIPESWITCH_PS0_DEBUG_ATI_ENABLE   0x04
 
#define SWIPESWITCH_PS0_NORMAL_ANALOGUE_TIME   0x00
 
#define SWIPESWITCH_PS0_INCREASED_ANALOGUE_TIME   0x02
 
#define SWIPESWITCH_PS0_NORMAL_HALTING   0x00
 
#define SWIPESWITCH_PS0_Force_halt   0x01
 
#define SWIPESWITCH_PS1_COMMUNICATION_WATCH_DOG_ENABLED   0x00
 
#define SWIPESWITCH_PS1_COMMUNICATION_WATCH_DOG_DISABLED   0x80
 
#define SWIPESWITCH_PS1_STREAMING_MODE   0x00
 
#define SWIPESWITCH_PS1_EVENT_MODE   0x40
 
#define SWIPESWITCH_PS1_LTA_BETA_1_512   0x00
 
#define SWIPESWITCH_PS1_LTA_BETA_1_256   0x10
 
#define SWIPESWITCH_PS1_LTA_BETA_1_128   0x20
 
#define SWIPESWITCH_PS1_LTA_BETA_1_64   0x30
 
#define SWIPESWITCH_PS1_ACF_BETA_1   0x01
 
#define SWIPESWITCH_PS1_ACF_BETA_2   0x02
 
#define SWIPESWITCH_PS1_ACF_BETA_3   0x03
 
#define SWIPESWITCH_PS1_ACF_FILTER_OFF   0x00
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_1   0x00
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_2   0x01
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_4   0x02
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_8   0x03
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_16   0x04
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_32   0x05
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_64   0x06
 
#define SWIPESWITCH_PS2_NP_SEGMENT_RATE_128   0x07
 
#define SWIPESWITCH_PS3_ACKNOWLEDGE_RESET   0x80
 
#define SWIPESWITCH_PS3_IC_IN_ON_MODE   0x00
 
#define SWIPESWITCH_PS3_IC_IN_OFF_MODE   0x40
 
#define SWIPESWITCH_PS3_BIAS_CURRENT_5uA   0x00
 
#define SWIPESWITCH_PS3_BIAS_CURRENT_10uA   0x20
 
#define SWIPESWITCH_PS3_GROUND_Cx_PINS   0x00
 
#define SWIPESWITCH_PS3_FLOAT_Cx_PINS   0x10
 
#define SWIPESWITCH_PS3_NORMAL_CHARGING   0x00
 
#define SWIPESWITCH_PS3_HALT_CHARGING   0x08
 
#define SWIPESWITCH_PS3_CHARGING_FREQ_CH123456_2MHz   0x00
 
#define SWIPESWITCH_PS3_CHARGING_FREQ_CH123456_1MHz   0x02
 
#define SWIPESWITCH_PS3_CHARGING_FREQ_CH0_1MHz   0x00
 
#define SWIPESWITCH_PS3_CHARGING_FREQ_CH0_500kHz   0x10
 
#define SWIPESWITCH_CHANNEL_0   0x01
 
#define SWIPESWITCH_CHANNEL_1   0x02
 
#define SWIPESWITCH_CHANNEL_2   0x04
 
#define SWIPESWITCH_CHANNEL_3   0x08
 
#define SWIPESWITCH_CHANNEL_4   0x10
 
#define SWIPESWITCH_CHANNEL_5   0x20
 
#define SWIPESWITCH_CHANNEL_6   0x40
 
#define SWIPESWITCH_DEVICE_SLAVE_ADDRESS   0x44
 

Functions

void swipeswitch_cfg_setup (swipeswitch_cfg_t *cfg)
 Config Object Initialization function.
 
SWIPESWITCH_RETVAL swipeswitch_init (swipeswitch_t *ctx, swipeswitch_cfg_t *cfg)
 Initialization function.
 
void swipeswitch_generic_write (swipeswitch_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void swipeswitch_generic_read (swipeswitch_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t swipeswitch_wait_for_ready (swipeswitch_t *ctx)
 Function that waits for the module to be ready for operation.
 
void swipeswitch_disable_halt_timeout (swipeswitch_t *ctx)
 Function for disable halt time.
 
void swipeswitch_disable_events (swipeswitch_t *ctx, uint8_t event)
 Function for disabled Event.
 
void swipeswitch_enable_events (swipeswitch_t *ctx, uint8_t event)
 Function for enabled Event.
 
void swipeswitch_go_to_event_mode (swipeswitch_t *ctx)
 Function for Event mode.
 
void swipeswitch_go_to_stream_mode (swipeswitch_t *ctx)
 Function for Stream mode.
 
uint8_t swipeswitch_read_system_flags (swipeswitch_t *ctx)
 Function for reads system falgs.
 
uint8_t swipeswitch_read_events (swipeswitch_t *ctx)
 Function for reading event.
 
uint8_t swipeswitch_read_gestures (swipeswitch_t *ctx)
 Function for reading Gestures.
 
uint8_t swipeswitch_read_trackpad_flags (swipeswitch_t *ctx)
 Function for reading Trackpad falgs.
 
uint8_t swipeswitch_read_prox_byte (swipeswitch_t *ctx)
 Function for reading Prox byte.
 
uint8_t swipeswitch_read_touch_byte (swipeswitch_t *ctx)
 Function for reading Touch byte.
 
uint8_t swipeswitch_read_x_coordinate (swipeswitch_t *ctx)
 Function for reading X coordinate.
 
uint8_t swipeswitch_read_y_coordinate (swipeswitch_t *ctx)
 Function for reading Y coordinate.
 
void swipeswitch_set_touch_sensitivity (swipeswitch_t *ctx, uint8_t sensitivity)
 Function for setting Touch Sensitivity.
 
void swipeswitch_set_prox_sensitivity (swipeswitch_t *ctx, uint8_t sensitivity)
 Function for setting Prox Sensitivity.
 
void swipeswitch_set_event_mask (swipeswitch_t *ctx, uint8_t event_mask)
 Function for setting Event mask.
 
void swipeswitch_enable_channel (swipeswitch_t *ctx, uint8_t channel)
 Function for enabling channels.
 
void swipeswitch_disable_channel (swipeswitch_t *ctx, uint8_t channel)
 Function for disabling channels.
 
uint16_t swipeswitch_read_channel (swipeswitch_t *ctx, uint8_t read_data, uint8_t channel)
 Function for reading channel.
 
void swipeswitch_set_tap_timer_limit (swipeswitch_t *ctx, uint8_t time_limit)
 Function for setting tap timer limit.
 
void swipeswitch_set_tap_threshold (swipeswitch_t *ctx, uint8_t threshold)
 Function for setting tap threshold.
 
void swipeswitch_set_swipe_timer_limit (swipeswitch_t *ctx, uint8_t time_limit)
 Function for setting swipe timer limit.
 
void swipeswitch_set_swipe_threshold (swipeswitch_t *ctx, uint8_t threshold)
 Function for setting swipe threshold.
 
void swipeswitch_set_report_rate_nm (swipeswitch_t *ctx, uint8_t report_rate)
 Function for setting report rate NM.
 
void swipeswitch_set_report_rate_lp (swipeswitch_t *ctx, uint8_t report_rate)
 Function for setting report rate LP.
 
void swipeswitch_set_np_segment_rate (swipeswitch_t *ctx, uint8_t segment_rate)
 Function for setting segment rate.
 
void swipeswitch_set_zoom_timeout (swipeswitch_t *ctx, uint8_t timeout_period)
 Function for setting zoom timeout.
 
void swipeswitch_set_halt_timeout (swipeswitch_t *ctx, uint8_t halt_time)
 Function for setting halt timeout.
 

Detailed Description

This file contains API for SwipeSwitch Click driver.