STM8L15x Standard Peripherals Drivers: stm8l15x_tim4.c File Reference

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_tim4.c File Reference

This file provides firmware functions to manage the following functionalities of the TIM4 peripheral:

  • TimeBase management
  • Interrupts, DMA and flags management
  • Clocks management
  • Synchronization management.
More...
#include "stm8l15x_tim4.h"

Go to the source code of this file.

Functions

void TIM4_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM4 peripheral Preload register on ARR.
void TIM4_ClearFlag (TIM4_FLAG_TypeDef TIM4_FLAG)
 Clears the TIM�s pending flags.
void TIM4_ClearITPendingBit (TIM4_IT_TypeDef TIM4_IT)
 Clears the TIM4's interrupt pending bits.
void TIM4_Cmd (FunctionalState NewState)
 Enables or disables the TIM4 peripheral.
void TIM4_DeInit (void)
 Deinitializes the TIM4 peripheral registers to their default reset values.
void TIM4_DMACmd (TIM4_DMASource_TypeDef TIM4_DMASource, FunctionalState NewState)
 Enables or disables the TIMx�s DMA Requests.
void TIM4_GenerateEvent (TIM4_EventSource_TypeDef TIM4_EventSource)
 Configures the TIM4 event to be generated by software.
uint8_t TIM4_GetCounter (void)
 Gets the TIM4 Counter value.
FlagStatus TIM4_GetFlagStatus (TIM4_FLAG_TypeDef TIM4_FLAG)
 Checks whether the specified TIM4 flag is set or not.
ITStatus TIM4_GetITStatus (TIM4_IT_TypeDef TIM4_IT)
 Checks whether the TIM4 interrupt has occurred or not.
TIM4_Prescaler_TypeDef TIM4_GetPrescaler (void)
 Gets the TIM4 Prescaler value.
void TIM4_InternalClockConfig (void)
 Enables the TIM4 internal Clock.
void TIM4_ITConfig (TIM4_IT_TypeDef TIM4_IT, FunctionalState NewState)
 Enables or disables the specified TIM4 interrupts.
void TIM4_PrescalerConfig (TIM4_Prescaler_TypeDef Prescaler, TIM4_PSCReloadMode_TypeDef TIM4_PSCReloadMode)
 Configures the TIM4 Prescaler.
void TIM4_SelectInputTrigger (TIM4_TRGSelection_TypeDef TIM4_InputTriggerSource)
 Selects the TIM4 Input Trigger source.
void TIM4_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM4 Master/Slave Mode.
void TIM4_SelectOnePulseMode (TIM4_OPMode_TypeDef TIM4_OPMode)
 Selects the TIM4�s One Pulse Mode.
void TIM4_SelectOutputTrigger (TIM4_TRGOSource_TypeDef TIM4_TRGOSource)
 Selects the TIM4 Trigger Output Mode.
void TIM4_SelectSlaveMode (TIM4_SlaveMode_TypeDef TIM4_SlaveMode)
 Selects the TIM4 Slave Mode.
void TIM4_SetAutoreload (uint8_t Autoreload)
 Sets the TIM4 Autoreload Register value.
void TIM4_SetCounter (uint8_t Counter)
 Sets the TIM4 Counter Register value.
void TIM4_TimeBaseInit (TIM4_Prescaler_TypeDef TIM4_Prescaler, uint8_t TIM4_Period)
 Initializes the TIM4 Time Base Unit according to the specified parameters.
void TIM4_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM4 Update event.
void TIM4_UpdateRequestConfig (TIM4_UpdateSource_TypeDef TIM4_UpdateSource)
 Selects the TIM4 Update Request Interrupt source.

Detailed Description

This file provides firmware functions to manage the following functionalities of the TIM4 peripheral:

  • TimeBase management
  • Interrupts, DMA and flags management
  • Clocks management
  • Synchronization management.
Author:
MCD Application Team
Version:
V1.5.0
Date:
13-May-2011
  *  
  *          ===================================================================
  *                                 How to use this driver
  *          ===================================================================
  *          This driver provides functions to configure and initialise the TIM4 
  *          peripheral
  *          These functions are split in 4 groups: 
  *   
  *          1. TIM4 TimeBase management: this group includes all needed functions 
  *             to configure the TIM Timebase unit:
  *                   - Set/Get Prescaler
  *                   - Set/Get Autoreload  
  *                   - Select the One Pulse mode
  *                   - Update Request Configuration
  *                   - Update Disable Configuration
  *                   - Auto-Preload Configuration 
  *                   - Enable/Disable the counter
  *                         
  *          2. TIM4 interrupts, DMA and flags management
  *                   - Enable/Disable interrupt sources
  *                   - Get flags status
  *                   - Clear flags/ Pending bits
  *                   - Enable/Disable DMA requests 
  *              
  *          3. TIM4 clocks management: this group includes all needed functions 
  *             to configure the clock controller unit:
  *                   - Select internal clock
  *         
  *          4. TIM4 synchronization management: this group includes all needed 
  *             functions to configure the Synchronization unit:
  *                   - Select Input Trigger  
  *                   - Select Output Trigger  
  *                   - Select Master Slave Mode    
  *      
  *   
  *  
Attention:

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2011 STMicroelectronics

Definition in file stm8l15x_tim4.c.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com