#ifndef __HAL_LKSMCU_CMP_H__
#define __HAL_LKSMCU_CMP_H__
#include "stdint.h"
typedef enum
{
    HAL_CMP_0, ///< CMP模块0
    HAL_CMP_1, ///< CMP模块1
    HAL_CMP_2, ///< CMP模块2
    HAL_CMP_3, ///< CMP模块3
    HAL_CMP_4, ///< CMP模块4
    HAL_CMP_5, ///< CMP模块5
} HAL_CMP_x;

typedef enum
{
    HAL_CMP_CHANNEL_P_0, ///< CMP模块外部正端输入0
    HAL_CMP_CHANNEL_P_1, ///< CMP模块外部正端输入1
    HAL_CMP_CHANNEL_P_2, ///< CMP模块外部正端输入2
    HAL_CMP_CHANNEL_P_3, ///< CMP模块外部正端输入3
    HAL_CMP_CHANNEL_P_4, ///< CMP模块外部正端输入4
    HAL_CMP_CHANNEL_P_5, ///< CMP模块外部正端输入5
} HAL_CMP_CHANNEL_P_x;
typedef enum
{
    HAL_CMP_CHANNEL_N_IN,  ///< CMPN选择为外部负端输入
    HAL_CMP_CHANNEL_N_REF, ///< CMPN选择为内部基准源
    HAL_CMP_CHANNEL_N_DAC, ///< CMPN选择为DAC输出
    HAL_CMP_CHANNEL_N_MID, ///< CMPN选择为反电动势虚拟中心点
} HAL_CMP_CHANNEL_N_x;
// 初始化
void HAL_CMP_Reset(HAL_CMP_x);   // 模块复位
void HAL_CMP_Enable(HAL_CMP_x);  // 模块打开
void HAL_CMP_Disable(HAL_CMP_x); // 模块关闭

void HAL_CMP_SetChannel(HAL_CMP_x, HAL_CMP_CHANNEL_P_x, HAL_CMP_CHANNEL_N_x); // 设置CMP输入信号通道

#endif
