LibDriver ADXL345  2.0.0
ADXL345 full-featured driver
adxl345 interrupt driver function

adxl345 interrupt driver modules More...

Enumerations

enum  adxl345_interrupt_t {
  ADXL345_INTERRUPT_DATA_READY = 0x07 , ADXL345_INTERRUPT_SINGLE_TAP = 0x06 , ADXL345_INTERRUPT_DOUBLE_TAP = 0x05 , ADXL345_INTERRUPT_ACTIVITY = 0x04 ,
  ADXL345_INTERRUPT_INACTIVITY = 0x03 , ADXL345_INTERRUPT_FREE_FALL = 0x02 , ADXL345_INTERRUPT_WATERMARK = 0x01 , ADXL345_INTERRUPT_OVERRUN = 0x00
}
 adxl345 interrupt enumeration definition More...
 
enum  adxl345_interrupt_pin_t { ADXL345_INTERRUPT_PIN1 = 0x00 , ADXL345_INTERRUPT_PIN2 = 0x01 }
 adxl345 interrupt pin enumeration definition More...
 
enum  adxl345_interrupt_active_level_t { ADXL345_INTERRUPT_ACTIVE_LEVEL_HIGH = 0x00 , ADXL345_INTERRUPT_ACTIVE_LEVEL_LOW = 0x01 }
 adxl345 interrupt active_level enumeration definition More...
 

Functions

uint8_t adxl345_set_interrupt (adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_bool_t enable)
 enable or disable the interrupt More...
 
uint8_t adxl345_get_interrupt (adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_bool_t *enable)
 get the interrupt status More...
 
uint8_t adxl345_get_interrupt_source (adxl345_handle_t *handle, uint8_t *source)
 get the interrupt source More...
 
uint8_t adxl345_set_interrupt_map (adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_interrupt_pin_t pin)
 set the interrupt map More...
 
uint8_t adxl345_get_interrupt_map (adxl345_handle_t *handle, adxl345_interrupt_t type, adxl345_interrupt_pin_t *pin)
 get the interrupt map More...
 
uint8_t adxl345_set_interrupt_active_level (adxl345_handle_t *handle, adxl345_interrupt_active_level_t active_level)
 set the interrupt active level More...
 
uint8_t adxl345_get_interrupt_active_level (adxl345_handle_t *handle, adxl345_interrupt_active_level_t *active_level)
 get the interrupt active level More...
 

Detailed Description

adxl345 interrupt driver modules

Enumeration Type Documentation

◆ adxl345_interrupt_active_level_t

adxl345 interrupt active_level enumeration definition

Enumerator
ADXL345_INTERRUPT_ACTIVE_LEVEL_HIGH 

interrupt active level high

ADXL345_INTERRUPT_ACTIVE_LEVEL_LOW 

interrupt active level low

Definition at line 258 of file driver_adxl345.h.

◆ adxl345_interrupt_pin_t

adxl345 interrupt pin enumeration definition

Enumerator
ADXL345_INTERRUPT_PIN1 

interrupt pin 1

ADXL345_INTERRUPT_PIN2 

interrupt pin 2

Definition at line 249 of file driver_adxl345.h.

◆ adxl345_interrupt_t

adxl345 interrupt enumeration definition

Enumerator
ADXL345_INTERRUPT_DATA_READY 

data ready

ADXL345_INTERRUPT_SINGLE_TAP 

single tap

ADXL345_INTERRUPT_DOUBLE_TAP 

double tap

ADXL345_INTERRUPT_ACTIVITY 

activity

ADXL345_INTERRUPT_INACTIVITY 

inactivity

ADXL345_INTERRUPT_FREE_FALL 

free fall

ADXL345_INTERRUPT_WATERMARK 

watermark

ADXL345_INTERRUPT_OVERRUN 

overrun

Definition at line 234 of file driver_adxl345.h.

Function Documentation

◆ adxl345_get_interrupt()

uint8_t adxl345_get_interrupt ( adxl345_handle_t handle,
adxl345_interrupt_t  type,
adxl345_bool_t enable 
)

get the interrupt status

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeinterrupt type
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1870 of file driver_adxl345.c.

◆ adxl345_get_interrupt_active_level()

uint8_t adxl345_get_interrupt_active_level ( adxl345_handle_t handle,
adxl345_interrupt_active_level_t active_level 
)

get the interrupt active level

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

Definition at line 2193 of file driver_adxl345.c.

◆ adxl345_get_interrupt_map()

uint8_t adxl345_get_interrupt_map ( adxl345_handle_t handle,
adxl345_interrupt_t  type,
adxl345_interrupt_pin_t pin 
)

get the interrupt map

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeinterrupt type
[out]*pinpointer to an interrupt pin buffer
Returns
status code
  • 0 success
  • 1 get interrupt map failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1946 of file driver_adxl345.c.

◆ adxl345_get_interrupt_source()

uint8_t adxl345_get_interrupt_source ( adxl345_handle_t handle,
uint8_t *  source 
)

get the interrupt source

Parameters
[in]*handlepointer to an adxl345 handle structure
[out]*sourcepointer to an interrupt source buffer
Returns
status code
  • 0 success
  • 1 get interrupt source failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1983 of file driver_adxl345.c.

◆ adxl345_set_interrupt()

uint8_t adxl345_set_interrupt ( adxl345_handle_t handle,
adxl345_interrupt_t  type,
adxl345_bool_t  enable 
)

enable or disable the interrupt

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeinterrupt type
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1832 of file driver_adxl345.c.

◆ adxl345_set_interrupt_active_level()

uint8_t adxl345_set_interrupt_active_level ( adxl345_handle_t handle,
adxl345_interrupt_active_level_t  active_level 
)

set the interrupt active level

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]active_levelinterrupt active level
Returns
status code
  • 0 success
  • 1 set interrupt active level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2156 of file driver_adxl345.c.

◆ adxl345_set_interrupt_map()

uint8_t adxl345_set_interrupt_map ( adxl345_handle_t handle,
adxl345_interrupt_t  type,
adxl345_interrupt_pin_t  pin 
)

set the interrupt map

Parameters
[in]*handlepointer to an adxl345 handle structure
[in]typeinterrupt type
[in]pininterrupt pin
Returns
status code
  • 0 success
  • 1 set interrupt map failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1908 of file driver_adxl345.c.