/**
******************************************************************************
* @file stm32g4xx_hal_hrtim.c
* @author MCD Application Team
* @brief TIM HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the High Resolution Timer (HRTIM) peripheral:
* + HRTIM Initialization
* + DLL Calibration Start
* + Timer Time Base Unit Configuration
* + Simple Time Base Start/Stop
* + Simple Time Base Start/Stop Interrupt
* + Simple Time Base Start/Stop DMA Request
* + Simple Output Compare/PWM Channel Configuration
* + Simple Output Compare/PWM Channel Start/Stop Interrupt
* + Simple Output Compare/PWM Channel Start/Stop DMA Request
* + Simple Input Capture Channel Configuration
* + Simple Input Capture Channel Start/Stop Interrupt
* + Simple Input Capture Channel Start/Stop DMA Request
* + Simple One Pulse Channel Configuration
* + Simple One Pulse Channel Start/Stop Interrupt
* + HRTIM External Synchronization Configuration
* + HRTIM Burst Mode Controller Configuration
* + HRTIM Burst Mode Controller Enabling
* + HRTIM External Events Conditioning Configuration
* + HRTIM Faults Conditioning Configuration
* + HRTIM Faults Enabling
* + HRTIM ADC trigger Configuration
* + Waveform Timer Configuration
* + Waveform Event Filtering Configuration
* + Waveform Dead Time Insertion Configuration
* + Waveform Chopper Mode Configuration
* + Waveform Compare Unit Configuration
* + Waveform Capture Unit Configuration
* + Waveform Output Configuration
* + Waveform Counter Start/Stop
* + Waveform Counter Start/Stop Interrupt
* + Waveform Counter Start/Stop DMA Request
* + Waveform Output Enabling
* + Waveform Output Level Set/Get
* + Waveform Output State Get
* + Waveform Burst DMA Operation Configuration
* + Waveform Burst DMA Operation Start
* + Waveform Timer Counter Software Reset
* + Waveform Capture Software Trigger
* + Waveform Burst Mode Controller Software Trigger
* + Waveform Timer Pre-loadable Registers Update Enabling
* + Waveform Timer Pre-loadable Registers Software Update
* + Waveform Timer Delayed Protection Status Get
* + Waveform Timer Burst Status Get
* + Waveform Timer Push-Pull Status Get
* + Peripheral State Get
@verbatim
==============================================================================
##### Simple mode v.s. waveform mode #####
==============================================================================
[..] The HRTIM HAL API is split into 2 categories:
(#)Simple functions: these functions allow for using a HRTIM timer as a
general purpose timer with high resolution capabilities.
HRTIM simple modes are managed through the set of functions named
HAL_HRTIM_Simple<Function>. These functions are similar in name and usage
to the one defined for the TIM peripheral. When a HRTIM timer operates in
simple mode, only a very limited set of HRTIM features are used.
Following simple modes are proposed:
(++)Output compare mode,
(++)PWM output mode,
(++)Input capture mode,
(++)One pulse mode.
(#)Waveform functions: These functions allow taking advantage of the HRTIM
flexibility to produce numerous types of control signal. When a HRTIM timer
operates in waveform mode, all the HRTIM features are accessible without
any restriction. HRTIM waveform modes are managed through the set of
functions named HAL_HRTIM_Waveform<Function>
##### How to use this driver #####
==============================================================================
[..]
(#)Initialize the HRTIM low level resources by implementing the
HAL_HRTIM_MspInit() function:
(##)Enable the HRTIM clock source using __HRTIMx_CLK_ENABLE()
(##)Connect HRTIM pins to MCU I/Os
(+++) Enable the clock for the HRTIM GPIOs using the following
function: __HAL_RCC_GPIOx_CLK_ENABLE()
(+++) Configure these GPIO pins in Alternate Function mode using
HAL_GPIO_Init()
(##)When using DMA to control data transfer (e.g HAL_HRTIM_SimpleBaseStart_DMA())
(+++)Enable the DMAx interface clock using __DMAx_CLK_ENABLE()
(+++)Initialize the DMA handle
(+++)Associate the initialized DMA handle to the appropriate DMA
handle of the HRTIM handle using __HAL_LINKDMA()
(+++)Initialize the DMA channel using HAL_DMA_Init()
(+++)Configure the priority and enable the NVIC for the transfer
complete interrupt on the DMA channel using HAL_NVIC_SetPriority()
and HAL_NVIC_EnableIRQ()
(##)In case of using interrupt mode (e.g HAL_HRTIM_SimpleBaseStart_IT())
(+++)Configure the priority and enable the NVIC for the concerned
HRTIM interrupt using HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ()
(#)Initialize the HRTIM HAL using HAL_HRTIM_Init(). The HRTIM configuration
structure (field of the HRTIM handle) specifies which global interrupt of
whole HRTIM must be enabled (Burst mode period, System fault, Faults).
It also contains the HRTIM external synchronization configuration. HRTIM
can act as a master (generating a synchronization signal) or as a slave
(waiting for a trigger to be synchronized).
(#)Start the high resolution unit using HAL_HRTIM_DLLCalibrationStart(). DLL
calibration is executed periodically and compensate for potential voltage
and temperature drifts. DLL calibration period is specified by the
CalibrationRate argument.
(#)HRTIM timers cannot be used until the high resolution unit is ready. This
can be checked using HAL_HRTIM_PollForDLLCalibration(): this function returns
HAL_OK if DLL calibration is completed or HAL_TIMEOUT if the DLL calibration
is still going on when timeout given as argument expires. DLL calibration
can also be started in interrupt mode using HAL_HRTIM_DLLCalibrationStart_IT().
In that case an interrupt is generated when the DLL calibration is completed.
Note that as DLL calibration is executed on a periodic basis an interrupt
will be generated at the end of every DLL calibration operation
(worst case: one interrupt every 14 micro seconds !).
(#) Configure HRTIM resources shared by all HRTIM timers
(##)Burst Mode Controller:
(+++)HAL_HRTIM_BurstModeConfig(): configures the HRTIM burst mode
controller: operating mode (continuous or one-shot mode), clock
(source, prescaler) , trigger(s), period, idle duration.
(##)External Events Conditioning:
(+++)HAL_HRTIM_EventConfig(): configures the conditioning of an
external event channel: source, polarity, edge-sensitivity.
External event can be used as triggers (timer reset, input
capture, burst mode, ADC triggers, delayed protection)
They can also be used to set or reset timer outputs. Up to
10 event channels are available.
(+++)HAL_HRTIM_EventPrescalerConfig(): configures the
没有合适的资源?快使用搜索试试~ 我知道了~
蓝桥杯嵌入式2020年第十一届第二场省赛真题代码
共365个文件
h:145个
c:99个
o:35个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 108 浏览量
2022-01-31
19:07:06
上传
评论
收藏 16.88MB ZIP 举报
温馨提示
蓝桥杯赛题代码
资源推荐
资源详情
资源评论
收起资源包目录
蓝桥杯嵌入式2020年第十一届第二场省赛真题代码 (365个子文件)
Source.uvguix.19946774807 90KB
Source.uvguix.Administrator 176KB
Source.axf 896KB
stm32g4xx_hal_hrtim.c 392KB
stm32g4xx_hal_tim.c 260KB
stm32g4xx_hal_i2c.c 221KB
stm32g4xx_hal_cryp.c 190KB
stm32g4xx_hal_uart.c 154KB
stm32g4xx_hal_adc.c 147KB
stm32g4xx_hal_spi.c 142KB
stm32g4xx_hal_tim_ex.c 136KB
stm32g4xx_hal_usart.c 125KB
stm32g4xx_hal_smartcard.c 124KB
stm32g4xx_hal_fdcan.c 123KB
stm32g4xx_hal_irda.c 103KB
stm32g4xx_hal_smbus.c 96KB
stm32g4xx_hal_adc_ex.c 94KB
stm32g4xx_hal_qspi.c 92KB
stm32g4xx_hal_fmac.c 90KB
stm32g4xx_hal_sai.c 89KB
stm32g4xx_hal_lptim.c 76KB
stm32g4xx_ll_adc.c 76KB
stm32g4xx_hal_rtc.c 74KB
stm32g4xx_hal_nand.c 72KB
stm32g4xx_hal_rcc_ex.c 63KB
stm32g4xx_hal_rtc_ex.c 63KB
stm32g4xx_hal_i2s.c 62KB
stm32g4xx_hal_dac.c 61KB
stm32g4xx_hal_pcd.c 56KB
stm32g4xx_ll_tim.c 56KB
stm32g4xx_hal_rcc.c 50KB
stm32g4xx_hal_flash_ex.c 49KB
stm32g4xx_hal_nor.c 47KB
stm32g4xx_hal_cordic.c 46KB
stm32g4xx_hal_opamp.c 41KB
stm32g4xx_hal_pwr_ex.c 38KB
stm32g4xx_hal_dac_ex.c 38KB
stm32g4xx_ll_rcc.c 36KB
stm32g4xx_hal_dma.c 35KB
stm32g4xx_hal_comp.c 35KB
stm32g4xx_hal_uart_ex.c 35KB
stm32g4xx_hal_sram.c 34KB
stm32g4xx_ll_rtc.c 32KB
stm32g4xx_hal_opamp_ex.c 30KB
stm32g4xx_ll_fmc.c 30KB
stm32g4xx_ll_utils.c 28KB
stm32g4xx_hal_rng.c 26KB
bsp_lcd.c 26KB
stm32g4xx_hal_pwr.c 25KB
stm32g4xx_hal_flash.c 24KB
stm32g4xx_hal.c 24KB
stm32g4xx_ll_usb.c 23KB
stm32g4xx_ll_comp.c 23KB
stm32g4xx_ll_spi.c 22KB
stm32g4xx_ll_dac.c 21KB
stm32g4xx_hal_cortex.c 21KB
stm32g4xx_hal_gpio.c 19KB
stm32g4xx_ll_usart.c 18KB
stm32g4xx_hal_exti.c 18KB
stm32g4xx_hal_crc.c 17KB
stm32g4xx_hal_smartcard_ex.c 16KB
stm32g4xx_hal_usart_ex.c 16KB
stm32g4xx_ll_dma.c 16KB
stm32g4xx_hal_wwdg.c 15KB
stm32g4xx_hal_cryp_ex.c 12KB
bsp_tim.c 12KB
stm32g4xx_ll_lpuart.c 12KB
stm32g4xx_ll_exti.c 11KB
system_stm32g4xx.c 11KB
system_stm32g4xx.c 11KB
stm32g4xx_hal_i2c_ex.c 11KB
stm32g4xx_hal_dma_ex.c 11KB
stm32g4xx_hal_iwdg.c 11KB
stm32g4xx_ll_gpio.c 10KB
stm32g4xx_ll_opamp.c 10KB
stm32g4xx_hal_pcd_ex.c 9KB
stm32g4xx_ll_lptim.c 9KB
stm32g4xx_ll_i2c.c 8KB
stm32g4xx_hal_flash_ramfunc.c 8KB
stm32g4xx_hal_crc_ex.c 8KB
main.c 7KB
stm32g4xx_it.c 7KB
stm32g4xx_hal_timebase_tim_template.c 6KB
stm32g4xx_hal_smbus_ex.c 6KB
bsp_i2c.c 6KB
stm32g4xx_ll_ucpd.c 5KB
bsp_adc.c 5KB
stm32g4xx_hal_sai_ex.c 4KB
stm32g4xx_ll_rng.c 4KB
stm32g4xx_ll_fmac.c 3KB
stm32g4xx_hal_spi_ex.c 3KB
bsp_key_led.c 3KB
stm32g4xx_hal_msp_template.c 3KB
stm32g4xx_ll_cordic.c 3KB
stm32g4xx_ll_crc.c 3KB
stm32g4xx_hal_msp.c 2KB
stm32g4xx_ll_hrtim.c 2KB
bsp_rcc.c 2KB
stm32g4xx_ll_pwr.c 2KB
stm32g4xx_ll_crs.c 2KB
共 365 条
- 1
- 2
- 3
- 4
资源评论
各个月份
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功