LibDriver HMC5883L
Loading...
Searching...
No Matches
driver_hmc5883l_register_test.c
Go to the documentation of this file.
1
37
39
40static hmc5883l_handle_t gs_handle;
41
50{
51 uint8_t res;
52 hmc5883l_info_t info;
53 hmc5883l_average_sample_t average_sample;
55 hmc5883l_mode_t mode;
56 hmc5883l_gain_t gain;
57
58 /* link interface function */
66
67 /* get hmc5883l info */
68 res = hmc5883l_info(&info);
69 if (res != 0)
70 {
71 hmc5883l_interface_debug_print("hmc5883l: get info failed.\n");
72
73 return 1;
74 }
75 else
76 {
77 /* print chip information */
78 hmc5883l_interface_debug_print("hmc5883l: chip is %s.\n", info.chip_name);
79 hmc5883l_interface_debug_print("hmc5883l: manufacturer is %s.\n", info.manufacturer_name);
80 hmc5883l_interface_debug_print("hmc5883l: interface is %s.\n", info.interface);
81 hmc5883l_interface_debug_print("hmc5883l: driver version is %d.%d.\n", info.driver_version / 1000, (info.driver_version % 1000) / 100);
82 hmc5883l_interface_debug_print("hmc5883l: min supply voltage is %0.1fV.\n", info.supply_voltage_min_v);
83 hmc5883l_interface_debug_print("hmc5883l: max supply voltage is %0.1fV.\n", info.supply_voltage_max_v);
84 hmc5883l_interface_debug_print("hmc5883l: max current is %0.2fmA.\n", info.max_current_ma);
85 hmc5883l_interface_debug_print("hmc5883l: max temperature is %0.1fC.\n", info.temperature_max);
86 hmc5883l_interface_debug_print("hmc5883l: min temperature is %0.1fC.\n", info.temperature_min);
87 }
88
89 /* hmc5883l init */
90 res = hmc5883l_init(&gs_handle);
91 if (res != 0)
92 {
93 hmc5883l_interface_debug_print("hmc5883l: init failed.\n");
94
95 return 1;
96 }
97
98 /* start register test */
99 hmc5883l_interface_debug_print("hmc5883l: start register test.\n");
100
101 /* hmc5883l_set_average_sample/hmc5883l_get_average_sample test */
102 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_set_average_sample/hmc5883l_get_average_sample test.\n");
103
104 /* set AVERAGE_SAMPLE_1 */
106 if (res != 0)
107 {
108 hmc5883l_interface_debug_print("hmc5883l: set average sample failed.\n");
109 (void)hmc5883l_deinit(&gs_handle);
110
111 return 1;
112 }
113 hmc5883l_interface_debug_print("hmc5883l: set average sample 1.\n");
114 res = hmc5883l_get_average_sample(&gs_handle, &average_sample);
115 if (res != 0)
116 {
117 hmc5883l_interface_debug_print("hmc5883l: get average sample failed.\n");
118 (void)hmc5883l_deinit(&gs_handle);
119
120 return 1;
121 }
122 hmc5883l_interface_debug_print("hmc5883l: check average sample %s.\n", average_sample==HMC5883L_AVERAGE_SAMPLE_1?"ok":"error");
123
124 /* set AVERAGE_SAMPLE_2 */
126 if (res != 0)
127 {
128 hmc5883l_interface_debug_print("hmc5883l: set average sample failed.\n");
129 (void)hmc5883l_deinit(&gs_handle);
130
131 return 1;
132 }
133 hmc5883l_interface_debug_print("hmc5883l: set average sample 2.\n");
134 res = hmc5883l_get_average_sample(&gs_handle, &average_sample);
135 if (res != 0)
136 {
137 hmc5883l_interface_debug_print("hmc5883l: get average sample failed.\n");
138 (void)hmc5883l_deinit(&gs_handle);
139
140 return 1;
141 }
142 hmc5883l_interface_debug_print("hmc5883l: check average sample %s.\n", average_sample==HMC5883L_AVERAGE_SAMPLE_2?"ok":"error");
143
144 /* set AVERAGE_SAMPLE_4 */
146 if (res != 0)
147 {
148 hmc5883l_interface_debug_print("hmc5883l: set average sample failed.\n");
149 (void)hmc5883l_deinit(&gs_handle);
150
151 return 1;
152 }
153 hmc5883l_interface_debug_print("hmc5883l: set average sample 4.\n");
154 res = hmc5883l_get_average_sample(&gs_handle, &average_sample);
155 if (res != 0)
156 {
157 hmc5883l_interface_debug_print("hmc5883l: get average sample failed.\n");
158 (void)hmc5883l_deinit(&gs_handle);
159
160 return 1;
161 }
162 hmc5883l_interface_debug_print("hmc5883l: check average sample %s.\n", average_sample==HMC5883L_AVERAGE_SAMPLE_4?"ok":"error");
163
164 /* set AVERAGE_SAMPLE_8 */
166 if (res != 0)
167 {
168 hmc5883l_interface_debug_print("hmc5883l: set average sample failed.\n");
169 (void)hmc5883l_deinit(&gs_handle);
170
171 return 1;
172 }
173 hmc5883l_interface_debug_print("hmc5883l: set average sample 8.\n");
174 res = hmc5883l_get_average_sample(&gs_handle, &average_sample);
175 if (res != 0)
176 {
177 hmc5883l_interface_debug_print("hmc5883l: get average sample failed.\n");
178 (void)hmc5883l_deinit(&gs_handle);
179
180 return 1;
181 }
182 hmc5883l_interface_debug_print("hmc5883l: check average sample %s.\n", average_sample==HMC5883L_AVERAGE_SAMPLE_8?"ok":"error");
183
184 /* hmc5883l_set_data_output_rate/hmc5883l_get_data_output_rate test */
185 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_set_data_output_rate/hmc5883l_get_data_output_rate test.\n");
186
187 /* set DATA_OUTPUT_RATE_0P75 */
189 if (res != 0)
190 {
191 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
192 (void)hmc5883l_deinit(&gs_handle);
193
194 return 1;
195 }
196 hmc5883l_interface_debug_print("hmc5883l: set data output rate 0.75.\n");
197 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
198 if (res != 0)
199 {
200 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
201 (void)hmc5883l_deinit(&gs_handle);
202
203 return 1;
204 }
205 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_0P75?"ok":"error");
206
207 /* set DATA_OUTPUT_RATE_1P5 */
209 if (res != 0)
210 {
211 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
212 (void)hmc5883l_deinit(&gs_handle);
213
214 return 1;
215 }
216 hmc5883l_interface_debug_print("hmc5883l: set data output rate 1.5.\n");
217 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
218 if (res != 0)
219 {
220 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
221 (void)hmc5883l_deinit(&gs_handle);
222
223 return 1;
224 }
225 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_1P5?"ok":"error");
226
227 /* set DATA_OUTPUT_RATE_3 */
229 if (res != 0)
230 {
231 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
232 (void)hmc5883l_deinit(&gs_handle);
233
234 return 1;
235 }
236 hmc5883l_interface_debug_print("hmc5883l: set data output rate 3.\n");
237 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
238 if (res != 0)
239 {
240 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
241 (void)hmc5883l_deinit(&gs_handle);
242
243 return 1;
244 }
245 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_3?"ok":"error");
246
247 /* set DATA_OUTPUT_RATE_7.5 */
249 if (res != 0)
250 {
251 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
252 (void)hmc5883l_deinit(&gs_handle);
253
254 return 1;
255 }
256 hmc5883l_interface_debug_print("hmc5883l: set data output rate 7.5.\n");
257 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
258 if (res != 0)
259 {
260 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
261 (void)hmc5883l_deinit(&gs_handle);
262
263 return 1;
264 }
265 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_7P5?"ok":"error");
266
267 /* set DATA_OUTPUT_RATE_15 */
269 if (res != 0)
270 {
271 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
272 (void)hmc5883l_deinit(&gs_handle);
273
274 return 1;
275 }
276 hmc5883l_interface_debug_print("hmc5883l: set data output rate 15.\n");
277 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
278 if (res != 0)
279 {
280 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
281 (void)hmc5883l_deinit(&gs_handle);
282
283 return 1;
284 }
285 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_15?"ok":"error");
286
287 /* set DATA_OUTPUT_RATE_30 */
289 if (res != 0)
290 {
291 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
292 (void)hmc5883l_deinit(&gs_handle);
293
294 return 1;
295 }
296 hmc5883l_interface_debug_print("hmc5883l: set data output rate 30.\n");
297 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
298 if (res != 0)
299 {
300 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
301 (void)hmc5883l_deinit(&gs_handle);
302
303 return 1;
304 }
305 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_30?"ok":"error");
306
307 /* set DATA_OUTPUT_RATE_75 */
309 if (res != 0)
310 {
311 hmc5883l_interface_debug_print("hmc5883l: set data output rate failed.\n");
312 (void)hmc5883l_deinit(&gs_handle);
313
314 return 1;
315 }
316 hmc5883l_interface_debug_print("hmc5883l: set data output rate 75.\n");
317 res = hmc5883l_get_data_output_rate(&gs_handle, &data_rate);
318 if (res != 0)
319 {
320 hmc5883l_interface_debug_print("hmc5883l: get data output rate failed.\n");
321 (void)hmc5883l_deinit(&gs_handle);
322
323 return 1;
324 }
325 hmc5883l_interface_debug_print("hmc5883l: check data output rate %s.\n", data_rate==HMC5883L_DATA_OUTPUT_RATE_75?"ok":"error");
326
327 /* hmc5883l_set_mode/hmc5883l_get_mode test */
328 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_set_mode/hmc5883l_get_mode test.\n");
329
330 /* set NORMAL */
331 res = hmc5883l_set_mode(&gs_handle, HMC5883L_MODE_NORMAL);
332 if (res != 0)
333 {
334 hmc5883l_interface_debug_print("hmc5883l: set mode failed.\n");
335 (void)hmc5883l_deinit(&gs_handle);
336
337 return 1;
338 }
339 hmc5883l_interface_debug_print("hmc5883l: set mode normal.\n");
340 res = hmc5883l_get_mode(&gs_handle, &mode);
341 if (res != 0)
342 {
343 hmc5883l_interface_debug_print("hmc5883l: get mode failed.\n");
344 (void)hmc5883l_deinit(&gs_handle);
345
346 return 1;
347 }
348 hmc5883l_interface_debug_print("hmc5883l: check mode %s.\n", mode==HMC5883L_MODE_NORMAL?"ok":"error");
349
350 /* set POSITIVE_BIAS */
352 if (res != 0)
353 {
354 hmc5883l_interface_debug_print("hmc5883l: set mode failed.\n");
355 (void)hmc5883l_deinit(&gs_handle);
356
357 return 1;
358 }
359 hmc5883l_interface_debug_print("hmc5883l: set mode positive bias.\n");
360 res = hmc5883l_get_mode(&gs_handle, &mode);
361 if (res != 0)
362 {
363 hmc5883l_interface_debug_print("hmc5883l: get mode failed.\n");
364 (void)hmc5883l_deinit(&gs_handle);
365
366 return 1;
367 }
368 hmc5883l_interface_debug_print("hmc5883l: check mode %s.\n", mode==HMC5883L_MODE_POSITIVE_BIAS?"ok":"error");
369
370 /* set NEGATIVE_BIAS */
372 if (res != 0)
373 {
374 hmc5883l_interface_debug_print("hmc5883l: set mode failed.\n");
375 (void)hmc5883l_deinit(&gs_handle);
376
377 return 1;
378 }
379 hmc5883l_interface_debug_print("hmc5883l: set mode negative bias.\n");
380 res = hmc5883l_get_mode(&gs_handle, &mode);
381 if (res != 0)
382 {
383 hmc5883l_interface_debug_print("hmc5883l: get mode failed.\n");
384 (void)hmc5883l_deinit(&gs_handle);
385
386 return 1;
387 }
388 hmc5883l_interface_debug_print("hmc5883l: check mode %s.\n", mode==HMC5883L_MODE_NEGATIVE_BIAS?"ok":"error");
389
390 /* hmc5883l_set_gain/hmc5883l_get_gain test */
391 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_set_gain/hmc5883l_get_gain test.\n");
392
393 /* set GAIN_1370 */
394 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_1370);
395 if (res != 0)
396 {
397 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
398 (void)hmc5883l_deinit(&gs_handle);
399
400 return 1;
401 }
402 hmc5883l_interface_debug_print("hmc5883l: set gain 1370.\n");
403 res = hmc5883l_get_gain(&gs_handle, &gain);
404 if (res != 0)
405 {
406 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
407 (void)hmc5883l_deinit(&gs_handle);
408
409 return 1;
410 }
411 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_1370?"ok":"error");
412
413 /* set GAIN_1090 */
414 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_1090);
415 if (res != 0)
416 {
417 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
418 (void)hmc5883l_deinit(&gs_handle);
419
420 return 1;
421 }
422 hmc5883l_interface_debug_print("hmc5883l: set gain 1090.\n");
423 res = hmc5883l_get_gain(&gs_handle, &gain);
424 if (res != 0)
425 {
426 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
427 (void)hmc5883l_deinit(&gs_handle);
428
429 return 1;
430 }
431 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_1090?"ok":"error");
432
433 /* set GAIN_820 */
434 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_820);
435 if (res != 0)
436 {
437 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
438 (void)hmc5883l_deinit(&gs_handle);
439
440 return 1;
441 }
442 hmc5883l_interface_debug_print("hmc5883l: set gain 820.\n");
443 res = hmc5883l_get_gain(&gs_handle, &gain);
444 if (res != 0)
445 {
446 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
447 (void)hmc5883l_deinit(&gs_handle);
448
449 return 1;
450 }
451 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_820?"ok":"error");
452
453 /* set GAIN_660 */
454 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_660);
455 if (res != 0)
456 {
457 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
458 (void)hmc5883l_deinit(&gs_handle);
459
460 return 1;
461 }
462 hmc5883l_interface_debug_print("hmc5883l: set gain 660.\n");
463 res = hmc5883l_get_gain(&gs_handle, &gain);
464 if (res != 0)
465 {
466 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
467 (void)hmc5883l_deinit(&gs_handle);
468
469 return 1;
470 }
471 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_660?"ok":"error");
472
473 /* set GAIN_440 */
474 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_440);
475 if (res != 0)
476 {
477 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
478 (void)hmc5883l_deinit(&gs_handle);
479
480 return 1;
481 }
482 hmc5883l_interface_debug_print("hmc5883l: set gain 440.\n");
483 res = hmc5883l_get_gain(&gs_handle, &gain);
484 if (res != 0)
485 {
486 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
487 (void)hmc5883l_deinit(&gs_handle);
488
489 return 1;
490 }
491 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_440?"ok":"error");
492
493 /* set GAIN_390 */
494 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_390);
495 if (res != 0)
496 {
497 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
498 (void)hmc5883l_deinit(&gs_handle);
499
500 return 1;
501 }
502 hmc5883l_interface_debug_print("hmc5883l: set gain 390.\n");
503 res = hmc5883l_get_gain(&gs_handle, &gain);
504 if (res != 0)
505 {
506 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
507 (void)hmc5883l_deinit(&gs_handle);
508
509 return 1;
510 }
511 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_390?"ok":"error");
512
513 /* set GAIN_330 */
514 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_330);
515 if (res != 0)
516 {
517 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
518 (void)hmc5883l_deinit(&gs_handle);
519
520 return 1;
521 }
522 hmc5883l_interface_debug_print("hmc5883l: set gain 330.\n");
523 res = hmc5883l_get_gain(&gs_handle, &gain);
524 if (res != 0)
525 {
526 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
527 (void)hmc5883l_deinit(&gs_handle);
528
529 return 1;
530 }
531 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_330?"ok":"error");
532
533 /* set GAIN_330 */
534 res = hmc5883l_set_gain(&gs_handle, HMC5883L_GAIN_230);
535 if (res != 0)
536 {
537 hmc5883l_interface_debug_print("hmc5883l: set gain failed.\n");
538 (void)hmc5883l_deinit(&gs_handle);
539
540 return 1;
541 }
542 hmc5883l_interface_debug_print("hmc5883l: set gain 230.\n");
543 res = hmc5883l_get_gain(&gs_handle, &gain);
544 if (res != 0)
545 {
546 hmc5883l_interface_debug_print("hmc5883l: get gain failed.\n");
547 (void)hmc5883l_deinit(&gs_handle);
548
549 return 1;
550 }
551 hmc5883l_interface_debug_print("hmc5883l: check gain %s.\n", gain==HMC5883L_GAIN_230?"ok":"error");
552
553 /* hmc5883l_enable_high_speed_iic */
554 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_enable_high_speed_iic.\n");
555 res = hmc5883l_enable_high_speed_iic(&gs_handle);
556 if (res != 0)
557 {
558 hmc5883l_interface_debug_print("hmc5883l: enable high speed iic failed.\n");
559 (void)hmc5883l_deinit(&gs_handle);
560
561 return 1;
562 }
563 hmc5883l_interface_debug_print("hmc5883l: check enable high speed iic %s.\n", res==0?"ok":"error");
564
565 /* hmc5883l_disable_high_speed_iic */
566 hmc5883l_interface_debug_print("hmc5883l: hmc5883l_disable_high_speed_iic.\n");
567 res = hmc5883l_disable_high_speed_iic(&gs_handle);
568 if (res != 0)
569 {
570 hmc5883l_interface_debug_print("hmc5883l: disable high speed iic failed.\n");
571 (void)hmc5883l_deinit(&gs_handle);
572
573 return 1;
574 }
575 hmc5883l_interface_debug_print("hmc5883l: check disable high speed iic %s.\n", res==0?"ok":"error");
576
577 /* finish register test */
578 hmc5883l_interface_debug_print("hmc5883l: finish register test.\n");
579 (void)hmc5883l_deinit(&gs_handle);
580
581 return 0;
582}
driver hmc5883l register test header file
uint8_t hmc5883l_set_mode(hmc5883l_handle_t *handle, hmc5883l_mode_t mode)
set the chip mode
hmc5883l_average_sample_t
hmc5883l average sample enumeration definition
hmc5883l_mode_t
hmc5883l mode enumeration definition
uint8_t hmc5883l_disable_high_speed_iic(hmc5883l_handle_t *handle)
disable the high speed iic
uint8_t hmc5883l_get_mode(hmc5883l_handle_t *handle, hmc5883l_mode_t *mode)
get the chip mode
uint8_t hmc5883l_set_gain(hmc5883l_handle_t *handle, hmc5883l_gain_t gain)
set the chip gain
uint8_t hmc5883l_set_average_sample(hmc5883l_handle_t *handle, hmc5883l_average_sample_t average_sample)
set the average sample rate
uint8_t hmc5883l_init(hmc5883l_handle_t *handle)
initialize the chip
uint8_t hmc5883l_set_data_output_rate(hmc5883l_handle_t *handle, hmc5883l_data_output_rate_t data_rate)
set the data output rate
uint8_t hmc5883l_info(hmc5883l_info_t *info)
get chip's information
uint8_t hmc5883l_deinit(hmc5883l_handle_t *handle)
close the chip
struct hmc5883l_handle_s hmc5883l_handle_t
hmc5883l handle structure definition
struct hmc5883l_info_s hmc5883l_info_t
hmc5883l information structure definition
hmc5883l_gain_t
hmc5883l gain enumeration definition
uint8_t hmc5883l_get_gain(hmc5883l_handle_t *handle, hmc5883l_gain_t *gain)
get the chip gain
hmc5883l_data_output_rate_t
hmc5883l data output rate enumeration definition
uint8_t hmc5883l_get_average_sample(hmc5883l_handle_t *handle, hmc5883l_average_sample_t *average_sample)
get the average sample rate
uint8_t hmc5883l_get_data_output_rate(hmc5883l_handle_t *handle, hmc5883l_data_output_rate_t *data_rate)
get the data output rate
uint8_t hmc5883l_enable_high_speed_iic(hmc5883l_handle_t *handle)
enable the high speed iic
@ HMC5883L_AVERAGE_SAMPLE_2
@ HMC5883L_AVERAGE_SAMPLE_1
@ HMC5883L_AVERAGE_SAMPLE_8
@ HMC5883L_AVERAGE_SAMPLE_4
@ HMC5883L_MODE_NEGATIVE_BIAS
@ HMC5883L_MODE_NORMAL
@ HMC5883L_MODE_POSITIVE_BIAS
@ HMC5883L_GAIN_390
@ HMC5883L_GAIN_330
@ HMC5883L_GAIN_1090
@ HMC5883L_GAIN_1370
@ HMC5883L_GAIN_820
@ HMC5883L_GAIN_230
@ HMC5883L_GAIN_440
@ HMC5883L_GAIN_660
@ HMC5883L_DATA_OUTPUT_RATE_15
@ HMC5883L_DATA_OUTPUT_RATE_0P75
@ HMC5883L_DATA_OUTPUT_RATE_1P5
@ HMC5883L_DATA_OUTPUT_RATE_3
@ HMC5883L_DATA_OUTPUT_RATE_30
@ HMC5883L_DATA_OUTPUT_RATE_75
@ HMC5883L_DATA_OUTPUT_RATE_7P5
uint8_t hmc5883l_interface_iic_deinit(void)
interface iic bus deinit
uint8_t hmc5883l_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void hmc5883l_interface_debug_print(const char *const fmt,...)
interface print format data
void hmc5883l_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t hmc5883l_interface_iic_init(void)
interface iic bus init
uint8_t hmc5883l_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t hmc5883l_register_test(void)
register test
char manufacturer_name[32]