示例#1
0
void RtcRecoverMcuStatus( void )
{
    //Disable IRQ while the MCU is not running on HSE
    __disable_irq( );

    SystemClockConfig_STOP();
		TimerHwInit();
    SPI1_Init();
    SX1276IoInit();
		SX1276Q1CtrlInit();
    __enable_irq( );
}
/**
  * @brief  Initializes the Global MSP.
  * @param  None
  * @retval None
  */
void HAL_MspInit(void)
{
  /* NOTE : This function is generated automatically by STM32CubeMX and eventually
            modified by the user
   */

	SystemClock_Config();

	//initiate LEDs
	HalLedInit();

	//initiate KEY
	//KEY_Init();
	HalKeyInit( );

	//initiate OLED
	OLED_Init();

	//initiate SPI (for sx1276/1279)
	SPI1_Init();

	SX1276IoInit( );

	//sx1279 active crystal initiate and power on
  SX1276Q1CtrlInit();

	//initiate 3-wire UART
  UART_Init();

#if defined( LOW_POWER_MODE_ENABLE )
  TimerSetLowPowerEnable( true );
  //initiate RTC and stop mode
  RtcInit( );
#else
  TimerSetLowPowerEnable( false );
  TimerHwInit( );
#endif
}