37 lines
980 B
C
37 lines
980 B
C
|
/*
|
||
|
* @Author : stark1898y 1658608470@qq.com
|
||
|
* @Date : 2024-09-13 13:11:09
|
||
|
* @LastEditors : stark1898y 1658608470@qq.com
|
||
|
* @LastEditTime : 2024-09-24 11:21:59
|
||
|
* @FilePath : \JT-DT-YD4N02A_RTT_MRS-4G\bsp\inc\bsp_vin_detection.h
|
||
|
* @Description :
|
||
|
*
|
||
|
* Copyright (c) 2024 by yzy, All Rights Reserved.
|
||
|
*/
|
||
|
#ifndef __BSP_VIN_DETECTION_H__
|
||
|
#define __BSP_VIN_DETECTION_H__
|
||
|
|
||
|
#include "board.h"
|
||
|
|
||
|
#if 0
|
||
|
#define VIN_THREAD_STACK_SIZE (1024)
|
||
|
#define VIN_THREAD_PRIORITY (1)
|
||
|
#define VIN_THREAD_TIMESLICE (5)
|
||
|
#endif
|
||
|
|
||
|
#define VIN_VOLTAGE_RATIO (4.19148936F)
|
||
|
|
||
|
// 不含输入二极管的压降
|
||
|
// (4.7/19.7) * 13V = 3.1V, 3.1/3.3*4096 = 3723
|
||
|
#define VIN_ADC_HIGH_THRESHOLD (uint16_t)3847 // 13V
|
||
|
// (4.7/19.7) * 10V = 2.39V, 2.39/3.3*4096 = 2966
|
||
|
#define VIN_ADC_LOW_THRESHOLD (uint16_t)2966 // 10V
|
||
|
|
||
|
|
||
|
float Get_VIN_Voltage(void);
|
||
|
uint16_t Get_VIN_VoltageInt1000x(void);
|
||
|
|
||
|
int BSP_VIN_Detection_Init(void);
|
||
|
|
||
|
#endif // !__BSP_VIN_DETECTION_H__
|