LibDriver L3GD20H
Loading...
Searching...
No Matches
driver_l3gd20h_basic.c
Go to the documentation of this file.
1
37
39
40static l3gd20h_handle_t gs_handle;
41
52{
53 uint8_t res;
54 uint16_t threshold;
55
56 /* link interface function */
69
70 /* set the interface */
71 res = l3gd20h_set_interface(&gs_handle, interface);
72 if (res != 0)
73 {
74 l3gd20h_interface_debug_print("l3gd20h: set interface failed.\n");
75
76 return 1;
77 }
78
79 /* set the address pin */
80 res = l3gd20h_set_addr_pin(&gs_handle, addr_pin);
81 if (res != 0)
82 {
83 l3gd20h_interface_debug_print("l3gd20h: set addr pin failed.\n");
84
85 return 1;
86 }
87
88 /* init the l3gd20h */
89 res = l3gd20h_init(&gs_handle);
90 if (res != 0)
91 {
92 l3gd20h_interface_debug_print("l3gd20h: init failed.\n");
93
94 return 1;
95 }
96
97 /* set boot */
99 if (res != 0)
100 {
101 l3gd20h_interface_debug_print("l3gd20h: set boot failed.\n");
102 (void)l3gd20h_deinit(&gs_handle);
103
104 return 1;
105 }
106
107 /* set x axis*/
109 if (res != 0)
110 {
111 l3gd20h_interface_debug_print("l3gd20h: set axis failed.\n");
112 (void)l3gd20h_deinit(&gs_handle);
113
114 return 1;
115 }
116
117 /* set y axis*/
119 if (res != 0)
120 {
121 l3gd20h_interface_debug_print("l3gd20h: set axis failed.\n");
122 (void)l3gd20h_deinit(&gs_handle);
123
124 return 1;
125 }
126
127 /* set z axis*/
129 if (res != 0)
130 {
131 l3gd20h_interface_debug_print("l3gd20h: set axis failed.\n");
132 (void)l3gd20h_deinit(&gs_handle);
133
134 return 1;
135 }
136
137 /* set rate bandwidth */
139 if (res != 0)
140 {
141 l3gd20h_interface_debug_print("l3gd20h: set rate bandwidth failed.\n");
142 (void)l3gd20h_deinit(&gs_handle);
143
144 return 1;
145 }
146
147 /* set edge trigger */
149 if (res != 0)
150 {
151 l3gd20h_interface_debug_print("l3gd20h: set edge trigger failed.\n");
152 (void)l3gd20h_deinit(&gs_handle);
153
154 return 1;
155 }
156
157 /* set level trigger */
159 if (res != 0)
160 {
161 l3gd20h_interface_debug_print("l3gd20h: set level trigger failed.\n");
162 (void)l3gd20h_deinit(&gs_handle);
163
164 return 1;
165 }
166
167 /* set latched */
169 if (res != 0)
170 {
171 l3gd20h_interface_debug_print("l3gd20h: set level sensitive latched failed.\n");
172 (void)l3gd20h_deinit(&gs_handle);
173
174 return 1;
175 }
176
177 /* set self test */
179 if (res != 0)
180 {
181 l3gd20h_interface_debug_print("l3gd20h: set self test failed.\n");
182 (void)l3gd20h_deinit(&gs_handle);
183
184 return 1;
185 }
186
187 /* set high pass filter mode */
189 if (res != 0)
190 {
191 l3gd20h_interface_debug_print("l3gd20h: set high pass filter normal mode failed.\n");
192 (void)l3gd20h_deinit(&gs_handle);
193
194 return 1;
195 }
196
197 /* set high pass filter cut off */
199 if (res != 0)
200 {
201 l3gd20h_interface_debug_print("l3gd20h: set high pass filter cut off frequency failed.\n");
202 (void)l3gd20h_deinit(&gs_handle);
203
204 return 1;
205 }
206
207 /* set high pass filter */
209 if (res != 0)
210 {
211 l3gd20h_interface_debug_print("l3gd20h: set high pass filter failed.\n");
212 (void)l3gd20h_deinit(&gs_handle);
213
214 return 1;
215 }
216
217 /* set block data update */
219 if (res != 0)
220 {
221 l3gd20h_interface_debug_print("l3gd20h: set block data update failed.\n");
222 (void)l3gd20h_deinit(&gs_handle);
223
224 return 1;
225 }
226
227 /* set out selection */
229 if (res != 0)
230 {
231 l3gd20h_interface_debug_print("l3gd20h: set out selection failed.\n");
232 (void)l3gd20h_deinit(&gs_handle);
233
234 return 1;
235 }
236
237 /* set interrupt selection */
239 if (res != 0)
240 {
241 l3gd20h_interface_debug_print("l3gd20h: set interrupt selection failed.\n");
242 (void)l3gd20h_deinit(&gs_handle);
243
244 return 1;
245 }
246
247 /* set high pass filter reference */
249 if (res != 0)
250 {
251 l3gd20h_interface_debug_print("l3gd20h: set high pass filter reference failed.\n");
252 (void)l3gd20h_deinit(&gs_handle);
253
254 return 1;
255 }
256
257 /* set bypass fifo mode */
259 if (res != 0)
260 {
261 l3gd20h_interface_debug_print("l3gd20h: set fifo mode failed.\n");
262 (void)l3gd20h_deinit(&gs_handle);
263
264 return 1;
265 }
266
267 /* set interrupt 1*/
269 if (res != 0)
270 {
271 l3gd20h_interface_debug_print("l3gd20h: set interrupt1 failed.\n");
272 (void)l3gd20h_deinit(&gs_handle);
273
274 return 1;
275 }
276
277 /* set boot on interrupt 1*/
279 if (res != 0)
280 {
281 l3gd20h_interface_debug_print("l3gd20h: set boot on interrupt1 failed.\n");
282 (void)l3gd20h_deinit(&gs_handle);
283
284 return 1;
285 }
286
287 /* set active level */
289 if (res != 0)
290 {
291 l3gd20h_interface_debug_print("l3gd20h: set interrupt active level failed.\n");
292 (void)l3gd20h_deinit(&gs_handle);
293
294 return 1;
295 }
296
297 /* set interrupt pin type */
299 if (res != 0)
300 {
301 l3gd20h_interface_debug_print("l3gd20h: set interrupt pin type failed.\n");
302 (void)l3gd20h_deinit(&gs_handle);
303
304 return 1;
305 }
306
307 /* set data ready on interrupt2 */
309 if (res != 0)
310 {
311 l3gd20h_interface_debug_print("l3gd20h: set data ready on interrupt2 failed.\n");
312 (void)l3gd20h_deinit(&gs_handle);
313
314 return 1;
315 }
316
317 /* set fifo threshold on interrupt2 */
319 if (res != 0)
320 {
321 l3gd20h_interface_debug_print("l3gd20h: set fifo threshold on interrupt2 failed.\n");
322 (void)l3gd20h_deinit(&gs_handle);
323
324 return 1;
325 }
326
327 /* set fifo overrun on interrupt2 */
329 if (res != 0)
330 {
331 l3gd20h_interface_debug_print("l3gd20h: set fifo overrun on interrupt2 failed.\n");
332 (void)l3gd20h_deinit(&gs_handle);
333
334 return 1;
335 }
336
337 /* set fifo empty on interrupt2 */
339 if (res != 0)
340 {
341 l3gd20h_interface_debug_print("l3gd20h: set fifo empty on interrupt2 failed.\n");
342 (void)l3gd20h_deinit(&gs_handle);
343
344 return 1;
345 }
346
347 /* set L3GD20H_INTERRUPT_EVENT_AND_OR_COMBINATION */
350 if (res != 0)
351 {
352 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
353 (void)l3gd20h_deinit(&gs_handle);
354
355 return 1;
356 }
357
358 /* set L3GD20H_INTERRUPT_EVENT_LATCH */
361 if (res != 0)
362 {
363 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
364 (void)l3gd20h_deinit(&gs_handle);
365
366 return 1;
367 }
368
369 /* set L3GD20H_INTERRUPT_EVENT_Z_HIGH_EVENT */
372 if (res != 0)
373 {
374 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
375 (void)l3gd20h_deinit(&gs_handle);
376
377 return 1;
378 }
379
380 /* set L3GD20H_INTERRUPT_EVENT_Z_LOW_EVENT */
383 if (res != 0)
384 {
385 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
386 (void)l3gd20h_deinit(&gs_handle);
387
388 return 1;
389 }
390
391 /* set L3GD20H_INTERRUPT_EVENT_Y_HIGH_EVENT */
394 if (res != 0)
395 {
396 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
397 (void)l3gd20h_deinit(&gs_handle);
398
399 return 1;
400 }
401
402 /* set L3GD20H_INTERRUPT_EVENT_Y_LOW_EVENT */
405 if (res != 0)
406 {
407 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
408 (void)l3gd20h_deinit(&gs_handle);
409
410 return 1;
411 }
412
413 /* set L3GD20H_INTERRUPT_EVENT_X_HIGH_EVENT */
416 if (res != 0)
417 {
418 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
419 (void)l3gd20h_deinit(&gs_handle);
420
421 return 1;
422 }
423
424 /* set L3GD20H_INTERRUPT_EVENT_X_LOW_EVENT */
427 if (res != 0)
428 {
429 l3gd20h_interface_debug_print("l3gd20h: set interrupt event failed.\n");
430 (void)l3gd20h_deinit(&gs_handle);
431
432 return 1;
433 }
434
435 /* convert the threshold */
437 (uint16_t *)&threshold);
438 if (res != 0)
439 {
440 l3gd20h_interface_debug_print("l3gd20h: convert to register failed.\n");
441 (void)l3gd20h_deinit(&gs_handle);
442
443 return 1;
444 }
445
446 /* set x interrupt threshold */
447 res = l3gd20h_set_x_interrupt_threshold(&gs_handle, threshold);
448 if (res != 0)
449 {
450 l3gd20h_interface_debug_print("l3gd20h: set x interrupt threshold failed.\n");
451 (void)l3gd20h_deinit(&gs_handle);
452
453 return 1;
454 }
455
456 /* set y interrupt threshold */
457 res = l3gd20h_set_y_interrupt_threshold(&gs_handle, threshold);
458 if (res != 0)
459 {
460 l3gd20h_interface_debug_print("l3gd20h: set y interrupt threshold failed.\n");
461 (void)l3gd20h_deinit(&gs_handle);
462
463 return 1;
464 }
465
466 /* set z interrupt threshold */
467 res = l3gd20h_set_z_interrupt_threshold(&gs_handle, threshold);
468 if (res != 0)
469 {
470 l3gd20h_interface_debug_print("l3gd20h: set z interrupt threshold failed.\n");
471 (void)l3gd20h_deinit(&gs_handle);
472
473 return 1;
474 }
475
476 /* set counter mode */
478 if (res != 0)
479 {
480 l3gd20h_interface_debug_print("l3gd20h: set counter mode failed.\n");
481 (void)l3gd20h_deinit(&gs_handle);
482
483 return 1;
484 }
485
486 /* set wait */
488 if (res != 0)
489 {
490 l3gd20h_interface_debug_print("l3gd20h: set wait failed.\n");
491 (void)l3gd20h_deinit(&gs_handle);
492
493 return 1;
494 }
495
496 /* set duration */
498 if (res != 0)
499 {
500 l3gd20h_interface_debug_print("l3gd20h: set duration failed.\n");
501 (void)l3gd20h_deinit(&gs_handle);
502
503 return 1;
504 }
505
506 /* set data ready active level */
508 if (res != 0)
509 {
510 l3gd20h_interface_debug_print("l3gd20h: set data ready active level failed.\n");
511 (void)l3gd20h_deinit(&gs_handle);
512
513 return 1;
514 }
515
516 /* disable fifo */
517 res = l3gd20h_set_fifo(&gs_handle, L3GD20H_BOOL_FALSE);
518 if (res != 0)
519 {
520 l3gd20h_interface_debug_print("l3gd20h: set fifo failed.\n");
521 (void)l3gd20h_deinit(&gs_handle);
522
523 return 1;
524 }
525
526 /* set stop on fifo threshold */
528 if (res != 0)
529 {
530 l3gd20h_interface_debug_print("l3gd20h: set stop on fifo threshold failed.\n");
531 (void)l3gd20h_deinit(&gs_handle);
532
533 return 1;
534 }
535
536 /* set fifo threshold */
538 if (res != 0)
539 {
540 l3gd20h_interface_debug_print("l3gd20h: set fifo threshold failed.\n");
541 (void)l3gd20h_deinit(&gs_handle);
542
543 return 1;
544 }
545
546 /* set endian */
548 if (res != 0)
549 {
550 l3gd20h_interface_debug_print("l3gd20h: set data format failed.\n");
551 (void)l3gd20h_deinit(&gs_handle);
552
553 return 1;
554 }
555
556 /* set full scale */
558 if (res != 0)
559 {
560 l3gd20h_interface_debug_print("l3gd20h: set full scale failed.\n");
561 (void)l3gd20h_deinit(&gs_handle);
562
563 return 1;
564 }
565
566 /* normal mode */
567 res = l3gd20h_set_mode(&gs_handle, L3GD20H_MODE_NORMAL);
568 if (res != 0)
569 {
570 l3gd20h_interface_debug_print("l3gd20h: set mode failed.\n");
571 (void)l3gd20h_deinit(&gs_handle);
572
573 return 1;
574 }
575
576 /* success return 0 */
577 return 0;
578}
579
580
589{
590 if (l3gd20h_deinit(&gs_handle) != 0)
591 {
592 return 1;
593 }
594 else
595 {
596 return 0;
597 }
598}
599
608uint8_t l3gd20h_basic_read(float dps[3])
609{
610 int16_t raw[1][3];
611 float dps_inner[1][3];
612 uint16_t len;
613 uint8_t res;
614
615 /* read data */
616 len = 1;
617 res = l3gd20h_read(&gs_handle, (int16_t (*)[3])raw, (float (*)[3])(dps_inner), (uint16_t *)&len);
618 if (res != 0)
619 {
620 return 1;
621 }
622 dps[0] = dps_inner[0][0];
623 dps[1] = dps_inner[0][1];
624 dps[2] = dps_inner[0][2];
625
626 /* success return 0 */
627 return 0;
628}
driver l3gd20h basic header file
uint8_t l3gd20h_set_high_pass_filter(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable high pass filter
uint8_t l3gd20h_set_data_format(l3gd20h_handle_t *handle, l3gd20h_data_format_t data_format)
set the data format
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_set_mode(l3gd20h_handle_t *handle, l3gd20h_mode_t mode)
set the chip mode
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_set_rate_bandwidth(l3gd20h_handle_t *handle, l3gd20h_lodr_odr_bw_t rate_bandwidth)
set the rate bandwidth
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_read(l3gd20h_handle_t *handle, int16_t(*raw)[3], float(*dps)[3], uint16_t *len)
read the data
uint8_t l3gd20h_set_out_selection(l3gd20h_handle_t *handle, l3gd20h_selection_t selection)
set the out selection
uint8_t l3gd20h_set_boot(l3gd20h_handle_t *handle, l3gd20h_boot_t boot)
set the boot
uint8_t l3gd20h_set_addr_pin(l3gd20h_handle_t *handle, l3gd20h_address_t addr_pin)
set the iic address pin
l3gd20h_address_t
l3gd20h address enumeration definition
uint8_t l3gd20h_set_interface(l3gd20h_handle_t *handle, l3gd20h_interface_t interface)
set the chip interface
uint8_t l3gd20h_set_high_pass_filter_reference(l3gd20h_handle_t *handle, uint8_t value)
set the high pass filter reference
uint8_t l3gd20h_deinit(l3gd20h_handle_t *handle)
close the chip
uint8_t l3gd20h_set_edge_trigger(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the edge trigger
l3gd20h_interface_t
l3gd20h interface enumeration definition
uint8_t l3gd20h_set_full_scale(l3gd20h_handle_t *handle, l3gd20h_full_scale_t full_scale)
set the full scale
uint8_t l3gd20h_init(l3gd20h_handle_t *handle)
initialize the chip
uint8_t l3gd20h_set_level_trigger(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the level trigger
uint8_t l3gd20h_set_self_test(l3gd20h_handle_t *handle, l3gd20h_self_test_t self_test)
set the self test
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_set_axis(l3gd20h_handle_t *handle, l3gd20h_axis_t axis, l3gd20h_bool_t enable)
set the axis
struct l3gd20h_handle_s l3gd20h_handle_t
l3gd20h handle structure definition
@ L3GD20H_AXIS_X
@ L3GD20H_AXIS_Z
@ L3GD20H_AXIS_Y
@ L3GD20H_MODE_NORMAL
@ L3GD20H_BOOL_FALSE
#define L3GD20H_BASIC_DEFAULT_HIGH_PASS_FILTER_MODE
#define L3GD20H_BASIC_DEFAULT_EDGE_TRIGGER
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_Y_LOW_EVENT
uint8_t l3gd20h_basic_init(l3gd20h_interface_t interface, l3gd20h_address_t addr_pin)
basic example init
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_PIN_TYPE
#define L3GD20H_BASIC_DEFAULT_FIFO_EMPTY_ON_INTERRUPT2
#define L3GD20H_BASIC_DEFAULT_FIFO_OVERRUN_ON_INTERRUPT2
#define L3GD20H_BASIC_DEFAULT_HIGH_PASS_FILTER_CUT_OFF
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_X_LOW_EVENT
#define L3GD20H_BASIC_DEFAULT_INTERRUPT1
#define L3GD20H_BASIC_DEFAULT_COUNTER_MODE
#define L3GD20H_BASIC_DEFAULT_WAIT
#define L3GD20H_BASIC_DEFAULT_OUT_SELECTION
#define L3GD20H_BASIC_DEFAULT_BOOT
l3gd20h basic example default definition
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_THRESHOLD
uint8_t l3gd20h_basic_deinit(void)
basic example deinit
#define L3GD20H_BASIC_DEFAULT_DATA_READY_ON_INTERRUPT2
#define L3GD20H_BASIC_DEFAULT_BOOT_ON_INTERRUPT1
#define L3GD20H_BASIC_DEFAULT_AXIS_X
#define L3GD20H_BASIC_DEFAULT_HIGH_PASS_FILTER_REFERENCE
#define L3GD20H_BASIC_DEFAULT_LEVEL_SENSITIVE_LATCHED
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_Z_LOW_EVENT
#define L3GD20H_BASIC_DEFAULT_AXIS_Y
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_LATCH
uint8_t l3gd20h_basic_read(float dps[3])
basic example read
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_X_HIGH_EVENT
#define L3GD20H_BASIC_DEFAULT_AXIS_Z
#define L3GD20H_BASIC_DEFAULT_SELF_TEST
#define L3GD20H_BASIC_DEFAULT_FIFO_THRESHOLD
#define L3GD20H_BASIC_DEFAULT_FULL_SCALE
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_Z_HIGH_EVENT
#define L3GD20H_BASIC_DEFAULT_STOP_ON_FIFO_THRESHOLD
#define L3GD20H_BASIC_DEFAULT_DATA_FORMAT
#define L3GD20H_BASIC_DEFAULT_BLOCK_DATA_UPDATE
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_ACTIVE_LEVEL
#define L3GD20H_BASIC_DEFAULT_RATE_BANDWIDTH
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_Y_HIGH_EVENT
#define L3GD20H_BASIC_DEFAULT_HIGH_PASS_FILTER
#define L3GD20H_BASIC_DEFAULT_DATA_READY_ACTIVE_LEVEL
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_SELECTION
#define L3GD20H_BASIC_DEFAULT_INTERRUPT_EVENT_AND_OR_COMBINATION
#define L3GD20H_BASIC_DEFAULT_FIFO_THRESHOLD_ON_INTERRUPT2
#define L3GD20H_BASIC_DEFAULT_DURATION
#define L3GD20H_BASIC_DEFAULT_LEVEL_TRIGGER
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_set_fifo_mode(l3gd20h_handle_t *handle, l3gd20h_fifo_mode_t fifo_mode)
set the fifo mode
uint8_t l3gd20h_set_fifo(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the fifo
uint8_t l3gd20h_set_fifo_threshold(l3gd20h_handle_t *handle, uint8_t threshold)
set the fifo threshold
@ L3GD20H_FIFO_MODE_BYPASS
void l3gd20h_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t l3gd20h_interface_iic_deinit(void)
interface iic bus deinit
uint8_t l3gd20h_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
uint8_t l3gd20h_interface_iic_init(void)
interface iic bus init
uint8_t l3gd20h_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t l3gd20h_interface_spi_init(void)
interface spi bus init
uint8_t l3gd20h_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t l3gd20h_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t l3gd20h_interface_spi_deinit(void)
interface spi bus deinit
void l3gd20h_interface_receive_callback(uint8_t type)
interface receive callback
void l3gd20h_interface_delay_ms(uint32_t ms)
interface delay ms
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_set_data_ready_on_interrupt2(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the data ready on interrupt2
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_set_x_interrupt_threshold(l3gd20h_handle_t *handle, uint16_t threshold)
set the x interrupt threshold
uint8_t l3gd20h_set_wait(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the wait
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_set_duration(l3gd20h_handle_t *handle, uint8_t duration)
set the wait duration
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_set_data_ready_active_level(l3gd20h_handle_t *handle, l3gd20h_interrupt_active_level_t level)
set the data ready active level
uint8_t l3gd20h_set_counter_mode(l3gd20h_handle_t *handle, l3gd20h_counter_mode_t counter_mode)
set the counter mode
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_set_fifo_overrun_on_interrupt2(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the fifo overrun on interrupt2
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_set_interrupt_selection(l3gd20h_handle_t *handle, l3gd20h_selection_t selection)
set the interrupt selection
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_set_z_interrupt_threshold(l3gd20h_handle_t *handle, uint16_t threshold)
set the z interrupt threshold
uint8_t l3gd20h_set_interrupt1(l3gd20h_handle_t *handle, l3gd20h_bool_t enable)
enable or disable the interrupt1
uint8_t l3gd20h_set_y_interrupt_threshold(l3gd20h_handle_t *handle, uint16_t threshold)
set the y interrupt threshold
@ L3GD20H_INTERRUPT_EVENT_Z_LOW_EVENT
@ L3GD20H_INTERRUPT_EVENT_Y_HIGH_EVENT
@ L3GD20H_INTERRUPT_EVENT_Y_LOW_EVENT
@ L3GD20H_INTERRUPT_EVENT_AND_OR_COMBINATION
@ L3GD20H_INTERRUPT_EVENT_LATCH
@ L3GD20H_INTERRUPT_EVENT_X_LOW_EVENT
@ L3GD20H_INTERRUPT_EVENT_Z_HIGH_EVENT
@ L3GD20H_INTERRUPT_EVENT_X_HIGH_EVENT