Files
tronone-h7-scaffold/User_Code/bsp/adc/bsp_adc.h

46 lines
1.3 KiB
C
Raw Normal View History

2025-11-20 17:19:43 +08:00
/* 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 */
2025-10-28 14:52:24 +08:00
2025-11-20 17:19:43 +08:00
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef BSP_ADC_H
#define BSP_ADC_H
2025-10-28 14:52:24 +08:00
2025-11-20 17:19:43 +08:00
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
#include "adc.h"
2026-07-20 23:34:13 +08:00
#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];
2025-11-20 17:19:43 +08:00
/* Externs ---------------------------------------------*/
void BSP_ADC_Init(void);
float USER_ADC_Voltage_Update(void);
2026-07-20 23:34:13 +08:00
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);
2025-11-20 17:19:43 +08:00
#endif //BSP_ADC_H