| 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 | Variables
C:/pdl_v10/library/driver/qprc/qprc.h File Reference
`#include "mcu.h"`
`#include "pdl_user.h"`
Include dependency graph for qprc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | stc_qprc_int_sel
| Enumeration to define QPRC interrupt selection. More...
struct | stc_qprc_int_cb
| Enumeration to define QPRC interrupt callback function. More...
struct | stc_qprc_filter
| Structure to configuration QPRC filter. More...
struct | stc_qprc_config
| Structure to configuration QPRC. More...
struct | stc_qprc_intern_data
| Structure of QPRC internal data. More...
struct | stc_qprc_instance_data
| Structure of QPRC instance data. More...
## Defines
#define | stc_qprcn_t FM0P_QPRC_TypeDef
#define | stc_qprc_nfn_t FM0P_QPRC_NF_TypeDef
#define | QPRC0 (*((volatile stc_qprcn_t *) FM0P_QPRC0_BASE))
#define | QPRC1 (*((volatile stc_qprcn_t *) FM0P_QPRC1_BASE))
#define | QPRC2 (*((volatile stc_qprcn_t *) FM0P_QPRC2_BASE))
#define | QPRC3 (*((volatile stc_qprcn_t *) FM0P_QPRC3_BASE))
#define | QPRCNF0 (*((volatile stc_qprc_nfn_t *) FM0P_QPRC0_NF_BASE))
#define | QPRCNF1 (*((volatile stc_qprc_nfn_t *) FM0P_QPRC1_NF_BASE))
#define | QPRCNF2 (*((volatile stc_qprc_nfn_t *) FM0P_QPRC2_NF_BASE))
#define | QPRCNF3 (*((volatile stc_qprc_nfn_t *) FM0P_QPRC3_NF_BASE))
#define | QPRC_INSTANCE_COUNT
#define | QPRC_PC_OVERFLOW_INT 0
#define | QPRC_PC_UNDERFLOW_INT 1
#define | QPRC_PC_ZERO_INDEX_INT 2
## Typedefs
typedef enum en_qprc_instance_index | en_qprc_instance_index_t
| Enumeration to define an index for each QPRC instance.
typedef enum en_qprc_pcmode | en_qprc_pcmode_t
| Enumeration to define position counter mode.
typedef enum en_qprc_rcmode | en_qprc_rcmode_t
| Enumeration to define revolution counter mode.
typedef enum en_qprc_zinedge | en_qprc_zinedge_t
| Enumeration to define ZIN valid edge.
typedef enum en_qprc_binedge | en_qprc_binedge_t
| Enumeration to define BIN valid edge.
typedef enum en_qprc_ainedge | en_qprc_ainedge_t
| Enumeration to define AIN valid edge.
typedef enum en_qprc_pcresetmask | en_qprc_pcresetmask_t
| Enumeration to define reset mask times of position counter.
typedef enum en_qprc_compmode | en_qprc_compmode_t
| Enumeration to define compare object of QPRCR register.
typedef enum en_qprc_int | en_qprc_int_t
| Enumeration to define QPRC interrupt type.
typedef struct stc_qprc_int_sel | stc_qprc_int_sel_t
| Enumeration to define QPRC interrupt selection.
typedef struct stc_qprc_int_cb | stc_qprc_int_cb_t
| Enumeration to define QPRC interrupt callback function.
typedef enum en_qprc_filter_width | en_qprc_filter_width_t
| Enumeration to define QPRC filter width.
typedef struct stc_qprc_filter | stc_qprc_filter_t
| Structure to configuration QPRC filter.
typedef struct stc_qprc_config | stc_qprc_config_t
| Structure to configuration QPRC.
typedef struct stc_qprc_intern_data | stc_qprc_intern_data_t
| Structure of QPRC internal data.
typedef struct stc_qprc_instance_data | stc_qprc_instance_data_t
| Structure of QPRC instance data.
## Enumerations
enum | en_qprc_instance_index { QprcInstanceIndexQprc0 = 0, QprcInstanceIndexQprc1, QprcInstanceIndexQprc2 }
| Enumeration to define an index for each QPRC instance. More...
enum | en_qprc_pcmode { QprcPcMode0 = 0, QprcPcMode1 = 1, QprcPcMode2 = 2, QprcPcMode3 = 3 }
| Enumeration to define position counter mode. More...
enum | en_qprc_rcmode { QprcRcMode0 = 0, QprcRcMode1 = 1, QprcRcMode2 = 2, QprcRcMode3 = 3 }
| Enumeration to define revolution counter mode. More...
enum | en_qprc_zinedge { QprcZinDisable = 0, QprcZinFallingEdge = 1, QprcZinRisingEdge = 2, QprcZinBothEdges = 3, QprcZinLowLevel = 4, QprcZinHighLevel = 5 }
| Enumeration to define ZIN valid edge. More...
enum | en_qprc_binedge { QprcBinDisable = 0, QprcBinFallingEdge = 1, QprcBinRisingEdge = 2, QprcBinBothEdges = 3 }
| Enumeration to define BIN valid edge. More...
enum | en_qprc_ainedge { QprcAinDisable = 0, QprcAinFallingEdge = 1, QprcAinRisingEdge = 2, QprcAinBothEdges = 3 }
| Enumeration to define AIN valid edge. More...
enum | en_qprc_pcresetmask { QprcResetMaskDisable = 0, QprcResetMask2Times = 1, QprcResetMask4Times = 2, QprcResetMask8Times = 3 }
| Enumeration to define reset mask times of position counter. More...
enum | en_qprc_compmode { QprcComapreWithPosition = 0, QprcComapreWithRevolution = 1 }
| Enumeration to define compare object of QPRCR register. More...
enum | en_qprc_int { QprcPcOfUfZeroInt = 0, QprcPcMatchInt, QprcPcRcMatchInt, QprcPcMatchRcMatchInt, QprcPcCountInvertInt, QprcRcOutrangeInt }
| Enumeration to define QPRC interrupt type. More...
enum | en_qprc_filter_width { QprcNoFilter = 0, QprcFilterWidth4Pclk, QprcFilterWidth8Pclk, QprcFilterWidth16Pclk, QprcFilterWidth32Pclk, QprcFilterWidth64Pclk, QprcFilterWidth128Pclk, QprcFilterWidth256Pclk }
| Enumeration to define QPRC filter width. More...
## Functions
en_result_t | Qprc_Init (volatile FM0P_QPRC_TypeDef *pstcQprc, stc_qprc_config_t *pstcConfig)
| Initialize QPRC.
en_result_t | Qprc_StopPcCount (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Stop Position Counter.
en_result_t | Qprc_RestartPcCount (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Restart Position Counter from stop status.
en_result_t | Qprc_SetPcCount (volatile FM0P_QPRC_TypeDef *pstcQprc, uint16_t u16PcValue)
| Set count value of Position counter.
uint16_t | Qprc_GetPcCount (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get count value of Position counter.
en_result_t | Qprc_SetRcCount (volatile FM0P_QPRC_TypeDef *pstcQprc, uint16_t u16RcValue)
| Set count value of Revolution Counter.
uint16_t | Qprc_GetRcCount (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get count value of Revolution Counter.
en_result_t | Qprc_SetPcMaxValue (volatile FM0P_QPRC_TypeDef *pstcQprc, uint16_t u16PcMaxValue)
| Set maximum count value of Position Counter.
uint16_t | Qprc_GetPcMaxValue (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get maximum count value of Position Counter.
en_result_t | Qprc_SetPcCompareValue (volatile FM0P_QPRC_TypeDef *pstcQprc, uint16_t u16PcValue)
| Set compare value of Position counter.
uint16_t | Qprc_GetPcCompareValue (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get compare value of Position counter.
en_result_t | Qprc_SetPcRcCompareValue (volatile FM0P_QPRC_TypeDef *pstcQprc, uint16_t u16PcRcValue)
| Set compare value of Position and Revolution Counter.
uint16_t | Qprc_GetPcRcCompareValue (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get compare value of Position and Revolution Counter.
en_result_t | Qprc_ConfigPcMode (volatile FM0P_QPRC_TypeDef *pstcQprc, en_qprc_pcmode_t enMode)
| Set Position Counter mode.
en_result_t | Qprc_ConfigRcMode (volatile FM0P_QPRC_TypeDef *pstcQprc, en_qprc_rcmode_t enMode)
| Set Revolution Counter mode.
en_result_t | Qprc_EnableInt (volatile FM0P_QPRC_TypeDef *pstcQprc, stc_qprc_int_sel_t *pstcIntSel, stc_qprc_int_cb_t *pstcIntCallback)
| Enable QPRC interrupts.
en_result_t | Qprc_DisableInt (volatile FM0P_QPRC_TypeDef *pstcQprc, stc_qprc_int_sel_t *pstcIntSel)
| Disable PC match interrupt.
en_int_flag_t | Qprc_GetIntFlag (volatile FM0P_QPRC_TypeDef *pstcQprc, en_qprc_int_t enIntType)
| Get interrupt flag of QPRC.
en_result_t | Qprc_ClrIntFlag (volatile FM0P_QPRC_TypeDef *pstcQprc, en_qprc_int_t enIntType)
| Clear interrupt flag of QPRC.
en_stat_flag_t | Qprc_GetPcOfUfDir (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get last position counter flow direction.
en_stat_flag_t | Qprc_GetPcDir (volatile FM0P_QPRC_TypeDef *pstcQprc)
| Get last position counter direction.
void | Qprc_IrqHandler (volatile FM0P_QPRC_TypeDef *pstcQprc, stc_qprc_intern_data_t *pstcQprcInternData)
| QPRC instance interrupt service routine.
## Variables
stc_qprc_instance_data_t | m_astcQprcInstanceDataLut [(PDL_PERIPHERAL_ENABLE_QPRC0==PDL_ON?1:0)+(PDL_PERIPHERAL_ENABLE_QPRC1==PDL_ON?1:0)+(PDL_PERIPHERAL_ENABLE_QPRC2==PDL_ON?1:0)]
| Look-up table for all enabled MFS instances and their internal data.

## Detailed Description

Headerfile for QPRC functions

History:

- 2013-12-21 0.1 Edison First version.
- 2014-01-16 0.2 Edison Add comments about how to use QPRC with APIs

Definition in file qprc.h.