hw_init.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /********************************* (C) РОТЕК ***********************************
  2. * @module hw_init
  3. * @file hw_init.c
  4. * @version 1.0.0
  5. * @date XX.XX.XXXX
  6. * $brief hw_init
  7. *******************************************************************************
  8. * @history Version Author Comment
  9. * XX.XX.XXXX 1.0.0 Telenkov D.A. First release.
  10. *******************************************************************************
  11. */
  12. #include "stm32f4xx.h"
  13. #include "hw_init.h"
  14. #include "wdg.h"
  15. #include "usart.h"
  16. #include "settings_api.h"
  17. #include "buttons.h"
  18. #include "commands_api.h"
  19. #include "led.h"
  20. #include "rtc.h"
  21. #include "gpio.h"
  22. #include "spi_flash.h"
  23. #include "stm32_uid.h"
  24. #include "FreeRTOS.h"
  25. #include "task.h"
  26. #ifdef PRINTF_STDLIB
  27. #include <stdio.h>
  28. #endif
  29. #ifdef PRINTF_CUSTOM
  30. #include "tinystdio.h"
  31. #endif
  32. char STM_ID[33];
  33. /**
  34. * @brief Инициализация необходимых модулей
  35. */
  36. void BT_6702_Init(void)
  37. {
  38. uint8_t len;
  39. gpio_init();
  40. WDG_Init();
  41. spi_flash_init();
  42. InitUSART();
  43. SETTINGS_Load();
  44. COM_ReadTestState();
  45. memset(STM_ID, 0, 33);
  46. GetSTM32IDStr(STM_ID, &len); // Уникальный ID чипа
  47. BUTTON_Init(); // Кнопки
  48. LED_Init();
  49. TM_RTC_Init(TM_RTC_ClockSource_External);
  50. // Создает таски для выполнения команд тестера
  51. xTaskCreate(vTestCommands, "TestProcessing", 2*configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);
  52. printf("Hello world\r\n");
  53. }
  54. /********************************* (C) РОТЕК **********************************/