[STM32G4] G4系列的RTC报警应用

[复制链接]
1048|12
 楼主| 小灵通2018 发表于 2022-6-20 20:43 | 显示全部楼层 |阅读模式
RTC, TI, se, TE, IO, rc
  1. /**
  2.   ******************************************************************************
  3.   * [url=home.php?mod=space&uid=288409]@file[/url]    Examples_LL/RTC/RTC_Alarm/Src/main.c
  4.   * [url=home.php?mod=space&uid=187600]@author[/url]  MCD Application Team
  5.   * [url=home.php?mod=space&uid=247401]@brief[/url]   This example code shows how to use STM32G4xx RTC LL API to configure
  6.   *          an alarm.
  7.   *          Peripheral initialization done using LL unitary services functions.
  8.   ******************************************************************************
  9.   * @attention
  10.   *
  11.   * <h2><center>© Copyright (c) 2020 STMicroelectronics.
  12.   * All rights reserved.</center></h2>
  13.   *
  14.   * This software component is licensed by ST under BSD 3-Clause license,
  15.   * the "License"; You may not use this file except in compliance with the
  16.   * License. You may obtain a copy of the License at:
  17.   *                        opensource.org/licenses/BSD-3-Clause
  18.   *
  19.   ******************************************************************************
  20.   */

  21. /* Includes ------------------------------------------------------------------*/
  22. #include "main.h"

  23. /** @addtogroup STM32G4xx_LL_Examples
  24.   * @{
  25.   */

  26. /** @addtogroup RTC_Alarm
  27.   * @{
  28.   */

  29. /* Private typedef -----------------------------------------------------------*/
  30. /* Private define ------------------------------------------------------------*/
  31. /* Oscillator time-out values */
  32. #define LSI_TIMEOUT_VALUE          ((uint32_t)2)     /* 2 ms */
  33. #define LSE_TIMEOUT_VALUE          ((uint32_t)5000)  /* 5 s */
  34. #define RTC_TIMEOUT_VALUE          ((uint32_t)1000)  /* 1 s */

  35. /* Defines related to Clock configuration */
  36. /* Uncomment to enable the adequate Clock Source */
  37. #define RTC_CLOCK_SOURCE_LSE
  38. /*#define RTC_CLOCK_SOURCE_LSI*/

  39. #ifdef RTC_CLOCK_SOURCE_LSI
  40. /* ck_apre=LSIFreq/(ASYNC prediv + 1) with LSIFreq=32 kHz RC */
  41. #define RTC_ASYNCH_PREDIV          ((uint32_t)0x7F)
  42. /* ck_spre=ck_apre/(SYNC prediv + 1) = 1 Hz */
  43. #define RTC_SYNCH_PREDIV           ((uint32_t)0x00FF)
  44. #endif

  45. #ifdef RTC_CLOCK_SOURCE_LSE
  46. /* ck_apre=LSEFreq/(ASYNC prediv + 1) = 256Hz with LSEFreq=32768Hz */
  47. #define RTC_ASYNCH_PREDIV          ((uint32_t)0x7F)
  48. /* ck_spre=ck_apre/(SYNC prediv + 1) = 1 Hz */
  49. #define RTC_SYNCH_PREDIV           ((uint32_t)0x00FF)
  50. #endif

  51. /* Private macro -------------------------------------------------------------*/
  52. /* Private variables ---------------------------------------------------------*/
  53. /* Buffers used for displaying Time and Date */
  54. uint8_t aShowTime[] = "hh:ms:ss";
  55. uint8_t aShowDate[] = "dd/mm/aaaa";

  56. #if (USE_TIMEOUT == 1)
  57. uint32_t Timeout = 0; /* Variable used for Timeout management */
  58. #endif /* USE_TIMEOUT */

  59. /* Private function prototypes -----------------------------------------------*/
  60. void     SystemClock_Config(void);
  61. void     Configure_RTC(void);
  62. void     Configure_RTC_Alarm(void);
  63. uint32_t Enter_RTC_InitMode(void);
  64. uint32_t Exit_RTC_InitMode(void);
  65. uint32_t WaitForSynchro_RTC(void);
  66. void     Show_RTC_Calendar(void);
  67. void     LED_Init(void);
  68. void     LED_On(void);
  69. void     LED_Blinking(uint32_t Period);

  70. /* Private functions ---------------------------------------------------------*/

  71. /**
  72.   * @brief  Main program
  73.   * @param  None
  74.   * @retval None
  75.   */
  76. int main(void)
  77. {
  78.   /* Configure the system clock to 170 MHz */
  79.   SystemClock_Config();

  80.   /* Initialize LED2 */
  81.   LED_Init();

  82.   /*##-1- Configure the RTC peripheral #######################################*/
  83.   Configure_RTC();

  84.   /*##-2- Configure Alarm ####################################################*/
  85.   /* Configure RTC Alarm */
  86.   Configure_RTC_Alarm();

  87.   /* Infinite loop */
  88.   while (1)
  89.   {
  90.     /*##-3- Display the updated Time and Date ################################*/
  91.     Show_RTC_Calendar();
  92.   }
  93. }

  94. /**
  95.   * @brief  Configure RTC.
  96.   * [url=home.php?mod=space&uid=536309]@NOTE[/url]   Peripheral configuration is minimal configuration from reset values.
  97.   *         Thus, some useless LL unitary functions calls below are provided as
  98.   *         commented examples - setting is default configuration from reset.
  99.   * @param  None
  100.   * @retval None
  101.   */
  102. void Configure_RTC(void)
  103. {
  104.   /*##-1- Enables the PWR Clock and Enables access to the backup domain #######*/
  105.   /* To change the source clock of the RTC feature (LSE, LSI), you have to:
  106.      - Enable the power clock
  107.      - Enable write access to configure the RTC clock source (to be done once after reset).
  108.      - Reset the Back up Domain
  109.      - Configure the needed RTC clock source */
  110.   LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);

  111.   LL_PWR_EnableBkUpAccess();

  112.   /*##-2- Configure LSE/LSI as RTC clock source ###############################*/
  113. #ifdef RTC_CLOCK_SOURCE_LSE
  114.   /* Enable LSE only if disabled.*/
  115.   if (LL_RCC_LSE_IsReady() == 0)
  116.   {
  117.     LL_RCC_ForceBackupDomainReset();
  118.     LL_RCC_ReleaseBackupDomainReset();
  119.     LL_RCC_LSE_Enable();
  120. #if (USE_TIMEOUT == 1)
  121.     Timeout = LSE_TIMEOUT_VALUE;
  122. #endif /* USE_TIMEOUT */
  123.     while (LL_RCC_LSE_IsReady() != 1)
  124.     {
  125. #if (USE_TIMEOUT == 1)
  126.       if (LL_SYSTICK_IsActiveCounterFlag())
  127.       {
  128.         Timeout --;
  129.       }
  130.       if (Timeout == 0)
  131.       {
  132.         /* LSE activation error */
  133.         LED_Blinking(LED_BLINK_ERROR);
  134.       }
  135. #endif /* USE_TIMEOUT */
  136.     }
  137.     LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);

  138.     /*##-3- Enable RTC peripheral Clocks #######################################*/
  139.     /* Enable RTC Clock */
  140.     LL_RCC_EnableRTC();
  141.   }
  142. #elif defined(RTC_CLOCK_SOURCE_LSI)
  143.   if (LL_RCC_LSI_IsReady() == 0)
  144.   {
  145.     LL_RCC_ForceBackupDomainReset();
  146.     LL_RCC_ReleaseBackupDomainReset();
  147.     LL_RCC_LSI_Enable();
  148. #if (USE_TIMEOUT == 1)
  149.     Timeout = LSI_TIMEOUT_VALUE;
  150. #endif /* USE_TIMEOUT */
  151.     while (LL_RCC_LSI_IsReady() != 1)
  152.     {
  153. #if (USE_TIMEOUT == 1)
  154.       if (LL_SYSTICK_IsActiveCounterFlag())
  155.       {
  156.         Timeout --;
  157.       }
  158.       if (Timeout == 0)
  159.       {
  160.         /* LSI activation error */
  161.         LED_Blinking(LED_BLINK_ERROR);
  162.       }
  163. #endif /* USE_TIMEOUT */
  164.     }
  165.     LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSI);

  166.     /*##-3- Enable RTC peripheral Clocks #######################################*/
  167.     /* Enable RTC Clock */
  168.     LL_RCC_EnableRTC();
  169.   }

  170. #else
  171. #error "configure clock for RTC"
  172. #endif


  173.   /*##-4- Disable RTC registers write protection ##############################*/
  174.   LL_RTC_DisableWriteProtection(RTC);

  175.   /*##-5- Enter in initialization mode #######################################*/
  176.   if (Enter_RTC_InitMode() != RTC_ERROR_NONE)
  177.   {
  178.     /* Initialization Error */
  179.     LED_Blinking(LED_BLINK_ERROR);
  180.   }

  181.   /*##-6- Configure RTC ######################################################*/
  182.   /* Configure RTC prescaler and RTC data registers */
  183.   /* Set Hour Format */
  184.   LL_RTC_SetHourFormat(RTC, LL_RTC_HOURFORMAT_AMPM);
  185.   /* Set Asynch Prediv (value according to source clock) */
  186.   LL_RTC_SetAsynchPrescaler(RTC, RTC_ASYNCH_PREDIV);
  187.   /* Set Synch Prediv (value according to source clock) */
  188.   LL_RTC_SetSynchPrescaler(RTC, RTC_SYNCH_PREDIV);
  189.   /* Set OutPut */
  190.   /* Reset value is LL_RTC_ALARMOUT_DISABLE */
  191.   //LL_RTC_SetAlarmOutEvent(RTC, LL_RTC_ALARMOUT_DISABLE);
  192.   /* Set OutPutPolarity */
  193.   /* Reset value is LL_RTC_OUTPUTPOLARITY_PIN_HIGH */
  194.   //LL_RTC_SetOutputPolarity(RTC, LL_RTC_OUTPUTPOLARITY_PIN_HIGH);
  195.   /* Set OutPutType */
  196.   /* Reset value is LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN */
  197.   //LL_RTC_SetAlarmOutputType(RTC, LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN);

  198.   /*##-7- Exit of initialization mode #######################################*/
  199.   Exit_RTC_InitMode();

  200.   /*##-8- Enable RTC registers write protection #############################*/
  201.   LL_RTC_EnableWriteProtection(RTC);
  202. }

  203. /**
  204.   * @brief  Configure the current time and date.
  205.   * @note   Peripheral configuration is minimal configuration from reset values.
  206.   *         Thus, some useless LL unitary functions calls below are provided as
  207.   *         commented examples - setting is default configuration from reset.
  208.   * @param  None
  209.   * @param  None
  210.   * @retval None
  211.   */
  212. void Configure_RTC_Alarm(void)
  213. {
  214.   /*##-1- Disable RTC registers write protection ############################*/
  215.   LL_RTC_DisableWriteProtection(RTC);

  216.   /*##-2- Enter in initialization mode ######################################*/
  217.   if (Enter_RTC_InitMode() != RTC_ERROR_NONE)
  218.   {
  219.     /* Initialization Error */
  220.     LED_Blinking(LED_BLINK_ERROR);
  221.   }

  222.   /*##-3- Configure the Date ################################################*/
  223.   /* Note: __LL_RTC_CONVERT_BIN2BCD helper macro can be used if user wants to*/
  224.   /*       provide directly the decimal value:                               */
  225.   /*       LL_RTC_DATE_Config(RTC, LL_RTC_WEEKDAY_MONDAY,                    */
  226.   /*                          __LL_RTC_CONVERT_BIN2BCD(31), (...))           */
  227.   /* Set Date: Friday December 29th 2016 */
  228.   LL_RTC_DATE_Config(RTC, LL_RTC_WEEKDAY_FRIDAY, 0x29, LL_RTC_MONTH_DECEMBER, 0x16);

  229.   /*##-4- Configure the Time ################################################*/
  230.   /* Set Time: 11:59:55 PM*/
  231.   LL_RTC_TIME_Config(RTC, LL_RTC_TIME_FORMAT_PM, 0x11, 0x59, 0x55);

  232.   /*##-5- Configure the RTC Alarm peripheral #################################*/
  233.   /* Set Alarm to 12:00:25
  234.      RTC Alarm Generation: Alarm on Hours, Minutes and Seconds (ignore date/weekday)*/
  235.   LL_RTC_ALMA_ConfigTime(RTC, LL_RTC_ALMA_TIME_FORMAT_AM, 0x12, 0x00, 0x25);
  236.   LL_RTC_ALMA_SetMask(RTC, LL_RTC_ALMA_MASK_DATEWEEKDAY);

  237.   /* Note: following interfaces may be used but not needed as default values are used.*/
  238.   //LL_RTC_ALMA_SetSubSecond(RTC, 0x00);
  239.   //LL_RTC_ALMA_SetSubSecondMask(RTC, 0);
  240.   //LL_RTC_ALMA_DisableWeekday(RTC);
  241.   //LL_RTC_ALMA_SetDay(RTC, 0x01);

  242.   /* Enable Alarm*/
  243.   LL_RTC_ALMA_Enable(RTC);

  244.   /* Clear the Alarm interrupt pending bit */
  245.   LL_RTC_ClearFlag_ALRA(RTC);

  246.   /* Enable IT Alarm */
  247.   LL_RTC_EnableIT_ALRA(RTC);

  248.   /* RTC Alarm Interrupt Configuration: EXTI configuration */
  249.   LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_17);
  250.   LL_EXTI_EnableRisingTrig_0_31(LL_EXTI_LINE_17);

  251.   /*##-6- Configure the NVIC for RTC Alarm ###############################*/
  252.   NVIC_SetPriority(RTC_Alarm_IRQn, 0x0F);
  253.   NVIC_EnableIRQ(RTC_Alarm_IRQn);

  254.   /*##-7- Exit of initialization mode #######################################*/
  255.   if (Exit_RTC_InitMode() != RTC_ERROR_NONE)
  256.   {
  257.     /* Initialization Error */
  258.     LED_Blinking(LED_BLINK_ERROR);
  259.   }

  260.   /*##-8- Enable RTC registers write protection #############################*/
  261.   LL_RTC_EnableWriteProtection(RTC);
  262. }

  263. /**
  264.   * @brief  Enter in initialization mode
  265.   * @note In this mode, the calendar counter is stopped and its value can be updated
  266.   * @param  None
  267.   * @retval RTC_ERROR_NONE if no error
  268.   */
  269. uint32_t Enter_RTC_InitMode(void)
  270. {
  271.   /* Set Initialization mode */
  272.   LL_RTC_EnableInitMode(RTC);

  273. #if (USE_TIMEOUT == 1)
  274.   Timeout = RTC_TIMEOUT_VALUE;
  275. #endif /* USE_TIMEOUT */

  276.   /* Check if the Initialization mode is set */
  277.   while (LL_RTC_IsActiveFlag_INIT(RTC) != 1)
  278.   {
  279. #if (USE_TIMEOUT == 1)
  280.     if (LL_SYSTICK_IsActiveCounterFlag())
  281.     {
  282.       Timeout --;
  283.     }
  284.     if (Timeout == 0)
  285.     {
  286.       return RTC_ERROR_TIMEOUT;
  287.     }
  288. #endif /* USE_TIMEOUT */
  289.   }

  290.   return RTC_ERROR_NONE;
  291. }

  292. /**
  293.   * @brief  Exit Initialization mode
  294.   * @param  None
  295.   * @retval RTC_ERROR_NONE if no error
  296.   */
  297. uint32_t Exit_RTC_InitMode(void)
  298. {
  299.   LL_RTC_DisableInitMode(RTC);

  300.   /* Wait for synchro */
  301.   /* Note: Needed only if Shadow registers is enabled           */
  302.   /*       LL_RTC_IsShadowRegBypassEnabled function can be used */
  303.   return (WaitForSynchro_RTC());
  304. }

  305. /**
  306.   * @brief  Wait until the RTC Time and Date registers (RTC_TR and RTC_DR) are
  307.   *         synchronized with RTC APB clock.
  308.   * @param  None
  309.   * @retval RTC_ERROR_NONE if no error (RTC_ERROR_TIMEOUT will occur if RTC is
  310.   *         not synchronized)
  311.   */
  312. uint32_t WaitForSynchro_RTC(void)
  313. {
  314.   /* Clear RSF flag */
  315.   LL_RTC_ClearFlag_RS(RTC);

  316. #if (USE_TIMEOUT == 1)
  317.   Timeout = RTC_TIMEOUT_VALUE;
  318. #endif /* USE_TIMEOUT */

  319.   /* Wait the registers to be synchronised */
  320.   while (LL_RTC_IsActiveFlag_RS(RTC) != 1)
  321.   {
  322. #if (USE_TIMEOUT == 1)
  323.     if (LL_SYSTICK_IsActiveCounterFlag())
  324.     {
  325.       Timeout --;
  326.     }
  327.     if (Timeout == 0)
  328.     {
  329.       return RTC_ERROR_TIMEOUT;
  330.     }
  331. #endif /* USE_TIMEOUT */
  332.   }
  333.   return RTC_ERROR_NONE;
  334. }

  335. /**
  336.   * @brief  Display the current time and date.
  337.   * @param  None
  338.   * @retval None
  339.   */
  340. void Show_RTC_Calendar(void)
  341. {
  342.   /* Note: need to convert in decimal value in using __LL_RTC_CONVERT_BCD2BIN helper macro */
  343.   /* Display time Format : hh:mm:ss */
  344.   sprintf((char *)aShowTime, "%.2d:%.2d:%.2d", __LL_RTC_CONVERT_BCD2BIN(LL_RTC_TIME_GetHour(RTC)),
  345.           __LL_RTC_CONVERT_BCD2BIN(LL_RTC_TIME_GetMinute(RTC)),
  346.           __LL_RTC_CONVERT_BCD2BIN(LL_RTC_TIME_GetSecond(RTC)));
  347.   /* Display date Format : mm-dd-yy */
  348.   sprintf((char *)aShowDate, "%.2d-%.2d-%.2d", __LL_RTC_CONVERT_BCD2BIN(LL_RTC_DATE_GetMonth(RTC)),
  349.           __LL_RTC_CONVERT_BCD2BIN(LL_RTC_DATE_GetDay(RTC)),
  350.           2000 + __LL_RTC_CONVERT_BCD2BIN(LL_RTC_DATE_GetYear(RTC)));
  351. }

  352. /**
  353.   * @brief  Initialize LED2.
  354.   * @param  None
  355.   * @retval None
  356.   */
  357. void LED_Init(void)
  358. {
  359.   /* Enable the LED2 Clock */
  360.   LED2_GPIO_CLK_ENABLE();

  361.   /* Configure IO in output push-pull mode to drive external LED2 */
  362.   LL_GPIO_SetPinMode(LED2_GPIO_PORT, LED2_PIN, LL_GPIO_MODE_OUTPUT);
  363.   /* Reset value is LL_GPIO_OUTPUT_PUSHPULL */
  364.   //LL_GPIO_SetPinOutputType(LED2_GPIO_PORT, LED2_PIN, LL_GPIO_OUTPUT_PUSHPULL);
  365.   /* Reset value is LL_GPIO_SPEED_FREQ_LOW */
  366.   //LL_GPIO_SetPinSpeed(LED2_GPIO_PORT, LED2_PIN, LL_GPIO_SPEED_FREQ_LOW);
  367.   /* Reset value is LL_GPIO_PULL_NO */
  368.   //LL_GPIO_SetPinPull(LED2_GPIO_PORT, LED2_PIN, LL_GPIO_PULL_NO);
  369. }

  370. /**
  371.   * @brief  Turn-on LED2.
  372.   * @param  None
  373.   * @retval None
  374.   */
  375. void LED_On(void)
  376. {
  377.   /* Turn LED2 on */
  378.   LL_GPIO_SetOutputPin(LED2_GPIO_PORT, LED2_PIN);
  379. }

  380. /**
  381.   * @brief  Set LED2 to Blinking mode for an infinite loop (toggle period based on value provided as input parameter).
  382.   * @param  Period : Period of time (in ms) between each toggling of LED
  383.   *   This parameter can be user defined values. Pre-defined values used in that example are :
  384.   *     [url=home.php?mod=space&uid=2817080]@ARG[/url] LED_BLINK_FAST : Fast Blinking
  385.   *     @arg LED_BLINK_SLOW : Slow Blinking
  386.   *     @arg LED_BLINK_ERROR : Error specific Blinking
  387.   * @retval None
  388.   */
  389. void LED_Blinking(uint32_t Period)
  390. {
  391.   /* Toggle IO in an infinite loop */
  392.   while (1)
  393.   {
  394.     LL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);
  395.     LL_mDelay(Period);
  396.   }
  397. }

  398. /**
  399.   * @brief  System Clock Configuration
  400.   *         The system Clock is configured as follows :
  401.   *            System Clock source            = PLL (HSI)
  402.   *            SYSCLK(Hz)                     = 170000000
  403.   *            HCLK(Hz)                       = 170000000
  404.   *            AHB Prescaler                  = 1
  405.   *            APB1 Prescaler                 = 1
  406.   *            APB2 Prescaler                 = 1
  407.   *            PLL_M                          = 4
  408.   *            PLL_N                          = 85
  409.   *            PLL_P                          = 2
  410.   *            PLL_Q                          = 2
  411.   *            PLL_R                          = 2
  412.   *            Flash Latency(WS)              = 4
  413.   * @param  None
  414.   * @retval None
  415.   */
  416. void SystemClock_Config(void)
  417. {
  418.   /* Flash Latency configuration */
  419.   LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);

  420.   /* Enable boost mode to be able to reach 170MHz */
  421.   LL_PWR_EnableRange1BoostMode();

  422.   /* HSI configuration and activation */
  423.   LL_RCC_HSI_Enable();
  424.   while(LL_RCC_HSI_IsReady() != 1)
  425.   {
  426.   };

  427.   /* Main PLL configuration and activation */
  428.   LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, LL_RCC_PLLM_DIV_4, 85, LL_RCC_PLLR_DIV_2);
  429.   LL_RCC_PLL_Enable();
  430.   LL_RCC_PLL_EnableDomain_SYS();
  431.   while(LL_RCC_PLL_IsReady() != 1)
  432.   {
  433.   };

  434.   /* Sysclk activation on the main PLL */
  435.   LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2);
  436.   LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
  437.   while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
  438.   {
  439.   };

  440.   LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
  441.   /* Insure 1µs transition state at intermediate medium speed clock based on DWT */
  442.   CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
  443.   DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
  444.   while(DWT->CYCCNT < 100);
  445.   /* Set APB1 & APB2 prescaler*/
  446.   LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
  447.   LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);

  448.   /* Set systick to 1ms in using frequency set to 170MHz */
  449.   /* This frequency can be calculated through LL RCC macro */
  450.   /* ex: __LL_RCC_CALC_PLLCLK_FREQ(__LL_RCC_CALC_HSI_FREQ(),
  451.                                   LL_RCC_PLLM_DIV_4, 85, LL_RCC_PLLR_DIV_2)*/
  452.   LL_Init1msTick(170000000);

  453.   /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */
  454.   LL_SetSystemCoreClock(170000000);
  455. }

  456. /******************************************************************************/
  457. /*   USER IRQ HANDLER TREATMENT                                               */
  458. /******************************************************************************/
  459. /**
  460.   * @brief  Alarm callback
  461.   * @param  None
  462.   * @retval None
  463.   */
  464. void Alarm_Callback(void)
  465. {
  466.   /* Turn LED2 on: Alarm generation */
  467.   LED_On();
  468. }

  469. #ifdef  USE_FULL_ASSERT

  470. /**
  471.   * @brief  Reports the name of the source file and the source line number
  472.   *         where the assert_param error has occurred.
  473.   * @param  file: pointer to the source file name
  474.   * @param  line: assert_param error line source number
  475.   * @retval None
  476.   */
  477. void assert_failed(char *file, uint32_t line)
  478. {
  479.   /* User can add his own implementation to report the file name and line number,
  480.      ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  481.   /* Infinite loop */
  482.   while (1)
  483.   {
  484.   }
  485. }
  486. #endif

  487. /**
  488.   * @}
  489.   */

  490. /**
  491.   * @}
  492.   */

  493. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


wahahaheihei 发表于 2022-6-20 21:55 | 显示全部楼层
分享的资料不错,学习学习。
guijial511 发表于 2022-6-21 07:57 来自手机 | 显示全部楼层
全是代码,看得累啊。
skyred 发表于 2022-6-26 11:33 | 显示全部楼层
什么是RTC报警
dongnanxibei 发表于 2022-6-26 17:56 | 显示全部楼层
分享的资料不错
稳稳の幸福 发表于 2022-6-26 18:17 | 显示全部楼层
这么做可移植性非常好。
天灵灵地灵灵 发表于 2022-7-25 16:14 | 显示全部楼层
资料不错 3205962de50f5ab096.png
wanduzi 发表于 2022-8-10 16:22 | 显示全部楼层
谢谢分享
yinxiangh 发表于 2022-8-10 22:02 | 显示全部楼层
稳稳の幸福 发表于 2022-6-26 18:17
这么做可移植性非常好。

可移植性好吗?没看出来
两只袜子 发表于 2022-8-11 17:15 来自手机 | 显示全部楼层
通篇没一个文字,全代码,表示头看晕了
asmine 发表于 2022-8-13 14:17 | 显示全部楼层
没这应用,懒得看,等有这应用了,又找不到
Uriah 发表于 2022-10-4 16:06 | 显示全部楼层

在开始电镀之前,必须先清掉孔内的杂物。
Bblythe 发表于 2022-10-4 19:05 | 显示全部楼层

在孔璧内部作金属处理后,可以让内部的各层线路能够彼此连接。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

158

主题

1732

帖子

4

粉丝
快速回复 在线客服 返回列表 返回顶部