lpc.h File Reference

Go to the source code of this file.

Enumerations

enum  LPC_Mode_TypeDef { LPC_NORMAL =0, LPC_LOWPOWER }
 Define the mode for Low power comparator. More...
 
enum  LPC_Input_Channel_TypeDef {
  LPC_INPUT_RSVD =0, LPC_INPUT_PB1 =1, LPC_INPUT_PB2 =2, LPC_INPUT_PB3 =3,
  LPC_INPUT_PB4 =4, LPC_INPUT_PB5 =5, LPC_INPUT_PB6 =6, LPC_INPUT_PB7 =7
}
 Define the input channel for Low power comparator. More...
 
enum  LPC_Reference_TypeDef {
  LPC_NORMAL_REF_972MV = 1, LPC_NORMAL_REF_921MV = 2, LPC_NORMAL_REF_870MV = 3, LPC_NORMAL_REF_819MV = 4,
  LPC_NORMAL_REF_PB0 = 5, LPC_NORMAL_REF_PB3 = 6, LPC_LOWPOWER_REF_964MV = 1, LPC_LOWPOWER_REF_913MV = 2,
  LPC_LOWPOWER_REF_862MV = 3, LPC_LOWPOWER_REF_810MV = 4, LPC_LOWPOWER_REF_PB0 = 5, LPC_LOWPOWER_REF_PB3 = 6,
  LPC_AVDD3 = 7
}
 Define the reference voltage for Low power comparator. More...
 
enum  LPC_Scaling_TypeDef { LPC_SCALING_PER25 =0, LPC_SCALING_PER50 =1, LPC_SCALING_PER75 =2, LPC_SCALING_PER100 =3 }
 Define the scaling coefficient for Low power comparator. More...
 

Functions

void lpc_power_down (void)
 This function powers down low power comparator. More...
 
void lpc_power_on (void)
 This function provides power for low power comparator. More...
 
void lpc_set_input_chn (LPC_Input_Channel_TypeDef pin)
 This function selects input channel for low power comparator . More...
 
void lpc_set_input_ref (LPC_Mode_TypeDef, LPC_Reference_TypeDef ref)
 This function selects input reference voltage for low power comparator . More...
 
void lpc_set_scaling_coeff (LPC_Scaling_TypeDef divider)
 This function serves to set scaling_coefficient for low power comparator . More...
 
static unsigned char lpc_get_result (void)
 This function serves to get the comparison results. More...
 

Enumeration Type Documentation

◆ LPC_Mode_TypeDef

Define the mode for Low power comparator.

Enumerator
LPC_NORMAL 
LPC_LOWPOWER 

◆ LPC_Input_Channel_TypeDef

Define the input channel for Low power comparator.

Enumerator
LPC_INPUT_RSVD 
LPC_INPUT_PB1 
LPC_INPUT_PB2 
LPC_INPUT_PB3 
LPC_INPUT_PB4 
LPC_INPUT_PB5 
LPC_INPUT_PB6 
LPC_INPUT_PB7 

◆ LPC_Reference_TypeDef

Define the reference voltage for Low power comparator.

Enumerator
LPC_NORMAL_REF_972MV 
LPC_NORMAL_REF_921MV 
LPC_NORMAL_REF_870MV 
LPC_NORMAL_REF_819MV 
LPC_NORMAL_REF_PB0 
LPC_NORMAL_REF_PB3 
LPC_LOWPOWER_REF_964MV 
LPC_LOWPOWER_REF_913MV 
LPC_LOWPOWER_REF_862MV 
LPC_LOWPOWER_REF_810MV 
LPC_LOWPOWER_REF_PB0 
LPC_LOWPOWER_REF_PB3 
LPC_AVDD3 

◆ LPC_Scaling_TypeDef

Define the scaling coefficient for Low power comparator.

Enumerator
LPC_SCALING_PER25 
LPC_SCALING_PER50 
LPC_SCALING_PER75 
LPC_SCALING_PER100 

Function Documentation

◆ lpc_power_down()

void lpc_power_down ( void  )

This function powers down low power comparator.

Parameters
[in]none
Returns
none

◆ lpc_power_on()

void lpc_power_on ( void  )

This function provides power for low power comparator.

Parameters
[in]none
Returns
none

◆ lpc_set_input_chn()

void lpc_set_input_chn ( LPC_Input_Channel_TypeDef  pin)

This function selects input channel for low power comparator .

Parameters
[in]pin-selectedinput channel.Input derived from external PortB(PB<1>~PB<7>).
Returns
none

◆ lpc_set_input_ref()

void lpc_set_input_ref ( LPC_Mode_TypeDef  ,
LPC_Reference_TypeDef  ref 
)

This function selects input reference voltage for low power comparator .

Parameters
[in]mode- lower power comparator working mode includes normal mode and low power mode.
[in]ref- selected input reference voltage.
Returns
none

◆ lpc_set_scaling_coeff()

void lpc_set_scaling_coeff ( LPC_Scaling_TypeDef  divider)

This function serves to set scaling_coefficient for low power comparator .

Parameters
[in]divider- selected scaling coefficient.(%25,%50,%75,%100)
Returns
none

◆ lpc_get_result()

static unsigned char lpc_get_result ( void  )
inlinestatic

This function serves to get the comparison results.

Parameters
[in]divider- selected scaling coefficient.(%25,%50,%75,%100)
Returns
none