LibDriver L3GD20H
Loading...
Searching...
No Matches
driver_l3gd20h.h File Reference

driver l3gd20h header file More...

#include <stdint.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for driver_l3gd20h.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  l3gd20h_handle_s
 l3gd20h handle structure definition More...
struct  l3gd20h_info_s
 l3gd20h information structure definition More...

Macros

#define DRIVER_L3GD20H_LINK_INIT(HANDLE, STRUCTURE)
 initialize l3gd20h_handle_t structure
#define DRIVER_L3GD20H_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_L3GD20H_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_L3GD20H_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_L3GD20H_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_L3GD20H_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_L3GD20H_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_L3GD20H_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_L3GD20H_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_L3GD20H_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_L3GD20H_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_L3GD20H_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct l3gd20h_handle_s l3gd20h_handle_t
 l3gd20h handle structure definition
typedef struct l3gd20h_info_s l3gd20h_info_t
 l3gd20h information structure definition

Enumerations

enum  l3gd20h_interface_t { L3GD20H_INTERFACE_IIC = 0x00 , L3GD20H_INTERFACE_SPI = 0x01 }
 l3gd20h interface enumeration definition More...
enum  l3gd20h_address_t { L3GD20H_ADDRESS_SDO_0 = 0xD4 , L3GD20H_ADDRESS_SDO_1 = 0xD6 }
 l3gd20h address enumeration definition More...
enum  l3gd20h_bool_t { L3GD20H_BOOL_FALSE = 0x00 , L3GD20H_BOOL_TRUE = 0x01 }
 l3gd20h bool enumeration definition More...
enum  l3gd20h_axis_t { L3GD20H_AXIS_X = 0x01 , L3GD20H_AXIS_Y = 0x00 , L3GD20H_AXIS_Z = 0x02 }
 l3gd20h axis enumeration definition More...
enum  l3gd20h_mode_t { L3GD20H_MODE_POWER_DOWN = 0x00 , L3GD20H_MODE_NORMAL = 0x01 , L3GD20H_MODE_SLEEP = 0x02 }
 l3gd20h mode enumeration definition More...
enum  l3gd20h_high_pass_filter_mode_t { L3GD20H_HIGH_PASS_FILTER_MODE_NORMAL_RESET = 0x00 , L3GD20H_HIGH_PASS_FILTER_MODE_REFERENCE_SIGNAL = 0x01 , L3GD20H_HIGH_PASS_FILTER_MODE_NORMAL = 0x02 , L3GD20H_HIGH_PASS_FILTER_MODE_AUTORESET_ON_INT = 0x03 }
 l3gd20h high pass filter mode enumeration definition More...
enum  l3gd20h_high_pass_filter_cut_off_frequency_t {
  L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_0 = 0x00 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_1 = 0x01 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_2 = 0x02 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_3 = 0x03 ,
  L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_4 = 0x04 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_5 = 0x05 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_6 = 0x06 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_7 = 0x07 ,
  L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_8 = 0x08 , L3GD20H_HIGH_PASS_FILTER_CUT_OFF_FREQUENCY_9 = 0x09
}
 l3gd20h high pass filter cut off frequency enumeration definition More...
enum  l3gd20h_lodr_odr_bw_t {
  L3GD20H_LOW_ODR_0_ODR_100HZ_BW_0_12P5HZ = 0x00 , L3GD20H_LOW_ODR_0_ODR_100HZ_BW_1_25HZ = 0x01 , L3GD20H_LOW_ODR_0_ODR_100HZ_BW_2_25HZ = 0x02 , L3GD20H_LOW_ODR_0_ODR_100HZ_BW_3_25HZ = 0x03 ,
  L3GD20H_LOW_ODR_0_ODR_200HZ_BW_0_12P5HZ = 0x04 , L3GD20H_LOW_ODR_0_ODR_200HZ_BW_1_NA = 0x05 , L3GD20H_LOW_ODR_0_ODR_200HZ_BW_2_NA = 0x06 , L3GD20H_LOW_ODR_0_ODR_200HZ_BW_3_70HZ = 0x07 ,
  L3GD20H_LOW_ODR_0_ODR_400HZ_BW_0_20HZ = 0x08 , L3GD20H_LOW_ODR_0_ODR_400HZ_BW_1_25HZ = 0x09 , L3GD20H_LOW_ODR_0_ODR_400HZ_BW_2_50HZ = 0x0A , L3GD20H_LOW_ODR_0_ODR_400HZ_BW_3_110HZ = 0x0B ,
  L3GD20H_LOW_ODR_0_ODR_800HZ_BW_0_30HZ = 0x0C , L3GD20H_LOW_ODR_0_ODR_800HZ_BW_1_35HZ = 0x0D , L3GD20H_LOW_ODR_0_ODR_800HZ_BW_2_NA = 0x0E , L3GD20H_LOW_ODR_0_ODR_800HZ_BW_3_100HZ = 0x0F ,
  L3GD20H_LOW_ODR_1_ODR_12P5HZ_BW_0_NA = 0x10 , L3GD20H_LOW_ODR_1_ODR_12P5HZ_BW_1_NA = 0x11 , L3GD20H_LOW_ODR_1_ODR_12P5HZ_BW_2_NA = 0x12 , L3GD20H_LOW_ODR_1_ODR_12P5HZ_BW_3_NA = 0x13 ,
  L3GD20H_LOW_ODR_1_ODR_25HZ_BW_0_NA = 0x14 , L3GD20H_LOW_ODR_1_ODR_25HZ_BW_1_NA = 0x15 , L3GD20H_LOW_ODR_1_ODR_25HZ_BW_2_NA = 0x16 , L3GD20H_LOW_ODR_1_ODR_25HZ_BW_3_NA = 0x17 ,
  L3GD20H_LOW_ODR_1_ODR_50HZ_BW_0_16P6HZ = 0x18 , L3GD20H_LOW_ODR_1_ODR_50HZ_BW_1_16P6HZ = 0x19 , L3GD20H_LOW_ODR_1_ODR_50HZ_BW_2_16P6HZ = 0x1A , L3GD20H_LOW_ODR_1_ODR_50HZ_BW_3_16P6HZ = 0x1B
}
 l3gd20h low odr odr bw enumeration definition More...
enum  l3gd20h_data_format_t { L3GD20H_DATA_FORMAT_BIG_ENDIAN = 0x00 , L3GD20H_DATA_FORMAT_LITTLE_ENDIAN = 0x01 }
 l3gd20h data format enumeration definition More...
enum  l3gd20h_full_scale_t { L3GD20H_FULL_SCALE_245_DPS = 0x00 , L3GD20H_FULL_SCALE_500_DPS = 0x01 , L3GD20H_FULL_SCALE_2000_DPS = 0x02 }
 l3gd20h full scale type enumeration definition More...
enum  l3gd20h_self_test_t { L3GD20H_SELF_TEST_NORMAL = 0x00 , L3GD20H_SELF_TEST_0 = 0x01 , L3GD20H_SELF_TEST_1 = 0x03 }
 l3gd20h self test type enumeration definition More...
enum  l3gd20h_spi_wire_t { L3GD20H_SPI_WIRE_4 = 0x00 , L3GD20H_SPI_WIRE_3 = 0x01 }
 l3gd20h spi wire enumeration definition More...
enum  l3gd20h_boot_t { L3GD20H_BOOT_NORMAL = 0x00 , L3GD20H_BOOT_REBOOT = 0x01 }
 l3gd20h boot enumeration definition More...
enum  l3gd20h_selection_t { L3GD20H_SELECTION_LPF1 = 0x00 , L3GD20H_SELECTION_LPF1_HPF = 0x01 , L3GD20H_SELECTION_LPF1_HPF_LPF2 = 0x02 }
 l3gd20h selection enumeration definition More...
enum  l3gd20h_status_t {
  L3GD20H_STATUS_XYZ_OVERRUN = 0x07 , L3GD20H_STATUS_Z_OVERRUN = 0x06 , L3GD20H_STATUS_Y_OVERRUN = 0x05 , L3GD20H_STATUS_X_OVERRUN = 0x04 ,
  L3GD20H_STATUS_XYZ_DATA_READY = 0x03 , L3GD20H_STATUS_Z_DATA_READY = 0x02 , L3GD20H_STATUS_Y_DATA_READY = 0x01 , L3GD20H_STATUS_X_DATA_READY = 0x00
}
 l3gd20h status enumeration definition More...
enum  l3gd20h_interrupt_active_level_t { L3GD20H_INTERRUPT_ACTIVE_LEVEL_HIGH = 0x00 , L3GD20H_INTERRUPT_ACTIVE_LEVEL_LOW = 0x01 }
 l3gd20h interrupt active level enumeration definition More...
enum  l3gd20h_pin_type_t { L3GD20H_PIN_PUSH_PULL = 0x00 , L3GD20H_PIN_OPEN_DRAIN = 0x01 }
 l3gd20h interrupt pin type enumeration definition More...
enum  l3gd20h_counter_mode_t { L3GD20H_COUNTER_MODE_RESET = 0x00 , L3GD20H_COUNTER_MODE_DECREMENT = 0x01 }
 l3gd20h counter mode enumeration definition More...
enum  l3gd20h_interrupt_event_t {
  L3GD20H_INTERRUPT_EVENT_AND_OR_COMBINATION = 0x07 , L3GD20H_INTERRUPT_EVENT_LATCH = 0x06 , L3GD20H_INTERRUPT_EVENT_Z_HIGH_EVENT = 0x05 , L3GD20H_INTERRUPT_EVENT_Z_LOW_EVENT = 0x04 ,
  L3GD20H_INTERRUPT_EVENT_Y_HIGH_EVENT = 0x03 , L3GD20H_INTERRUPT_EVENT_Y_LOW_EVENT = 0x02 , L3GD20H_INTERRUPT_EVENT_X_HIGH_EVENT = 0x01 , L3GD20H_INTERRUPT_EVENT_X_LOW_EVENT = 0x00
}
 l3gd20h interrupt event enumeration definition More...
enum  l3gd20h_interrupt_t {
  L3GD20H_INTERRUPT1_INTERRUPT_ACTIVE = 0x10 | (1 << 6) , L3GD20H_INTERRUPT1_Z_HIGH = 0x10 | (1 << 5) , L3GD20H_INTERRUPT1_Z_LOW = 0x10 | (1 << 4) , L3GD20H_INTERRUPT1_Y_HIGH = 0x10 | (1 << 3) ,
  L3GD20H_INTERRUPT1_Y_LOW = 0x10 | (1 << 2) , L3GD20H_INTERRUPT1_X_HIGH = 0x10 | (1 << 1) , L3GD20H_INTERRUPT1_X_LOW = 0x10 | (1 << 0) , L3GD20H_INTERRUPT2_XYZ_OVERRUN = 0x20 | L3GD20H_STATUS_XYZ_OVERRUN ,
  L3GD20H_INTERRUPT2_Z_OVERRUN = 0x20 | L3GD20H_STATUS_Z_OVERRUN , L3GD20H_INTERRUPT2_Y_OVERRUN = 0x20 | L3GD20H_STATUS_Y_OVERRUN , L3GD20H_INTERRUPT2_X_OVERRUN = 0x20 | L3GD20H_STATUS_X_OVERRUN , L3GD20H_INTERRUPT2_XYZ_DATA_READY = 0x20 | L3GD20H_STATUS_XYZ_DATA_READY ,
  L3GD20H_INTERRUPT2_Z_DATA_READY = 0x20 | L3GD20H_STATUS_Z_DATA_READY , L3GD20H_INTERRUPT2_Y_DATA_READY = 0x20 | L3GD20H_STATUS_Y_DATA_READY , L3GD20H_INTERRUPT2_X_DATA_READY = 0x20 | L3GD20H_STATUS_X_DATA_READY , L3GD20H_INTERRUPT2_FIFO_THRESHOLD = 0x41 ,
  L3GD20H_INTERRUPT2_FIFO_OVERRRUN = 0x42 , L3GD20H_INTERRUPT2_FIFO_EMPTY = 0x43
}
 l3gd20h interrupt enumeration definition More...
enum  l3gd20h_fifo_mode_t {
  L3GD20H_FIFO_MODE_BYPASS = 0x00 , L3GD20H_FIFO_MODE_FIFO = 0x01 , L3GD20H_FIFO_MODE_STREAM = 0x02 , L3GD20H_FIFO_MODE_STREAM_TO_FIFO = 0x03 ,
  L3GD20H_FIFO_MODE_BYPASS_TO_STREAM = 0x04 , L3GD20H_FIFO_MODE_DYNAMIC_STREAM = 0x06 , L3GD20H_FIFO_MODE_BYPASS_TO_FIFO = 0x07
}
 l3gd20h fifo mode enumeration definition More...

Functions

uint8_t l3gd20h_info (l3gd20h_info_t *info)
 get chip's information
uint8_t l3gd20h_set_interface (l3gd20h_handle_t *handle, l3gd20h_interface_t interface)
 set the chip interface
uint8_t l3gd20h_get_interface (l3gd20h_handle_t *handle, l3gd20h_interface_t *interface)
 get the chip interface
uint8_t l3gd20h_set_addr_pin (l3gd20h_handle_t *handle, l3gd20h_address_t addr_pin)
 set the iic address pin
uint8_t l3gd20h_get_addr_pin (l3gd20h_handle_t *handle, l3gd20h_address_t *addr_pin)
 get the iic address pin
uint8_t l3gd20h_init (l3gd20h_handle_t *handle)
 initialize the chip
uint8_t l3gd20h_deinit (l3gd20h_handle_t *handle)
 close the chip
uint8_t l3gd20h_read (l3gd20h_handle_t *handle, int16_t(*raw)[3], float(*dps)[3], uint16_t *len)
 read the data
uint8_t l3gd20h_irq_handler (l3gd20h_handle_t *handle, uint8_t num)
 interrupt handler
uint8_t l3gd20h_read_temperature (l3gd20h_handle_t *handle, int8_t *raw, float *temp)
 read the temperature
uint8_t l3gd20h_set_mode (l3gd20h_handle_t *handle, l3gd20h_mode_t mode)
 set the chip mode
uint8_t l3gd20h_get_mode (l3gd20h_handle_t *handle, l3gd20h_mode_t *mode)
 get the chip mode
uint8_t l3gd20h_set_axis (l3gd20h_handle_t *handle, l3gd20h_axis_t axis, l3gd20h_bool_t enable)
 set the axis
uint8_t l3gd20h_get_axis (l3gd20h_handle_t *handle, l3gd20h_axis_t axis, l3gd20h_bool_t *enable)
 get the axis
uint8_t l3gd20h_set_rate_bandwidth (l3gd20h_handle_t *handle, l3gd20h_lodr_odr_bw_t rate_bandwidth)
 set the rate bandwidth
uint8_t l3gd20h_get_rate_bandwidth (l3gd20h_handle_t *handle, l3gd20h_lodr_odr_bw_t *rate_bandwidth)
 get the rate bandwidth
uint8_t l3gd20h_set_edge_trigger (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the edge trigger
uint8_t l3gd20h_get_edge_trigger (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the edge trigger status
uint8_t l3gd20h_set_level_trigger (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the level trigger
uint8_t l3gd20h_get_level_trigger (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the level trigger status
uint8_t l3gd20h_set_high_pass_filter_mode (l3gd20h_handle_t *handle, l3gd20h_high_pass_filter_mode_t mode)
 set the high pass filter mode
uint8_t l3gd20h_get_high_pass_filter_mode (l3gd20h_handle_t *handle, l3gd20h_high_pass_filter_mode_t *mode)
 get the high pass filter mode
uint8_t l3gd20h_set_high_pass_filter_cut_off_frequency (l3gd20h_handle_t *handle, l3gd20h_high_pass_filter_cut_off_frequency_t frequency)
 set the high pass filter cut off frequency
uint8_t l3gd20h_get_high_pass_filter_cut_off_frequency (l3gd20h_handle_t *handle, l3gd20h_high_pass_filter_cut_off_frequency_t *frequency)
 get the high pass filter cut off frequency
uint8_t l3gd20h_set_block_data_update (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the block data update
uint8_t l3gd20h_get_block_data_update (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the block data update status
uint8_t l3gd20h_set_data_format (l3gd20h_handle_t *handle, l3gd20h_data_format_t data_format)
 set the data format
uint8_t l3gd20h_get_data_format (l3gd20h_handle_t *handle, l3gd20h_data_format_t *data_format)
 get the data format
uint8_t l3gd20h_set_full_scale (l3gd20h_handle_t *handle, l3gd20h_full_scale_t full_scale)
 set the full scale
uint8_t l3gd20h_get_full_scale (l3gd20h_handle_t *handle, l3gd20h_full_scale_t *full_scale)
 get the full scale
uint8_t l3gd20h_set_level_sensitive_latched (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the level sensitive latched
uint8_t l3gd20h_get_level_sensitive_latched (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the level sensitive latched status
uint8_t l3gd20h_set_self_test (l3gd20h_handle_t *handle, l3gd20h_self_test_t self_test)
 set the self test
uint8_t l3gd20h_get_self_test (l3gd20h_handle_t *handle, l3gd20h_self_test_t *self_test)
 get the self test
uint8_t l3gd20h_set_spi_wire (l3gd20h_handle_t *handle, l3gd20h_spi_wire_t spi_wire)
 set the spi wire
uint8_t l3gd20h_get_spi_wire (l3gd20h_handle_t *handle, l3gd20h_spi_wire_t *spi_wire)
 get the spi wire
uint8_t l3gd20h_set_boot (l3gd20h_handle_t *handle, l3gd20h_boot_t boot)
 set the boot
uint8_t l3gd20h_get_boot (l3gd20h_handle_t *handle, l3gd20h_boot_t *boot)
 get the boot
uint8_t l3gd20h_set_high_pass_filter (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable high pass filter
uint8_t l3gd20h_get_high_pass_filter (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get high pass filter status
uint8_t l3gd20h_set_out_selection (l3gd20h_handle_t *handle, l3gd20h_selection_t selection)
 set the out selection
uint8_t l3gd20h_get_out_selection (l3gd20h_handle_t *handle, l3gd20h_selection_t *selection)
 get the out selection
uint8_t l3gd20h_set_high_pass_filter_reference (l3gd20h_handle_t *handle, uint8_t value)
 set the high pass filter reference
uint8_t l3gd20h_get_high_pass_filter_reference (l3gd20h_handle_t *handle, uint8_t *value)
 get the high pass filter reference
uint8_t l3gd20h_get_status (l3gd20h_handle_t *handle, uint8_t *status)
 get the chip status
uint8_t l3gd20h_set_iic (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the iic interface
uint8_t l3gd20h_get_iic (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the iic interface status
uint8_t l3gd20h_soft_reset (l3gd20h_handle_t *handle)
 soft reset the device
uint8_t l3gd20h_set_interrupt1 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the interrupt1
uint8_t l3gd20h_get_interrupt1 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the interrupt1 status
uint8_t l3gd20h_set_boot_on_interrupt1 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable boot on the interrupt1
uint8_t l3gd20h_get_boot_on_interrupt1 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the boot on the interrupt1 status
uint8_t l3gd20h_set_interrupt_active_level (l3gd20h_handle_t *handle, l3gd20h_interrupt_active_level_t level)
 set the interrupt active level
uint8_t l3gd20h_get_interrupt_active_level (l3gd20h_handle_t *handle, l3gd20h_interrupt_active_level_t *level)
 get the interrupt active level
uint8_t l3gd20h_set_interrupt_pin_type (l3gd20h_handle_t *handle, l3gd20h_pin_type_t pin_type)
 set the interrupt pin type
uint8_t l3gd20h_get_interrupt_pin_type (l3gd20h_handle_t *handle, l3gd20h_pin_type_t *pin_type)
 get the interrupt pin type
uint8_t l3gd20h_set_data_ready_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the data ready on interrupt2
uint8_t l3gd20h_get_data_ready_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the data ready on interrupt2 status
uint8_t l3gd20h_set_fifo_threshold_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the fifo threshold on interrupt2
uint8_t l3gd20h_get_fifo_threshold_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the fifo threshold on interrupt2 status
uint8_t l3gd20h_set_fifo_overrun_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the fifo overrun on interrupt2
uint8_t l3gd20h_get_fifo_overrun_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the fifo overrun on interrupt2 status
uint8_t l3gd20h_set_fifo_empty_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the fifo empty on interrupt2
uint8_t l3gd20h_get_fifo_empty_on_interrupt2 (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the fifo empty on interrupt2 status
uint8_t l3gd20h_set_interrupt_selection (l3gd20h_handle_t *handle, l3gd20h_selection_t selection)
 set the interrupt selection
uint8_t l3gd20h_get_interrupt_selection (l3gd20h_handle_t *handle, l3gd20h_selection_t *selection)
 get the interrupt selection
uint8_t l3gd20h_set_interrupt_event (l3gd20h_handle_t *handle, l3gd20h_interrupt_event_t interrupt_event, l3gd20h_bool_t enable)
 set the interrupt event
uint8_t l3gd20h_get_interrupt_event (l3gd20h_handle_t *handle, l3gd20h_interrupt_event_t interrupt_event, l3gd20h_bool_t *enable)
 get the interrupt event
uint8_t l3gd20h_get_interrupt_source (l3gd20h_handle_t *handle, uint8_t *src)
 get the interrupt source
uint8_t l3gd20h_set_x_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t threshold)
 set the x interrupt threshold
uint8_t l3gd20h_get_x_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t *threshold)
 get the x interrupt threshold
uint8_t l3gd20h_set_y_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t threshold)
 set the y interrupt threshold
uint8_t l3gd20h_get_y_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t *threshold)
 get the y interrupt threshold
uint8_t l3gd20h_set_z_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t threshold)
 set the z interrupt threshold
uint8_t l3gd20h_get_z_interrupt_threshold (l3gd20h_handle_t *handle, uint16_t *threshold)
 get the z interrupt threshold
uint8_t l3gd20h_interrupt_threshold_convert_to_register (l3gd20h_handle_t *handle, float dps, uint16_t *reg)
 convert the interrupt threshold real data to the register raw data
uint8_t l3gd20h_interrupt_threshold_convert_to_data (l3gd20h_handle_t *handle, uint16_t reg, float *dps)
 convert the interrupt threshold register raw data to the real data
uint8_t l3gd20h_set_counter_mode (l3gd20h_handle_t *handle, l3gd20h_counter_mode_t counter_mode)
 set the counter mode
uint8_t l3gd20h_get_counter_mode (l3gd20h_handle_t *handle, l3gd20h_counter_mode_t *counter_mode)
 get the counter mode
uint8_t l3gd20h_set_wait (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the wait
uint8_t l3gd20h_get_wait (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the wait status
uint8_t l3gd20h_set_duration (l3gd20h_handle_t *handle, uint8_t duration)
 set the wait duration
uint8_t l3gd20h_get_duration (l3gd20h_handle_t *handle, uint8_t *duration)
 get the wait duration
uint8_t l3gd20h_set_data_ready_active_level (l3gd20h_handle_t *handle, l3gd20h_interrupt_active_level_t level)
 set the data ready active level
uint8_t l3gd20h_get_data_ready_active_level (l3gd20h_handle_t *handle, l3gd20h_interrupt_active_level_t *level)
 get the data ready active level
uint8_t l3gd20h_set_fifo (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable the fifo
uint8_t l3gd20h_get_fifo (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get the fifo status
uint8_t l3gd20h_set_stop_on_fifo_threshold (l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
 enable or disable stop on fifo threshold
uint8_t l3gd20h_get_stop_on_fifo_threshold (l3gd20h_handle_t *handle, l3gd20h_bool_t *enable)
 get stop on fifo threshold status
uint8_t l3gd20h_set_fifo_mode (l3gd20h_handle_t *handle, l3gd20h_fifo_mode_t fifo_mode)
 set the fifo mode
uint8_t l3gd20h_get_fifo_mode (l3gd20h_handle_t *handle, l3gd20h_fifo_mode_t *fifo_mode)
 get the fifo mode
uint8_t l3gd20h_set_fifo_threshold (l3gd20h_handle_t *handle, uint8_t threshold)
 set the fifo threshold
uint8_t l3gd20h_get_fifo_threshold (l3gd20h_handle_t *handle, uint8_t *threshold)
 get the fifo threshold
uint8_t l3gd20h_get_fifo_level (l3gd20h_handle_t *handle, uint8_t *level)
 get the fifo level
uint8_t l3gd20h_set_reg (l3gd20h_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t l3gd20h_get_reg (l3gd20h_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver l3gd20h header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
2.0.0
Author
Shifeng Li
Date
2021-05-29

history

Date Version Author Description
2021/05/29 2.0 Shifeng Li format the code
2020/12/26 1.0 Shifeng Li first upload

Definition in file driver_l3gd20h.h.