LibDriver TTP229
Loading...
Searching...
No Matches
ttp229 basic driver function

ttp229 basic driver modules More...

Collaboration diagram for ttp229 basic driver function:

Data Structures

struct  ttp229_handle_s
 ttp229 handle structure definition More...
struct  ttp229_info_s
 ttp229 information structure definition More...

Typedefs

typedef struct ttp229_handle_s ttp229_handle_t
 ttp229 handle structure definition
typedef struct ttp229_info_s ttp229_info_t
 ttp229 information structure definition

Enumerations

enum  ttp229_interface_t { TTP229_INTERFACE_IIC = 0x00 , TTP229_INTERFACE_SPI = 0x01 }
 ttp229 interface enumeration definition More...
enum  ttp229_active_t { TTP229_ACTIVE_LOW = 0x00 , TTP229_ACTIVE_HIGH = 0x01 }
 ttp229 active enumeration definition More...

Functions

uint8_t ttp229_info (ttp229_info_t *info)
 get chip's information
uint8_t ttp229_set_interface (ttp229_handle_t *handle, ttp229_interface_t interface)
 set the interface
uint8_t ttp229_get_interface (ttp229_handle_t *handle, ttp229_interface_t *interface)
 get the interface
uint8_t ttp229_init (ttp229_handle_t *handle)
 initialize the chip
uint8_t ttp229_deinit (ttp229_handle_t *handle)
 close the chip
uint8_t ttp229_set_active (ttp229_handle_t *handle, ttp229_active_t active_level)
 set the active level
uint8_t ttp229_get_active (ttp229_handle_t *handle, ttp229_active_t *active_level)
 get the active level
uint8_t ttp229_read_16_keys (ttp229_handle_t *handle, uint8_t keys[16])
 read 16 keys
uint8_t ttp229_read_8_keys (ttp229_handle_t *handle, uint8_t keys[8])
 read 8 keys

Detailed Description

ttp229 basic driver modules

Typedef Documentation

◆ ttp229_handle_t

ttp229 handle structure definition

◆ ttp229_info_t

typedef struct ttp229_info_s ttp229_info_t

ttp229 information structure definition

Enumeration Type Documentation

◆ ttp229_active_t

ttp229 active enumeration definition

Enumerator
TTP229_ACTIVE_LOW 

active low

TTP229_ACTIVE_HIGH 

active high

Definition at line 71 of file driver_ttp229.h.

◆ ttp229_interface_t

ttp229 interface enumeration definition

Enumerator
TTP229_INTERFACE_IIC 

iic interface

TTP229_INTERFACE_SPI 

spi interface

Definition at line 62 of file driver_ttp229.h.

Function Documentation

◆ ttp229_deinit()

uint8_t ttp229_deinit ( ttp229_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a ttp229 handle structure
Returns
status code
  • 0 success
  • 1 iic or spi deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 279 of file driver_ttp229.c.

◆ ttp229_get_active()

uint8_t ttp229_get_active ( ttp229_handle_t * handle,
ttp229_active_t * active_level )

get the active level

Parameters
[in]*handlepointer to a ttp229 handle structure
[out]*active_levelpointer to an active level buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 166 of file driver_ttp229.c.

◆ ttp229_get_interface()

uint8_t ttp229_get_interface ( ttp229_handle_t * handle,
ttp229_interface_t * interface )

get the interface

Parameters
[in]*handlepointer to a ttp229 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 118 of file driver_ttp229.c.

◆ ttp229_info()

uint8_t ttp229_info ( ttp229_info_t * info)

get chip's information

Parameters
[out]*infopointer to a ttp229 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 433 of file driver_ttp229.c.

◆ ttp229_init()

uint8_t ttp229_init ( ttp229_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a ttp229 handle structure
Returns
status code
  • 0 success
  • 1 iic or spi initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 192 of file driver_ttp229.c.

◆ ttp229_read_16_keys()

uint8_t ttp229_read_16_keys ( ttp229_handle_t * handle,
uint8_t keys[16] )

read 16 keys

Parameters
[in]*handlepointer to a ttp229 handle structure
[out]*keyspointer to a key buffer
Returns
status code
  • 0 success
  • 1 read 16 keys failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
active is 1

Definition at line 324 of file driver_ttp229.c.

◆ ttp229_read_8_keys()

uint8_t ttp229_read_8_keys ( ttp229_handle_t * handle,
uint8_t keys[8] )

read 8 keys

Parameters
[in]*handlepointer to a ttp229 handle structure
[out]*keyspointer to a key buffer
Returns
status code
  • 0 success
  • 1 read 8 keys failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
active is 1

Definition at line 367 of file driver_ttp229.c.

◆ ttp229_set_active()

uint8_t ttp229_set_active ( ttp229_handle_t * handle,
ttp229_active_t active_level )

set the active level

Parameters
[in]*handlepointer to a ttp229 handle structure
[in]active_levelset active level
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 140 of file driver_ttp229.c.

◆ ttp229_set_interface()

uint8_t ttp229_set_interface ( ttp229_handle_t * handle,
ttp229_interface_t interface )

set the interface

Parameters
[in]*handlepointer to a ttp229 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 97 of file driver_ttp229.c.