feat: 增加vl53l0x驱动
This commit is contained in:
@@ -62,7 +62,7 @@ extern "C" {
|
||||
/*#define EXINT_MODULE_ENABLED--------------------*/
|
||||
#define FLASH_MODULE_ENABLED
|
||||
#define GPIO_MODULE_ENABLED
|
||||
#define I2C_MODULE_ENABLED
|
||||
/*#define I2C_MODULE_ENABLED----------------------*/
|
||||
#define MISC_MODULE_ENABLED
|
||||
#define PWC_MODULE_ENABLED
|
||||
/*#define SDIO_MODULE_ENABLED---------------------*/
|
||||
|
||||
@@ -71,9 +71,6 @@ extern "C" {
|
||||
/* init gpio function. */
|
||||
void wk_gpio_config(void);
|
||||
|
||||
/* init i2c1 function. */
|
||||
void wk_i2c1_init(void);
|
||||
|
||||
/* init can1 function. */
|
||||
void wk_can1_init(void);
|
||||
|
||||
|
||||
35
project/inc/by_debug.h
Normal file
35
project/inc/by_debug.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef _BY_DEBUG_H__
|
||||
#define _BY_DEBUG_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include "at32f415.h"
|
||||
#include "lwprintf.h"
|
||||
|
||||
#define BY_DEBUG_USART_INDEX (USART2)
|
||||
|
||||
#define BY_DEBUG_LOG_MODE (2) // 0-not log, 1-no debug log, 2-all
|
||||
|
||||
#if (BY_DEBUG_LOG_MODE == 2)
|
||||
#define LOGI(format, ...) lwprintf("[INFO] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGW(format, ...) lwprintf("[WARN] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGE(format, ...) lwprintf("[ERR] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGD(format, ...) lwprintf("[DEBUG] " format "\r\n", ##__VA_ARGS__)
|
||||
#elif (BY_DEBUG_LOG_MODE == 1)
|
||||
#define LOGI(format, ...) lwprintf("[INFO] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGW(format, ...) lwprintf("[WARN] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGE(format, ...) lwprintf("[ERR] " format "\r\n", ##__VA_ARGS__)
|
||||
#define LOGD(format, ...)
|
||||
#elif (BY_DEBUG_LOG_MODE == 0)
|
||||
#define LOGI(format, ...)
|
||||
#define LOGW(format, ...)
|
||||
#define LOGE(format, ...)
|
||||
#define LOGD(format, ...)
|
||||
#endif
|
||||
|
||||
extern void by_debug_init(void);
|
||||
extern void delay_init(void);
|
||||
extern void delay_us(uint32_t nus);
|
||||
extern void delay_ms(uint16_t nms);
|
||||
extern void delay_sec(uint16_t sec);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user