SLAA705A July 2016 – November 2019 MSP430FR2310 , MSP430FR2311
//Enable op amp functions on external pins
GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_P1,
GPIO_PIN2 | GPIO_PIN3 | GPIO_PIN4, GPIO_TERNARY_MODULE_FUNCTION);
//Select external pins for both positive and negative inputs
SAC_OA_init(SAC0_BASE, SAC_OA_POSITIVE_INPUT_SOURCE_EXTERNAL, SAC_OA_NEGATIVE_INPUT_SOURCE_EXTERNAL);
//Select low speed and low power mode
SAC_OA_selectPowerMode(SAC0_BASE, SAC_OA_POWER_MODE_LOW_SPEED_LOW_POWER);
// Enable OA
SAC_OA_enable(SAC0_BASE);
// Enable SAC
SAC_enable(SAC0_BASE);