/**
 * @brief  Sets the RTC prescaler value.
 * @param  PrescalerValue: RTC prescaler new value.
 * @retval None
 */
void RTC_SetPrescaler(uint32_t PrescalerValue) {
	/* Check the parameters */
	assert_param(IS_RTC_PRESCALER(PrescalerValue));

	RTC_EnterConfigMode();
	/* Set RTC PRESCALER MSB word */RTC ->PRLH = (PrescalerValue
			& PRLH_MSB_MASK ) >> 16;
	/* Set RTC PRESCALER LSB word */RTC ->PRLL = (PrescalerValue
			& RTC_LSB_MASK );
	RTC_ExitConfigMode();
}
示例#2
0
/**
  * @簡述  設置 RTC 預分頻裝在寄存器的值.
  * @參數  PrescalerValue: RTC 預分頻裝在寄存器的新值.
  * @返回  沒有
  */
void RTC_SetPrescaler(uint32_t PrescalerValue)
{
  /* 檢查參數 */
  assert_param(IS_RTC_PRESCALER(PrescalerValue));
  
  RTC_EnterConfigMode();
  /* 設置 RTC 預分頻裝在寄存器高位字 */
  RTC->PRLH = (PrescalerValue & PRLH_MSB_Mask) >> 16;
  /* 設置 RTC 預分頻裝在寄存器低位字 */
  RTC->PRLL = (PrescalerValue & RTC_LSB_Mask);
  RTC_ExitConfigMode();
}
/*******************************************************************************
* Function Name  : RTC_SetPrescaler
* Description    : Sets the RTC prescaler value.
* Input          : - PrescalerValue: RTC prescaler new value.
* Output         : None
* Return         : None
*******************************************************************************/
void RTC_SetPrescaler(u32 PrescalerValue)
{
  /* Check the parameters */
  assert(IS_RTC_PRESCALER(PrescalerValue));
  
  RTC_EnterConfigMode();

  /* Set RTC PRESCALER MSB word */
  RTC->PRLH = (PrescalerValue & PRLH_MSB_Mask) >> 0x10;
  /* Set RTC PRESCALER LSB word */
  RTC->PRLL = (PrescalerValue & RTC_LSB_Mask);

  RTC_ExitConfigMode();
}
示例#4
0
/*******************************************************************************
* 函数名称: RTC_SetPrescaler
* 功能描述: 获得RTC预分频数值.
* 输入参数: PrescalerValue:RTC预分频数新值.
* 输出参数: 无
* 返回参数: 无
*******************************************************************************/
void RTC_SetPrescaler(u32 PrescalerValue)
{
  /* Check the parameters [检查参数]*/
  assert_param(IS_RTC_PRESCALER(PrescalerValue));
  
  RTC_EnterConfigMode();

  /* Set RTC PRESCALER MSB word [设置RTC分频器高半字节]*/
  RTC->PRLH = (PrescalerValue & PRLH_MSB_Mask) >> 16;
  /* Set RTC PRESCALER LSB word [设置RTC分频器低半字节]*/
  RTC->PRLL = (PrescalerValue & RTC_LSB_Mask);

  RTC_ExitConfigMode();
}