#ifndef __HAL_LKSMCU_OPA_H__
#define __HAL_LKSMCU_OPA_H__
#include "stdint.h"
#include "hal_lksmcu_adc.h"
typedef enum
{
    HAL_OPA_0,  ///< ADC模块0
    HAL_OPA_1,  ///< ADC模块1
    HAL_OPA_2,  ///< ADC模块2
    HAL_OPA_3,  ///< ADC模块3
    HAL_OPA_4,  ///< ADC模块4
    HAL_OPA_5,  ///< ADC模块5
    HAL_OPA_0B, ///< ADC模块0B
} HAL_OPA_x;

typedef enum
{
    HAL_OPA_GAIN_HIGH,   ///< 高增益
    HAL_OPA_GAIN_MEDIUM, ///< 中等增益
    HAL_OPA_GAIN_LOW,    ///< 低增益
} HAL_OPA_GAIN_x;

// 初始化
void HAL_OPA_Reset(HAL_OPA_x);   // 模块复位
void HAL_OPA_Enable(HAL_OPA_x);  // 模块打开
void HAL_OPA_Disable(HAL_OPA_x); // 模块关闭

void HAL_OPA_SetGain(HAL_OPA_x, HAL_OPA_GAIN_x); // 设置增益

#define HAL_OPA_OPAX_2_ADCCHN(OPAX) ((OPAX) == HAL_OPA_0B ? HAL_ADC_PORT_0 : (HAL_ADC_PORT_x)(OPAX))
#endif
