mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 03:27:45 +08:00
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
/* USER CODE BEGIN Header */
|
|
/**
|
|
******************************************************************************
|
|
* @file : bsp_adc.h
|
|
* @brief : The header file of bsp_adc.h
|
|
* @author : TuxMonkey
|
|
* @date : 2025/11/22
|
|
* @version : v1.0
|
|
******************************************************************************
|
|
* @attention : Pay attention to config the clock source of the advanced TIM
|
|
******************************************************************************
|
|
*/
|
|
/* USER CODE END Header */
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef BSP_ADC_H
|
|
#define BSP_ADC_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
|
|
|
|
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "adc.h"
|
|
#include <stdint.h>
|
|
|
|
#define BSP_ADC_CHANNEL_COUNT 2U
|
|
#define BSP_ADC_BOARD_VOLTAGE_INDEX 0U
|
|
#define BSP_ADC_JOYSTICK_INDEX 1U
|
|
|
|
extern volatile uint16_t ADC_Voltage_Val[BSP_ADC_CHANNEL_COUNT];
|
|
|
|
/* Externs ---------------------------------------------*/
|
|
void BSP_ADC_Init(void);
|
|
|
|
float USER_ADC_Voltage_Update(void);
|
|
uint16_t BSP_ADC_GetRaw(uint32_t index);
|
|
uint16_t BSP_ADC_GetJoystickRaw(void);
|
|
uint16_t BSP_ADC_GetJoystickRaw12(void);
|
|
float BSP_ADC_GetJoystickVoltage(void);
|
|
#endif //BSP_ADC_H
|