OP运放配置如下:
SYS->GPE_MFP = (SYS->GPE_MFP & ~(SYS_GPE_MFP_PE7MFP_Msk)) | SYS_GPE_MFP_PE7_OP2_P;
SYS->GPE_MFP = (SYS->GPE_MFP & ~(SYS_GPE_MFP_PE6MFP_Msk)) | SYS_GPE_MFP_PE6_OP2_N;
SYS->GPE_MFP = (SYS->GPE_MFP & ~(SYS_GPE_MFP_PE5MFP_Msk)) | SYS_GPE_MFP_PE5_OP2_O;
GPIO_SetMode(PE, BIT7, GPIO_MODE_INPUT);
GPIO_SetMode(PE, BIT6, GPIO_MODE_INPUT);
GPIO_SetMode(PE, BIT5, GPIO_MODE_OUTPUT);
PGA->OP_CTL |= OP2_ENABLE;
|