PAN1080 Peripheral API
|
Clktrim Interface. More...
Functions | |
__STATIC_INLINE void | TRIM_SetIdealCnt (TRIM_T *trim, uint32_t cnt) |
This function used to set a ideal count value,IDEA_CNT = CAL_CNT * (REF_CLK / CAL_CLK) -1. More... | |
__STATIC_INLINE uint32_t | TRIM_GetIdealCnt (TRIM_T *trim) |
This function used to read a ideal count value,IDEA_CNT = CAL_CNT * (REF_CLK / CAL_CLK) -1. More... | |
__STATIC_INLINE uint32_t | TRIM_GetRealCnt (TRIM_T *trim) |
This function used to get a real count value. More... | |
__STATIC_INLINE bool | TRIM_IsIntStatusOccured (TRIM_T *trim, uint32_t msk) |
Adjust which clktrim interrupt occured. More... | |
__STATIC_INLINE void | TRIM_ClearIntStatusMsk (TRIM_T *trim, uint32_t msk) |
Clear the specified interrupt. More... | |
__STATIC_INLINE void | TRIM_EnableInt (TRIM_T *trim, FunctionalState NewState) |
This function used to enable interrupt. More... | |
__STATIC_INLINE void | TRIM_SetRelationIncrease (TRIM_T *trim, FunctionalState NewState) |
This function used to set the relation ship between tuning code and frequency. More... | |
__STATIC_INLINE void | TRIM_SetEarlyTerminatinEn (TRIM_T *trim, FunctionalState NewState) |
This function used to enable early termination. More... | |
__STATIC_INLINE void | TRIM_SetCoarseCode (TRIM_T *trim, uint32_t code) |
This function used to set coarse code value. More... | |
__STATIC_INLINE uint32_t | TRIM_GetCoarseCode (TRIM_T *trim) |
This function used to get coarse code value. More... | |
__STATIC_INLINE void | TRIM_SetFineCode (TRIM_T *trim, uint32_t code) |
This function used to set fine code value. More... | |
__STATIC_INLINE uint32_t | TRIM_GetFineCode (TRIM_T *trim) |
This function used to get fine code value. More... | |
__STATIC_INLINE void | TRIM_SetPrecisionCode (TRIM_T *trim, uint32_t code) |
This function used to set precision code value. More... | |
__STATIC_INLINE uint32_t | TRIM_GetPrecisionCode (TRIM_T *trim) |
This function used to get precision code value. More... | |
__STATIC_INLINE void | TRIM_SetBitWidth (TRIM_T *trim, uint32_t width) |
This function used to set bit width,bit_width = width + 1. More... | |
__STATIC_INLINE uint32_t | TRIM_GetBitWidth (TRIM_T *trim) |
This function used to get bit width. More... | |
__STATIC_INLINE void | TRIM_StartTuning (TRIM_T *trim, uint32_t function) |
This function used to enable clk trim function. More... | |
void | TRIM_SetCalWaitCnt (TRIM_T *trim, uint32_t cnt) |
This function used to set calibration cnt number to make sure rc32k stable. More... | |
void | TRIM_SetCalCnt (TRIM_T *trim, uint32_t cnt) |
This function decide the number of calibration clock cycles you want count. More... | |
uint32_t | TRIM_GetCalCnt (TRIM_T *trim) |
This function get the number of calibration clock cycles. More... | |
void | TRIM_SetErrRange (TRIM_T *trim, uint32_t deviation) |
This function used to set range value. More... | |
Clktrim Interface.
__STATIC_INLINE void TRIM_ClearIntStatusMsk | ( | TRIM_T * | trim, |
uint32_t | msk | ||
) |
Clear the specified interrupt.
trim | The base address of i2s module |
msk | interrupt status: TRIM_INT_MEASURE_STOP_Msk TRIM_INT_CTUNE_STOP_Msk TRIM_INT_FTUNE_STOP_Msk TRIM_INT_PTUNE_STOP_Msk TRIM_INT_OVERFLOW_Msk TRIM_INT_HW_TRIG_Msk TRIM_FLAG_MEASURE_STOP_Msk TRIM_FLAG_CTUNE_STOP_Msk TRIM_FLAG_FTUNE_STOP_Msk TRIM_FLAG_PTUNE_STOP_Msk TRIM_FLAG_OVERFLOW_Msk TRIM_FLAG_HW_TRIG_Msk |
__STATIC_INLINE void TRIM_EnableInt | ( | TRIM_T * | trim, |
FunctionalState | NewState | ||
) |
This function used to enable interrupt.
[in] | trim | where trim is trim module base address |
[in] | NewState | new state of the clk trim.This parameter can be: ENABLE or DISABLE. |
__STATIC_INLINE uint32_t TRIM_GetBitWidth | ( | TRIM_T * | trim | ) |
This function used to get bit width.
[in] | trim | where trim is trim module base address |
uint32_t TRIM_GetCalCnt | ( | TRIM_T * | trim | ) |
This function get the number of calibration clock cycles.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE uint32_t TRIM_GetCoarseCode | ( | TRIM_T * | trim | ) |
This function used to get coarse code value.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE uint32_t TRIM_GetFineCode | ( | TRIM_T * | trim | ) |
This function used to get fine code value.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE uint32_t TRIM_GetIdealCnt | ( | TRIM_T * | trim | ) |
This function used to read a ideal count value,IDEA_CNT = CAL_CNT * (REF_CLK / CAL_CLK) -1.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE uint32_t TRIM_GetPrecisionCode | ( | TRIM_T * | trim | ) |
This function used to get precision code value.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE uint32_t TRIM_GetRealCnt | ( | TRIM_T * | trim | ) |
This function used to get a real count value.
[in] | trim | where trim is trim module base address |
__STATIC_INLINE bool TRIM_IsIntStatusOccured | ( | TRIM_T * | trim, |
uint32_t | msk | ||
) |
Adjust which clktrim interrupt occured.
trim | The base address of i2s module |
msk | interrupt status: TRIM_INT_MEASURE_STOP_Msk TRIM_INT_CTUNE_STOP_Msk TRIM_INT_FTUNE_STOP_Msk TRIM_INT_PTUNE_STOP_Msk TRIM_INT_OVERFLOW_Msk TRIM_INT_HW_TRIG_Msk TRIM_FLAG_MEASURE_STOP_Msk TRIM_FLAG_CTUNE_STOP_Msk TRIM_FLAG_FTUNE_STOP_Msk TRIM_FLAG_PTUNE_STOP_Msk TRIM_FLAG_OVERFLOW_Msk TRIM_FLAG_HW_TRIG_Msk |
__STATIC_INLINE void TRIM_SetBitWidth | ( | TRIM_T * | trim, |
uint32_t | width | ||
) |
This function used to set bit width,bit_width = width + 1.
[in] | trim | where trim is trim module base address |
[in] | width | bit width |
void TRIM_SetCalCnt | ( | TRIM_T * | trim, |
uint32_t | cnt | ||
) |
This function decide the number of calibration clock cycles you want count.
[in] | trim | where trim is trim module base address |
[in] | cnt | where cnt is count value |
void TRIM_SetCalWaitCnt | ( | TRIM_T * | trim, |
uint32_t | cnt | ||
) |
This function used to set calibration cnt number to make sure rc32k stable.
[in] | trim | where trim is trim module base address |
[in] | cnt | where cnt is count value |
__STATIC_INLINE void TRIM_SetCoarseCode | ( | TRIM_T * | trim, |
uint32_t | code | ||
) |
This function used to set coarse code value.
[in] | trim | where trim is trim module base address |
[in] | code | coarse tuning code |
__STATIC_INLINE void TRIM_SetEarlyTerminatinEn | ( | TRIM_T * | trim, |
FunctionalState | NewState | ||
) |
This function used to enable early termination.
[in] | trim | where trim is trim module base address |
[in] | NewState | new state of the clk trim.This parameter can be: ENABLE or DISABLE. |
void TRIM_SetErrRange | ( | TRIM_T * | trim, |
uint32_t | deviation | ||
) |
This function used to set range value.
[in] | trim | where trim is trim module base address |
[in] | deviation | frequency deviation,units of Hz formula: deviation = 32k * clk_cnt / (HCLK / 32K) - 32k |
__STATIC_INLINE void TRIM_SetFineCode | ( | TRIM_T * | trim, |
uint32_t | code | ||
) |
This function used to set fine code value.
[in] | trim | where trim is trim module base address |
[in] | code | fine tuning code |
__STATIC_INLINE void TRIM_SetIdealCnt | ( | TRIM_T * | trim, |
uint32_t | cnt | ||
) |
This function used to set a ideal count value,IDEA_CNT = CAL_CNT * (REF_CLK / CAL_CLK) -1.
[in] | trim | where trim is trim module base address |
[in] | cnt | where cnt is count value |
__STATIC_INLINE void TRIM_SetPrecisionCode | ( | TRIM_T * | trim, |
uint32_t | code | ||
) |
This function used to set precision code value.
[in] | trim | where trim is trim module base address |
[in] | code | precision tuning code |
__STATIC_INLINE void TRIM_SetRelationIncrease | ( | TRIM_T * | trim, |
FunctionalState | NewState | ||
) |
This function used to set the relation ship between tuning code and frequency.
[in] | trim | where trim is trim module base address |
[in] | NewState | new state of the clk trim.This parameter can be: ENABLE or DISABLE. |
__STATIC_INLINE void TRIM_StartTuning | ( | TRIM_T * | trim, |
uint32_t | function | ||
) |
This function used to enable clk trim function.
[in] | trim | where trim is trim module base address |
[in] | function | tuning function,include: TRIM_MEASURE_TUNING_EN_Msk TRIM_COARSE_TUNING_EN_Msk TRIM_FINE_TUNING_EN_Msk TRIM_PRECISON_TUNING_EN_Msk |