MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
CMP API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define CMP_Enable(module)
 Enables specified comparator module. More...
 
#define CMP_Disable(module)
 Disables specified comparator module. More...
 
#define CMP_MuxCtrl(module, psel, msel)
 Controls plus and minus multiplexer inputs. More...
 
#define CMP_GetOutput(module)
 Returns the current value of the analog comparator output. More...
 
#define CMP_InstallCallback(ip, callback)
 Installs callback function for CMP0, CMP1 and CMP2 interrupt vector 30. More...
 
#define CMP_Init(module, cfg, psel, msel)
 CMP initialization. More...
 

Macro Definition Documentation

#define CMP_Enable (   module)

This macro enables specified comparator module.

Parameters
moduleCMP0,CMP1,CMP2.
Note
Implemented as an inline macro.
#define CMP_Disable (   module)

This macro disables specified comparator module.

Parameters
moduleCMP0,CMP1,CMP2.
Note
Implemented as an inline macro.
#define CMP_MuxCtrl (   module,
  psel,
  msel 
)

This macro controls plus and minus multiplexer inputs. It determines which analogue signals are interconnected to the plus and minus inputs of the specified comparator module.

Parameters
moduleCMP0,CMP1,CMP2.
pselPlus input mux control select CMP Input Channels.
mselMinus input mux control select CMP Input Channels.
Note
Implemented as an inline macro.
#define CMP_GetOutput (   module)

This macro returns the current value of the analog comparator output.

Parameters
moduleCMP0,CMP1,CMP2.
Returns
true (non-zero) comparator output asserted (logic 1),
false comparator output de-asserted (logic 0).
Note
Implemented as an inline macro.
#define CMP_InstallCallback (   ip,
  callback 
)

This function installs callback function for CMP0, CMP1 and CMP2 interrupt vector 30.

Parameters
ipSelect one of the ARM Cortex-M0+ Interrupt Priority Levels.
callbackPointer to the CMP Callback Function.
Note
Implemented as a function call.
Warning
CMP0, CMP1 and CMP2 interrupt sources are OR'ed into single interrupt vector.
See also
CMP_Init
#define CMP_Init (   module,
  cfg,
  psel,
  msel 
)

This function initializes selected comparator module

Parameters
moduleCMP0,CMP1,CMP2.
cfgSelect one of the CMP Configuration Structures.
pselPlus input mux control select CMP Input Channels.
mselMinus input mux control select CMP Input Channels.
Note
Implemented as a function call.
See also
CMP_InstallCallback