| PDL for FM0+ Version1.0 Peripheral Driverl Library for FM0+

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions
C:/pdl_v10/library/driver/mft/mft_adcmp.h File Reference
`#include "mcu.h"`
`#include "pdl_user.h"`
Include dependency graph for mft_adcmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | stc_mft_adcmp_config
| Define Mft_adcmp configure parameters. More...
struct | stc_mft_adcmp_func
| Define Mft_adcmp functions. More...
struct | stc_mft_adcmp_fm3_config
| Define Mft_adcmp compatible fm3 configure parameters. More...
## Defines
#define | MFT_ADCMP_CH0 0
#define | MFT_ADCMP_CH1 1
#define | MFT_ADCMP_CH2 2
#define | MFT_ADCMP_CH3 3
#define | MFT_ADCMP_CH4 4
#define | MFT_ADCMP_CH5 5
#define | MFT_ADCMP_CH10 0
#define | MFT_ADCMP_CH32 1
#define | MFT_ADCMP_CH54 2
#define | MFT_ADCMP_CH_MAX 5
#define | MFT_ADCMP_CPCH_MAX 2
#define | stc_mftn_adcmp_t FM0P_MFT_ADCMP_TypeDef
#define | MFT0_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT0_ADCMP_BASE)
#define | MFT1_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT1_ADCMP_BASE)
#define | MFT2_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT2_ADCMP_BASE)
## Typedefs
typedef enum en_adcmp_frt | en_adcmp_frt_t
| Define Frt channel connect to Adcmp.
typedef enum en_adcmp_fm3_frt | en_adcmp_fm3_frt_t
| Define Frt channel with FM3 mode connect to Adcmp.
typedef enum en_adcmp_buf | en_adcmp_buf_t
| Define Adcmp buffer type.
typedef enum en_adcmp_trig_channel | en_adcmp_start_trig_t
| Define Mft Adcmp output start trig channel.
typedef enum en_adcmp_trig_sel | en_adcmp_trig_sel_t
| Define Mft Adcmp trig mode.
typedef enum en_adcmp_mode | en_adcmp_mode_t
| Define Adcmp running mode.
typedef enum en_adcmp_occp_sel | en_adcmp_occp_sel_t
| Define Occp channel.
typedef struct stc_mft_adcmp_config | stc_mft_adcmp_config_t
| Define Mft_adcmp configure parameters.
typedef struct stc_mft_adcmp_func | stc_mft_adcmp_func_t
| Define Mft_adcmp functions.
typedef enum en_adcmp_fm3_mode | en_adcmp_fm3_mode_t
| Define Mft_adcmp compatible fm3 mode.
typedef struct stc_mft_adcmp_fm3_config | stc_mft_adcmp_fm3_config_t
| Define Mft_adcmp compatible fm3 configure parameters.
## Enumerations
enum | en_adcmp_frt { Frt0ToAdcmp = 0, Frt1ToAdcmp = 1, Frt2ToAdcmp = 2, AdcmpFrtToExt0 = 3, AdcmpFrtToExt1 = 4 }
| Define Frt channel connect to Adcmp. More...
enum | en_adcmp_fm3_frt { Frt1ToAdcmpFm3 = 1, Frt2ToAdcmpFm3 = 2 }
| Define Frt channel with FM3 mode connect to Adcmp. More...
enum | en_adcmp_buf { AdcmpBufDisable = 0, AdcmpBufFrtZero = 1, AdcmpBufFrtPeak = 2, AdcmpBufFrtZeroPeak = 3 }
| Define Adcmp buffer type. More...
enum | en_adcmp_trig_channel { AdcmpStartTrig0 = 0, AdcmpStartTrig1 = 1, AdcmpStartTrig2 = 2, AdcmpStartTrig3 = 3, AdcmpStartTrig4 = 4, AdcmpStartTrig5 = 5, AdcmpStartTrig6 = 6, AdcmpStartTrig7 = 7 }
| Define Mft Adcmp output start trig channel. More...
enum | en_adcmp_trig_sel { AdcmpTrigAdc0Scan = 0, AdcmpTrigAdc0Prio = 1, AdcmpTrigAdc1Scan = 2, AdcmpTrigAdc1Prio = 3, AdcmpTrigAdc2Scan = 4, AdcmpTrigAdc2Prio = 5 }
| Define Mft Adcmp trig mode. More...
enum | en_adcmp_mode { AdcmpNormalMode = 0, AdcmpOffsetMode = 1 }
| Define Adcmp running mode. More...
enum | en_adcmp_occp_sel { AdcmpSelOccp0 = 0, AdcmpSelOccp1 = 1 }
| Define Occp channel. More...
enum | en_adcmp_fm3_mode { AdcmpFm3AccpUpAccpDown = 0, AdcmpFm3AccpUp = 1, AdcmpFm3AccpDown = 2, AdcmpFm3AccpUpAccpdnDown = 3 }
| Define Mft_adcmp compatible fm3 mode. More...
## Functions
en_result_t | Mft_Adcmp_Init (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8Ch, stc_mft_adcmp_config_t *pstcConfig)
| Device dependent initialization of Mft adcmp module.
en_result_t | Mft_Adcmp_EnableOperation (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8Ch, stc_mft_adcmp_func_t *pstcFunc)
| Enable Mft Adcmp operations.
en_result_t | Mft_Adcmp_DisableOperation (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8Ch, stc_mft_adcmp_func_t *pstcFunc)
| Disable Mft Adcmp operations.
en_result_t | Mft_Adcmp_WriteAcmp (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8Ch, uint16_t u16AdcmpVal)
| Write compare or offset value to ADCMP.
uint16_t | Mft_Adcmp_ReadAcmp (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8Ch)
| Read compare and offset value of ACMP.
en_result_t | Mft_Adcmp_Fm3_Init (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh, stc_mft_adcmp_fm3_config_t *pstcConfig)
| Mft Adcmp fm3 compatible initialization.
en_result_t | Mft_Adcmp_Fm3_EnableOperation (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh)
| Mft Adcmp fm3 compatible mode configuration and enable operation.
en_result_t | Mft_Adcmp_Fm3_DisableOperation (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh)
| De-configurate Mft Adcmp fm3 compatible function and disable operation.
en_result_t | Mft_Adcmp_Fm3_WriteAccp (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh, uint16_t u16AccpVal)
| Mft Adcmp fm3 compatible mode, write Accp register.
uint16_t | Mft_Adcmp_Fm3_ReadAccp (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh)
| Mft Adcmp fm3 compatible mode, read Accp register stored value.
en_result_t | Mft_Adcmp_Fm3_WriteAccpdn (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh, uint16_t u16AccpdnVal)
| Mft Adcmp fm3 compatible mode, write Accpdn register.
uint16_t | Mft_Adcmp_Fm3_ReadAccpdn (volatile FM0P_MFT_ADCMP_TypeDef *pstcMftAdcmp, uint8_t u8CoupleCh)
| Mft Adcmp fm3 compatible mode, read Accpdn register stored value.

## Detailed Description

Headerfile for MFT's ADC Start Compare Unit functions

History:

- 2014-01-15 0.1 Edison Zhang First version.

Definition in file mft_adcmp.h.

## Define Documentation

#define MFT0_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT0_ADCMP_BASE)

Definition at line 148 of file mft_adcmp.h.

#define MFT1_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT1_ADCMP_BASE)

Definition at line 149 of file mft_adcmp.h.

#define MFT2_ADCMP (*(volatile stc_mftn_adcmp_t *) FM0P_MFT2_ADCMP_BASE)

Definition at line 150 of file mft_adcmp.h.

#define MFT_ADCMP_CH0 0

Definition at line 130 of file mft_adcmp.h.

#define MFT_ADCMP_CH1 1

Definition at line 131 of file mft_adcmp.h.

#define MFT_ADCMP_CH10 0

Definition at line 137 of file mft_adcmp.h.

Referenced by Mft_Adcmp_Fm3_DisableOperation(), Mft_Adcmp_Fm3_EnableOperation(), and Mft_Adcmp_Fm3_Init().

#define MFT_ADCMP_CH2 2

Definition at line 132 of file mft_adcmp.h.

#define MFT_ADCMP_CH3 3

Definition at line 133 of file mft_adcmp.h.

#define MFT_ADCMP_CH32 1

Definition at line 138 of file mft_adcmp.h.

Referenced by Mft_Adcmp_Fm3_DisableOperation(), Mft_Adcmp_Fm3_EnableOperation(), and Mft_Adcmp_Fm3_Init().

#define MFT_ADCMP_CH4 4

Definition at line 134 of file mft_adcmp.h.

#define MFT_ADCMP_CH5 5

Definition at line 135 of file mft_adcmp.h.

#define MFT_ADCMP_CH54 2

Definition at line 139 of file mft_adcmp.h.

Referenced by Mft_Adcmp_Fm3_DisableOperation(), Mft_Adcmp_Fm3_EnableOperation(), and Mft_Adcmp_Fm3_Init().

#define MFT_ADCMP_CH_MAX 5

Definition at line 141 of file mft_adcmp.h.

Referenced by Mft_Adcmp_DisableOperation(), Mft_Adcmp_EnableOperation(), Mft_Adcmp_Init(), Mft_Adcmp_ReadAcmp(), and Mft_Adcmp_WriteAcmp().

#define MFT_ADCMP_CPCH_MAX 2

Definition at line 142 of file mft_adcmp.h.

Referenced by Mft_Adcmp_Fm3_DisableOperation(), Mft_Adcmp_Fm3_EnableOperation(), Mft_Adcmp_Fm3_ReadAccp(), Mft_Adcmp_Fm3_ReadAccpdn(), Mft_Adcmp_Fm3_WriteAccp(), and Mft_Adcmp_Fm3_WriteAccpdn().

#define stc_mftn_adcmp_t FM0P_MFT_ADCMP_TypeDef

Definition at line 146 of file mft_adcmp.h.

## Typedef Documentation

typedef enum en_adcmp_buf en_adcmp_buf_t

Define Adcmp buffer type.

typedef enum en_adcmp_fm3_frt en_adcmp_fm3_frt_t

Define Frt channel with FM3 mode connect to Adcmp.

typedef enum en_adcmp_fm3_mode en_adcmp_fm3_mode_t

Define Mft_adcmp compatible fm3 mode.

typedef enum en_adcmp_frt en_adcmp_frt_t

Define Frt channel connect to Adcmp.

typedef enum en_adcmp_mode en_adcmp_mode_t

Define Adcmp running mode.

typedef enum en_adcmp_occp_sel en_adcmp_occp_sel_t

Define Occp channel.

typedef enum en_adcmp_trig_channel en_adcmp_start_trig_t

Define Mft Adcmp output start trig channel.

typedef enum en_adcmp_trig_sel en_adcmp_trig_sel_t

Define Mft Adcmp trig mode.

typedef struct stc_mft_adcmp_config stc_mft_adcmp_config_t

Define Mft_adcmp configure parameters.

typedef struct stc_mft_adcmp_fm3_config stc_mft_adcmp_fm3_config_t

Define Mft_adcmp compatible fm3 configure parameters.

typedef struct stc_mft_adcmp_func stc_mft_adcmp_func_t

Define Mft_adcmp functions.

## Enumeration Type Documentation

enum en_adcmp_buf

Define Adcmp buffer type.

Enumerator:

  AdcmpBufDisable | disable Adcmp buffer function
  AdcmpBufFrtZero | transfer buffer when counter value of Frt connected= 0x0000
  AdcmpBufFrtPeak | transfer buffer when counter value of Frt connected= TCCP
  AdcmpBufFrtZeroPeak | transfer buffer both when counter value of Frt connected= 0x0000 and TCCP

Definition at line 181 of file mft_adcmp.h.

enum en_adcmp_fm3_frt

Define Frt channel with FM3 mode connect to Adcmp.

Enumerator:

  Frt1ToAdcmpFm3 | connect Frt channel 1 to Icu
  Frt2ToAdcmpFm3 | connect Frt channel 2 to Icu

Definition at line 170 of file mft_adcmp.h.

enum en_adcmp_fm3_mode

Define Mft_adcmp compatible fm3 mode.

Enumerator:

  AdcmpFm3AccpUpAccpDown | Fm3 compatible mode: Accp Up and Down.
  AdcmpFm3AccpUp | Fm3 compatible mode: Accp Up.
  AdcmpFm3AccpDown | Fm3 compatible mode: Accp Down.
  AdcmpFm3AccpUpAccpdnDown | Fm3 compatible mode: Accp up adn Accpdn Down.

Definition at line 269 of file mft_adcmp.h.

enum en_adcmp_frt

Define Frt channel connect to Adcmp.

Enumerator:

  Frt0ToAdcmp | connect Frt channel 0 to Icu
  Frt1ToAdcmp | connect Frt channel 1 to Icu
  Frt2ToAdcmp | connect Frt channel 2 to Icu
  AdcmpFrtToExt0 | connect extern Frt channel 0 to Icu
  AdcmpFrtToExt1 | connect extern Frt channel 1 to Icu

Definition at line 156 of file mft_adcmp.h.

enum en_adcmp_mode

Define Adcmp running mode.

Enumerator:

  AdcmpNormalMode | select Adcmp Normal mode
  AdcmpOffsetMode | select Adcmp Offset mode

Definition at line 224 of file mft_adcmp.h.

enum en_adcmp_occp_sel

Define Occp channel.

Enumerator:

  AdcmpSelOccp0 | select Occp0 channel
  AdcmpSelOccp1 | select Occp1 channel

Definition at line 234 of file mft_adcmp.h.

enum en_adcmp_trig_channel

Define Mft Adcmp output start trig channel.

Enumerator:

  AdcmpStartTrig0 | Outputs ADC start trigger 0.
  AdcmpStartTrig1 | Outputs ADC start trigger 1.
  AdcmpStartTrig2 | Outputs ADC start trigger 2.
  AdcmpStartTrig3 | Outputs ADC start trigger 3.
  AdcmpStartTrig4 | Outputs ADC start trigger 4.
  AdcmpStartTrig5 | Outputs ADC start trigger 5.
  AdcmpStartTrig6 | Outputs ADC start trigger 6.
  AdcmpStartTrig7 | Outputs ADC start trigger 7.

Definition at line 194 of file mft_adcmp.h.

enum en_adcmp_trig_sel

Define Mft Adcmp trig mode.

Enumerator:

  AdcmpTrigAdc0Scan | AdcmpStartTrig0.
  AdcmpTrigAdc0Prio | AdcmpStartTrig1.
  AdcmpTrigAdc1Scan | AdcmpStartTrig2.
  AdcmpTrigAdc1Prio | AdcmpStartTrig3.
  AdcmpTrigAdc2Scan | AdcmpStartTrig4.
  AdcmpTrigAdc2Prio | AdcmpStartTrig5.

Definition at line 210 of file mft_adcmp.h.