WB32L003 Standard Peripherals Firmware Library

函数
PCA_Private_Functions
WB32L003_StdPeriph_Driver » PCA

## 函数
void | PCA_DeInit (void)
| Deinitializes the PCA peripheral registers to their default reset values. 更多...
void | PCA_Cmd (FunctionalState NewState)
| Enables or disables the PCA peripheral. 更多...
void | PCA_BaseInit (PCA_BaseInitTypeDef *PCA_InitStruct)
| Initializes the PCA Unit basic function according to the specified parameters in the PCA_HandleTypeDef. 更多...
void | PCA_OC_Config (PCA_OC_InitTypeDef *OC_Config)
| Initializes the PCA output compare Channels according to the specified parameters in the PCA_OC_InitTypeDef. 更多...
void | PCA_OC_Cmd (uint32_t Channel, FunctionalState NewState)
| Enables or disables the PCA output compare generation. 更多...
void | PCA_OC_INVCmd (uint32_t Channel, FunctionalState NewState)
| Enables or disables the PCA inverse output compare generation. 更多...
void | PCA_IC_Config (PCA_IC_InitTypeDef *IC_Config)
| Initializes the PCA input capture Channels according to the specified parameters in the PCA_IC_InitTypeDef. 更多...
void | PCA_ITConfig (uint8_t PCA_IT, FunctionalState NewState)
| Enables or disables the specified PCA interrupt. 更多...
ITStatus | PCA_GetITStatus (uint8_t PCA_IT)
| Checks whether the specified PCA interrupt is set or not. 更多...
FlagStatus | PCA_GetFlagStatus (uint8_t PCA_FLAG)
| Checks whether the specified PCA flag is set or not. 更多...
void | PCA_ClearITPendingBit (uint8_t PCA_IT)
| Clears the PCA's interrupt pending bits. 更多...
void | PCA_ClearFlag (uint8_t PCA_FLAG)
| Clears the PCA's pending flags. 更多...
void | PCA_SetPWMDuty (uint32_t Channel, uint8_t Duty)
| Sets PCA PWM ouput duty cycle. 更多...
void | PCA_IC0_TriggerConfig (uint32_t PCA_Trigger_ICPolarity)
| Configures the Channel0 (PCA Input capture). 更多...
void | PCA_IC1_TriggerConfig (uint32_t PCA_Trigger_ICPolarity)
| Configures the Channel1 (PCA Input capture). 更多...
void | PCA_IC2_TriggerConfig (uint32_t PCA_Trigger_ICPolarity)
| Configures the Channel2 (PCA Input capture). 更多...
void | PCA_IC3_TriggerConfig (uint32_t PCA_Trigger_ICPolarity)
| Configures the Channel3 (PCA Input capture). 更多...
void | PCA_IC4_TriggerConfig (uint32_t PCA_Trigger_ICPolarity)
| Configures the Channel4 (PCA Input capture). 更多...
uint16_t | PCA_GetCompareValue (uint32_t Channel)
| Gets the PCA Capture Compare Register value on runtime 更多...

## 详细描述

## 函数说明

## ◆ PCA_BaseInit()

void PCA_BaseInit | ( | PCA_BaseInitTypeDef * | PCA_InitStruct | ) |

Initializes the PCA Unit basic function according to the specified parameters in the PCA_HandleTypeDef.

参数

  PCA_InitStruct | : Ponter to PCA base initialization structure.

返回值

  None |

## ◆ PCA_ClearFlag()

void PCA_ClearFlag | ( | uint8_t | PCA_FLAG | ) |

Clears the PCA's pending flags.

参数

  PCA_FLAG | specifies the flags to clear. This parameter can be one of the following values: PCA_FLAG_CC0: PCA Capture/Compare 0 interrupt flag PCA_FLAG_CC1: PCA Capture/Compare 1 interrupt flag PCA_FLAG_CC2: PCA Capture/Compare 2 interrupt flag PCA_FLAG_CC3: PCA Capture/Compare 3 interrupt flag PCA_FLAG_CC4: PCA Capture/Compare 4 interrupt flag PCA_FLAG_OVERFLOW: PCA count overflow interrupt flag

返回值

  None |

## ◆ PCA_ClearITPendingBit()

void PCA_ClearITPendingBit | ( | uint8_t | PCA_IT | ) |

Clears the PCA's interrupt pending bits.

参数

  PCA_IT | specifies the PCA interrupt pending bits to clear. This parameter can be any combination of the following values: PCA_IT_CC0: PCA Capture/Compare 0 interrupt PCA_IT_CC1: PCA Capture/Compare 1 interrupt PCA_IT_CC2: PCA Capture/Compare 2 interrupt PCA_IT_CC3: PCA Capture/Compare 3 interrupt PCA_IT_CC4: PCA Capture/Compare 4 interrupt PCA_IT_OVERFLOW: PCA counter overflow interrupt

返回值

  None |

## ◆ PCA_Cmd()

void PCA_Cmd | ( | FunctionalState | NewState | ) |

Enables or disables the PCA peripheral.

参数

  NewState | The new state of the PCA peripheral. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ PCA_DeInit()

void PCA_DeInit | ( | void |  | ) |

Deinitializes the PCA peripheral registers to their default reset values.

参数

  None |

返回值

  None |

## ◆ PCA_GetCompareValue()

uint16_t PCA_GetCompareValue | ( | uint32_t | Channel | ) |

Gets the PCA Capture Compare Register value on runtime

参数

  Channel | : PCA Channel associated with the capture compare register. This parameter can be one of the following values: PCA_CHANNEL_0: PCA Capture/Compare channel0 PCA_CHANNEL_1: PCA Capture/Compare channel1 PCA_CHANNEL_2: PCA Capture/Compare channel2 PCA_CHANNEL_3: PCA Capture/Compare channel3 PCA_CHANNEL_4: PCA Capture/Compare channel4

返回值

  16-bit | value of the capture/compare register (PCA_CCAPx)

## ◆ PCA_GetFlagStatus()

FlagStatus PCA_GetFlagStatus | ( | uint8_t | PCA_FLAG | ) |

Checks whether the specified PCA flag is set or not.

参数

  PCA_FLAG | specifies the flag to check. This parameter can be any combination of the following values: PCA_FLAG_CC0: PCA Capture/Compare 0 interrupt flag PCA_FLAG_CC1: PCA Capture/Compare 1 interrupt flag PCA_FLAG_CC2: PCA Capture/Compare 2 interrupt flag PCA_FLAG_CC3: PCA Capture/Compare 3 interrupt flag PCA_FLAG_CC4: PCA Capture/Compare 4 interrupt flag PCA_FLAG_OVERFLOW: PCA count overflow interrupt flag

返回值

  The | new state of PCA_FLAG (SET or RESET).

## ◆ PCA_GetITStatus()

ITStatus PCA_GetITStatus | ( | uint8_t | PCA_IT | ) |

Checks whether the specified PCA interrupt is set or not.

参数

  PCA_FLAG | specifies the interrupt to check. This parameter can be any combination of the following values: PCA_IT_CC0: PCA Capture/Compare 0 interrupt PCA_IT_CC1: PCA Capture/Compare 1 interrupt PCA_IT_CC2: PCA Capture/Compare 2 interrupt PCA_IT_CC3: PCA Capture/Compare 3 interrupt PCA_IT_CC4: PCA Capture/Compare 4 interrupt PCA_IT_OVERFLOW: PCA count overflow interrupt

返回值

  The | new state of PCA_IT (SET or RESET).

## ◆ PCA_IC0_TriggerConfig()

void PCA_IC0_TriggerConfig | ( | uint32_t | PCA_Trigger_ICPolarity | ) |

Configures the Channel0 (PCA Input capture).

参数

  PCA_Trigger_ICPolarity | The Input Polarity. This parameter can be one of the following values: PCA_Trigger_ICPOLARITY_NONE PCA_Trigger_ICPOLARITY_RISING PCA_Trigger_ICPOLARITY_FALLING PCA_Trigger_ICPOLARITY_BOTHEDGE

返回值

  None |

## ◆ PCA_IC1_TriggerConfig()

void PCA_IC1_TriggerConfig | ( | uint32_t | PCA_Trigger_ICPolarity | ) |

Configures the Channel1 (PCA Input capture).

参数

  PCA_Trigger_ICPolarity | The Input Polarity. This parameter can be one of the following values: PCA_Trigger_ICPOLARITY_NONE PCA_Trigger_ICPOLARITY_RISING PCA_Trigger_ICPOLARITY_FALLING PCA_Trigger_ICPOLARITY_BOTHEDGE

返回值

  None |

## ◆ PCA_IC2_TriggerConfig()

void PCA_IC2_TriggerConfig | ( | uint32_t | PCA_Trigger_ICPolarity | ) |

Configures the Channel2 (PCA Input capture).

参数

  PCA_Trigger_ICPolarity | The Input Polarity. This parameter can be one of the following values: PCA_Trigger_ICPOLARITY_NONE PCA_Trigger_ICPOLARITY_RISING PCA_Trigger_ICPOLARITY_FALLING PCA_Trigger_ICPOLARITY_BOTHEDGE

返回值

  None |

## ◆ PCA_IC3_TriggerConfig()

void PCA_IC3_TriggerConfig | ( | uint32_t | PCA_Trigger_ICPolarity | ) |

Configures the Channel3 (PCA Input capture).

参数

  PCA_Trigger_ICPolarity | The Input Polarity. This parameter can be one of the following values: PCA_Trigger_ICPOLARITY_NONE PCA_Trigger_ICPOLARITY_RISING PCA_Trigger_ICPOLARITY_FALLING PCA_Trigger_ICPOLARITY_BOTHEDGE

返回值

  None |

## ◆ PCA_IC4_TriggerConfig()

void PCA_IC4_TriggerConfig | ( | uint32_t | PCA_Trigger_ICPolarity | ) |

Configures the Channel4 (PCA Input capture).

参数

  PCA_Trigger_ICPolarity | The Input Polarity. This parameter can be one of the following values: PCA_Trigger_ICPOLARITY_NONE PCA_Trigger_ICPOLARITY_RISING PCA_Trigger_ICPOLARITY_FALLING PCA_Trigger_ICPOLARITY_BOTHEDGE

返回值

  None |

## ◆ PCA_IC_Config()

void PCA_IC_Config | ( | PCA_IC_InitTypeDef * | IC_Config | ) |

Initializes the PCA input capture Channels according to the specified parameters in the PCA_IC_InitTypeDef.

参数

  IC_Config | : Pointer to PCA input capture configuration structure.

返回值

  None |

## ◆ PCA_ITConfig()

void PCA_ITConfig | ( | uint8_t | PCA_IT,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the specified PCA interrupt.

参数

  PCA_IT | specifies the PCA interrupt source to enable or disable. This parameter can be any combination of the following values: PCA_IT_CC0: Capture/Compare 0 interrupt PCA_IT_CC1: Capture/Compare 1 interrupt PCA_IT_CC2: Capture/Compare 2 interrupt PCA_IT_CC3: Capture/Compare 3 interrupt PCA_IT_CC4: Capture/Compare 4 interrupt PCA_IT_OVERFLOW: Overflow interrupt
  NewState | The new state of the specified PCA interrupt. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ PCA_OC_Cmd()

void PCA_OC_Cmd | ( | uint32_t | Channel,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the PCA output compare generation.

参数

  Channel | : PCA Channel associated with the capture compare register. This parameter can any combination of the following values: PCA_CHANNEL_0: Capture/Compare channel0 PCA_CHANNEL_1: Capture/Compare channel1 PCA_CHANNEL_2: Capture/Compare channel2 PCA_CHANNEL_3: Capture/Compare channel3 PCA_CHANNEL_4: Capture/Compare channel4
  NewState | The new state of the specified PCA channel output compare generation. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ PCA_OC_Config()

void PCA_OC_Config | ( | PCA_OC_InitTypeDef * | OC_Config | ) |

Initializes the PCA output compare Channels according to the specified parameters in the PCA_OC_InitTypeDef.

参数

  OC_Config | : Pointer to PCA output compare configuration structure.

返回值

  None |

## ◆ PCA_OC_INVCmd()

void PCA_OC_INVCmd | ( | uint32_t | Channel,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the PCA inverse output compare generation.

参数

  Channel | : PCA Channel associated with the capture compare register. This parameter can be any combination of the following values: PCA_CHANNEL_0: Capture/Compare channel0 PCA_CHANNEL_1: Capture/Compare channel1 PCA_CHANNEL_2: Capture/Compare channel2 PCA_CHANNEL_3: Capture/Compare channel3 PCA_CHANNEL_4: Capture/Compare channel4
  NewState | The new state of the specified PCA channle inverse output compare generation. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ PCA_SetPWMDuty()

void PCA_SetPWMDuty | ( | uint32_t | Channel,
|  | uint8_t | Duty
| ) |  |

Sets PCA PWM ouput duty cycle.

参数

  Channel | : PCA Channel associated with the capture compare register. This parameter can be any combination of the following values: PCA_CHANNEL_0: PCA Capture/Compare channel0 PCA_CHANNEL_1: PCA Capture/Compare channel1 PCA_CHANNEL_2: PCA Capture/Compare channel2 PCA_CHANNEL_3: PCA Capture/Compare channel3 PCA_CHANNEL_4: PCA Capture/Compare channel4
  Duty | PWM output duty configuration, the duty cycle will decrease from 100% to 0.4% with the increase of Duty value from 0 to 255.

返回值

  None |