hw_if.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. {
  57. hw_uart1,
  58. hw_uart2,
  59. hw_lpuart1,
  60. } hw_uart_id_t;
  61. typedef enum
  62. {
  63. hw_uart_ok,
  64. hw_uart_error,
  65. hw_uart_busy,
  66. hw_uart_to,
  67. } hw_status_t;
  68. void HW_UART_Init(hw_uart_id_t hw_uart_id);
  69. void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
  70. void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t *pData, uint16_t Size, void (*Callback)(void));
  71. hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, uint32_t timeout);
  72. hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t *p_data, uint16_t size, void (*Callback)(void));
  73. void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
  74. void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /*HW_IF_H */
  79. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/