PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
dt.h File Reference
#include "pdl.h"
Include dependency graph for dt.h:

Go to the source code of this file.

Data Structures

struct  stc_dt_channel_config
 Dt channel configuration. More...
 
struct  stc_dt_intern_data
 Datatype for holding internal data needed for DT. More...
 
struct  stc_dt_instance_data
 DT instance data type. More...
 

Macros

#define DT0   (*((volatile stc_dtn_t *) FM4_DTIM_BASE))
 
#define DT_PRE_TIMER_DIV_1   (0x00)
 
#define DT_PRE_TIMER_DIV_16   (0x01)
 
#define DT_PRE_TIMER_DIV_256   (0x02)
 

Typedefs

typedef FM4_DTIM_TypeDef stc_dtn_t
 Redefinition of DT register structure. More...
 
typedef enum en_dt_mode en_dt_mode_t
 Dt mode. More...
 
typedef enum en_dt_prescaler en_dt_prescaler_t
 Dt Prescaler. More...
 
typedef enum en_dt_countersize en_dt_countersize_t
 Dt Counter Size. More...
 
typedef enum en_dt_channel en_dt_channel_t
 Dt channel number. More...
 
typedef struct
stc_dt_channel_config 
stc_dt_channel_config_t
 Dt channel configuration. More...
 
typedef void(* dt_cb_func_ptr_t )(void)
 DtCallback function prototype. More...
 
typedef enum en_dt_instance_index en_dt_instance_index_t
 Enumeration to define an index for each enabled Dual timer instance. More...
 
typedef struct stc_dt_intern_data stc_dt_intern_data_t
 Datatype for holding internal data needed for DT. More...
 
typedef struct stc_dt_instance_data stc_dt_instance_data_t
 DT instance data type. More...
 

Enumerations

enum  en_dt_mode {
  DtFreeRun = 0,
  DtPeriodic = 1,
  DtOneShot = 2
}
 Dt mode. More...
 
enum  en_dt_prescaler {
  DtPrescalerDiv1 = 0,
  DtPrescalerDiv16 = 1,
  DtPrescalerDiv256 = 2
}
 Dt Prescaler. More...
 
enum  en_dt_countersize {
  DtCounterSize16 = 0,
  DtCounterSize32 = 1
}
 Dt Counter Size. More...
 
enum  en_dt_channel {
  DtChannel0 = 0,
  DtChannel1 = 1,
  DtMaxChannels = 2
}
 Dt channel number. More...
 
enum  en_dt_instance_index {
  DtInstanceIndexDt0,
  DtInstanceIndexMax
}
 Enumeration to define an index for each enabled Dual timer instance. More...
 

Functions

void DtIrqHandler (uint8_t u8Ch)
 ISR callback for DT (channel 0 and 1) More...
 
en_result_t Dt_Init (stc_dt_channel_config_t *pstcConfig, uint8_t u8Ch)
 Initialize DT. More...
 
en_result_t Dt_DeInit (uint8_t u8Ch)
 De-Initialize DT. More...
 
en_result_t Dt_EnableCount (uint8_t u8Ch)
 Enable Timer Counter. More...
 
en_result_t Dt_DisableCount (uint8_t u8Ch)
 Disable Timer Counter. More...
 
en_result_t Dt_EnableInt (dt_cb_func_ptr_t pfnIntCallback, uint8_t u8Ch)
 Enable Interrupt. More...
 
en_result_t Dt_DisableInt (uint8_t u8Ch)
 Disable Interrupt. More...
 
boolean_t Dt_GetIntFlag (uint8_t u8Ch)
 Get interrupt status The Function can return the interrupt status (TimerXRIS) More...
 
boolean_t Dt_GetMaskIntFlag (uint8_t u8Ch)
 Get mask interrupt status The Function can return the mask interrupt status (TimerXMIS) More...
 
en_result_t Dt_ClrIntFlag (uint8_t u8Ch)
 Clear interrupt status The Function clears the interrupt status. More...
 
en_result_t Dt_WriteLoadVal (uint32_t u32LoadVal, uint8_t u8Ch)
 Write load value The Function writes the load value to load register. More...
 
en_result_t Dt_WriteBgLoadVal (uint32_t u32BgLoadVal, uint8_t u8Ch)
 Write back-ground load value The Function writes the load value to back-ground load register. More...
 
uint32_t Dt_ReadCurCntVal (uint8_t u8Ch)
 Read current count value The Function reads the value from value register. More...
 

Detailed Description

Headerfile for DT functions

History:

  • 2013-04-01 1.0 NT First version.

Definition in file dt.h.