hw_if.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file hw_if.h
  5. * @author MCD Application Team
  6. * @brief Hardware Interface
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under Ultimate Liberty license
  14. * SLA0044, the "License"; You may not use this file except in compliance with
  15. * the License. You may obtain a copy of the License at:
  16. * www.st.com/SLA0044
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef HW_IF_H
  23. #define HW_IF_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32wbxx.h"
  29. #include "stm32wbxx_ll_exti.h"
  30. #include "stm32wbxx_ll_system.h"
  31. #include "stm32wbxx_ll_rcc.h"
  32. #include "stm32wbxx_ll_ipcc.h"
  33. #include "stm32wbxx_ll_bus.h"
  34. #include "stm32wbxx_ll_pwr.h"
  35. #include "stm32wbxx_ll_cortex.h"
  36. #include "stm32wbxx_ll_utils.h"
  37. #include "stm32wbxx_ll_hsem.h"
  38. #include "stm32wbxx_ll_gpio.h"
  39. #include "stm32wbxx_ll_rtc.h"
  40. #ifdef USE_STM32WBXX_USB_DONGLE
  41. #include "stm32wbxx_usb_dongle.h"
  42. #endif
  43. #ifdef USE_STM32WBXX_NUCLEO
  44. #include "stm32wbxx_nucleo.h"
  45. #endif
  46. #ifdef USE_X_NUCLEO_EPD
  47. #include "x_nucleo_epd.h"
  48. #endif
  49. /* Private includes ----------------------------------------------------------*/
  50. /* USER CODE BEGIN Includes */
  51. /* USER CODE END Includes */
  52. /******************************************************************************
  53. * HW UART
  54. ******************************************************************************/
  55. typedef enum {
  56. hw_uart1,
  57. hw_uart2,
  58. hw_lpuart1,
  59. } hw_uart_id_t;
  60. typedef enum {
  61. hw_uart_ok,
  62. hw_uart_error,
  63. hw_uart_busy,
  64. hw_uart_to,
  65. } hw_status_t;
  66. void HW_UART_Init(hw_uart_id_t hw_uart_id);
  67. void HW_UART_Receive_IT(
  68. hw_uart_id_t hw_uart_id,
  69. uint8_t* pData,
  70. uint16_t Size,
  71. void (*Callback)(void));
  72. void HW_UART_Transmit_IT(
  73. hw_uart_id_t hw_uart_id,
  74. uint8_t* pData,
  75. uint16_t Size,
  76. void (*Callback)(void));
  77. hw_status_t
  78. HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t* p_data, uint16_t size, uint32_t timeout);
  79. hw_status_t HW_UART_Transmit_DMA(
  80. hw_uart_id_t hw_uart_id,
  81. uint8_t* p_data,
  82. uint16_t size,
  83. void (*Callback)(void));
  84. void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
  85. void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /*HW_IF_H */
  90. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/