STM32F0xx Standard Peripherals Firmware Library: COMP_PulseWidthMeasurement

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library
COMP_PulseWidthMeasurement

Functions

static void COMP_Config (void)
 Configures COMP1: DAC channel 1 to COMP1 inverting input and COMP1 output to TIM2 IC4.
static void DAC_Config (void)
 Configures the DAC channel 1 with output buffer enabled.
static void DisplayOnLCD (uint32_t value)
 Display measured pulse width on color LCD.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void NMI_Handler (void)
 This function handles NMI exception.
void PendSV_Handler (void)
 This function handles PendSVC exception.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.
void TIM2_IRQHandler (void)
 This function handles TIM2 global interrupt.
static void TIM_Config (void)
 Configures TIM2 channel 4 in input capture mode.

Variables

__IO uint32_t Capture = 0
__IO uint32_t Capture
uint32_t CaptureCounter = 0
__IO uint32_t DisplayActive = 0
__IO uint32_t DisplayActive
uint16_t IC4Value1 = 0
uint16_t IC4Value2 = 0
__IO uint32_t MeasuredPulse = 0

Function Documentation

static void COMP_Config ( void  ) [static]

Configures COMP1: DAC channel 1 to COMP1 inverting input and COMP1 output to TIM2 IC4.

Parameters:
None
Return values:
None

Definition at line 138 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/main.c.

References GPIO_InitStructure.

Referenced by main().

static void DAC_Config ( void  ) [static]

Configures the DAC channel 1 with output buffer enabled.

Parameters:
None
Return values:
None

Definition at line 108 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/main.c.

References DAC_InitStructure.

Referenced by main().

static void DisplayOnLCD ( uint32_t  value) [static]

Display measured pulse width on color LCD.

Parameters:
None
Return values:
None

Definition at line 226 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/main.c.

Referenced by main().

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 72 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

int main ( void  )

Main program.

Parameters:
None
Return values:
None

< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file

Definition at line 59 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/main.c.

References Capture, COMP_Config(), DAC_Config(), DisplayActive, DisplayOnLCD(), MeasuredPulse, SystemCoreClock, and TIM_Config().

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 63 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

Definition at line 94 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 85 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 103 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

void TIM2_IRQHandler ( void  )

This function handles TIM2 global interrupt.

Parameters:
None
Return values:
None

Definition at line 115 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/stm32f0xx_it.c.

static void TIM_Config ( void  ) [static]

Configures TIM2 channel 4 in input capture mode.

Parameters:
None
Return values:
None

Definition at line 176 of file STM32F0xx_StdPeriph_Examples/COMP/COMP_PulseWidthMeasurement/main.c.

References NVIC_InitStructure, and TIM_TimeBaseStructure.

Referenced by main().


Variable Documentation

__IO uint32_t DisplayActive = 0
__IO uint32_t MeasuredPulse = 0
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32