When I read msp432 demo code of comp_e_interrupt_output_toggle_Vref12V.c
the compConfig is
const COMP_E_Config compConfig =
{
COMP_E_VREF, // Positive Input Terminal
COMP_E_INPUT6, // Negative Input Terminal
COMP_E_FILTEROUTPUT_DLYLVL4, // Delay Level 4 Filter
COMP_E_NORMALOUTPUTPOLARITY // Normal Output Polarity
};
and when it goes to MAP_COMP_E_initModule, the code comment is
/* Initialize the Comparator module
* Comparator Instance 1
* Pin CE16 to Positive(+) Terminal
* Reference Voltage to Negative(-) Terminal
* Normal Power Mode
* Output Filter On with max delay
* Non-Inverted Output Polarity
*/
MAP_COMP_E_initModule(COMP_E1_BASE, &compConfig);
the positive and negative is switch compare to the config.Why?
and I look for the TRM it say
CEIES = 0 is rsing edge and CEIES = 1 is falling edge, but when it goes to the driverLib code
void COMP_E_setInterruptEdgeDirection(uint32_t comparator,
uint_fast8_t edgeDirection)
{
ASSERT(edgeDirection <= COMP_E_RISINGEDGE);
// Set the edge direction that will trigger an interrupt
if (COMP_E_RISINGEDGE == edgeDirection)
BITBAND_PERI(COMP_E_CMSIS(comparator)->CTL1, COMP_E_CTL1_IES_OFS) = 1;
else if (COMP_E_FALLINGEDGE == edgeDirection)
BITBAND_PERI(COMP_E_CMSIS(comparator)->CTL1, COMP_E_CTL1_IES_OFS) = 0;
}
the CEIES = 1 is rising edge and CEIES = 0 is falling edge?
Am i wrong or the code is wrong?
