27 lines
427 B
C
27 lines
427 B
C
#pragma once
|
|
|
|
#ifndef LIDAR_H
|
|
#define LIDAR_H
|
|
|
|
#include "stm32g431xx.h"
|
|
|
|
#define USART3_START_BYTE 0x59
|
|
#define USART3_FRAME_SIZE 9
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t header1; // 0x59
|
|
uint8_t header2; // 0x59
|
|
uint8_t distance_l; // cm
|
|
uint8_t distance_h; // cm
|
|
uint8_t strength_l;
|
|
uint8_t strength_h;
|
|
uint8_t temp_l;
|
|
uint8_t temp_h;
|
|
uint8_t checksum;
|
|
} lidar_data_buf;
|
|
|
|
void lidar_init();
|
|
void lidar_update();
|
|
|
|
#endif |