21 lines
590 B
C
21 lines
590 B
C
#ifndef OPTIC_MAG_DRIVER_H
|
||
#define OPTIC_MAG_DRIVER_H
|
||
|
||
#include "main.h"
|
||
#include <stdint.h>
|
||
|
||
#define OPTIC_MAG_FRAME_START 0x5A
|
||
#define OPTIC_MAG_FRAME_END 0xA5
|
||
#define OPTIC_MAG_DATA_BYTES 10
|
||
|
||
// 单位 0.001 nT,忽略末位BCD数字,取前9位
|
||
// 例如 123456789 表示 123456.789 nT
|
||
extern volatile uint32_t g_optic_mag_value;
|
||
extern volatile uint8_t g_optic_mag_fresh;
|
||
|
||
void OpticMag_Init(UART_HandleTypeDef *huart);
|
||
void OpticMag_UART_RxCpltCallback(UART_HandleTypeDef *huart);
|
||
void OpticMag_UART_ErrorCallback(UART_HandleTypeDef *huart);
|
||
|
||
#endif // OPTIC_MAG_DRIVER_H
|