Exemple #1
0
/**************************************************************************************************
 * @fn      Hal_DriverInit
 *
 * @brief   Initialize HW - These need to be initialized before anyone.
 *
 * @param   task_id - Hal TaskId
 *
 * @return  None
 **************************************************************************************************/
void HalDriverInit (void)
{
    /* VDDMON */
#if (defined HAL_VDDMON) && (HAL_VDDMON == TRUE)
    HalVddMonInit();
#endif

    /* ADC */
#if (defined HAL_ADC) && (HAL_ADC == TRUE)
    HalAdcInit();
#endif

    /* DMA */
#if (defined HAL_DMA) && (HAL_DMA == TRUE)
    // Must be called before the init call to any module that uses DMA.
    HalDmaInit();
#endif

    /* AES */
#if (defined HAL_AES) && (HAL_AES == TRUE)
    HalAesInit();
#endif

    /* LCD */
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
    HalLcdInit();
#endif

    /* LED */
#if (defined HAL_LED) && (HAL_LED == TRUE)
    HalLedInit();
#endif

    /* UART */
#if (defined HAL_UART) && (HAL_UART == TRUE)
    HalUARTInit();
#endif

    /* KEY */
#if (defined HAL_KEY) && (HAL_KEY == TRUE)
    HalKeyInit();
#endif

    /* SPI */
#if (defined HAL_SPI) && (HAL_SPI == TRUE)
    HalSpiInit();
#endif

    /* Buzzer */
#if (defined HAL_BUZZER) && (HAL_BUZZER == TRUE)
    HalBuzzerInit();
#endif

    /* GPIO Debug */
#if (defined HAL_GPIO_DBG) && (HAL_GPIO_DBG == TRUE)
    HalGpioDbgInit();
#endif
}
Exemple #2
0
/**************************************************************************************************
 * @fn      Hal_DriverInit
 *
 * @brief   Initialize HW - These need to be initialized before anyone.
 *
 * @param   task_id - Hal TaskId
 *
 * @return  None
 **************************************************************************************************/
void HalDriverInit (void)
{
  /* TIMER */
#if (defined HAL_TIMER) && (HAL_TIMER == TRUE)
  #error "The hal timer driver module is removed."
#endif

  /* ADC */
#if (defined HAL_ADC) && (HAL_ADC == TRUE)
  HalAdcInit();
#endif

  /* DMA */
#if (defined HAL_DMA) && (HAL_DMA == TRUE)
  // Must be called before the init call to any module that uses DMA.
  HalDmaInit();
#endif

  /* AES */
#if (defined HAL_AES) && (HAL_AES == TRUE)
  HalAesInit();
#endif

  /* LCD */
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
  HalLcdInit();
#endif

  /* LED */
#if (defined HAL_LED) && (HAL_LED == TRUE)
  HalLedInit();
#endif

  /* UART */
#if (defined HAL_UART) && (HAL_UART == TRUE)
  HalUARTInit();
#endif

  /* KEY */
#if (defined HAL_KEY) && (HAL_KEY == TRUE)
  HalKeyInit();
#endif

  /* SPI */
#if (defined HAL_SPI) && (HAL_SPI == TRUE)
  HalSpiInit();
#endif

  /* HID */
#if (defined HAL_HID) && (HAL_HID == TRUE)
  usbHidInit();
#endif
}
/**
  * @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
}
Exemple #4
0
/**************************************************************************************************
 * @fn      Hal_DriverInit (ªì©l¤ÆµwÅ骺ÅX°Êµ{§Ç, ¨Ï¥ÎªÌ¥i¦b¦¹¨ç¼Æ²K¥[¬ÛÃöµwÅé)
 *
 * @brief   Initialize HW - These need to be initialized before anyone.
 *
 * @param   task_id - Hal TaskId
 *
 * @return  None
 **************************************************************************************************/
void HalDriverInit (void)
{
  /* TIMER */
#if (defined HAL_TIMER) && (HAL_TIMER == TRUE)
  HalTimerInit();
#endif

  /* ADC */
#if (defined HAL_ADC) && (HAL_ADC == TRUE)
  HalAdcInit();
  #if defined(M170)
    M170_Init();
  #endif
#endif

  /* DMA */
#if (defined HAL_DMA) && (HAL_DMA == TRUE)
  // Must be called before the init call to any module that uses DMA.
  HalDmaInit();
#endif

  /* Flash */
#if (defined HAL_FLASH) && (HAL_FLASH == TRUE)
  // Must be called before the init call to any module that uses Flash access or NV.
  HalFlashInit();
#endif

  /* AES */
#if (defined HAL_AES) && (HAL_AES == TRUE)
  HalAesInit();
#endif

  /* LCD */
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
  HalLcdInit();
#endif

  /* UART */
#if (defined HAL_UART) && (HAL_UART == TRUE)
  HalUARTInit();
#endif

  /* KEY */
#if (defined HAL_KEY) && (HAL_KEY == TRUE)
  HalKeyInit();
#endif
  
  /* SPI */
#if (defined HAL_SPI) && (HAL_SPI == TRUE)
  HalSpiInit();
#endif

  /* HID */
#if (defined HAL_HID) && (HAL_HID == TRUE)
  usbHidInit();
#endif
    
  /* KEYPAD */
#if (defined HAL_KEYPAD) && (HAL_KEYPAD == TRUE)
  halKeypadInit();
#endif
  
  /* BUZZER */
#if (defined HAL_BUZZER) && (HAL_BUZZER == TRUE)
  halBuzzerInit();
#endif
  
  /* I2C (M200 module) */
#if (defined HAL_I2C) && (HAL_I2C == TRUE)
  #if defined(M200)
    M200_Init();
  #endif
#endif
    
  /* LED */
#if (defined HAL_LED) && (HAL_LED == TRUE)
  HalLedInit();
#endif
  
}