2021-05-18 12:23:14 +03:00
|
|
|
/* USER CODE BEGIN Header */
|
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @file hw_if.h
|
|
|
|
* @author MCD Application Team
|
|
|
|
* @brief Hardware Interface
|
|
|
|
******************************************************************************
|
|
|
|
* @attention
|
|
|
|
*
|
|
|
|
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
|
|
|
* All rights reserved.</center></h2>
|
|
|
|
*
|
|
|
|
* This software component is licensed by ST under Ultimate Liberty license
|
|
|
|
* SLA0044, the "License"; You may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at:
|
|
|
|
* www.st.com/SLA0044
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
/* USER CODE END Header */
|
|
|
|
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
|
|
#ifndef HW_IF_H
|
|
|
|
#define HW_IF_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
/* Includes ------------------------------------------------------------------*/
|
2021-05-18 12:23:14 +03:00
|
|
|
#include "stm32wbxx.h"
|
|
|
|
#include "stm32wbxx_ll_exti.h"
|
|
|
|
#include "stm32wbxx_ll_system.h"
|
|
|
|
#include "stm32wbxx_ll_rcc.h"
|
|
|
|
#include "stm32wbxx_ll_ipcc.h"
|
|
|
|
#include "stm32wbxx_ll_bus.h"
|
|
|
|
#include "stm32wbxx_ll_pwr.h"
|
|
|
|
#include "stm32wbxx_ll_cortex.h"
|
|
|
|
#include "stm32wbxx_ll_utils.h"
|
|
|
|
#include "stm32wbxx_ll_hsem.h"
|
|
|
|
#include "stm32wbxx_ll_gpio.h"
|
|
|
|
#include "stm32wbxx_ll_rtc.h"
|
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
#ifdef USE_STM32WBXX_USB_DONGLE
|
2021-05-18 12:23:14 +03:00
|
|
|
#include "stm32wbxx_usb_dongle.h"
|
|
|
|
#endif
|
2022-01-05 19:10:18 +03:00
|
|
|
#ifdef USE_STM32WBXX_NUCLEO
|
2021-05-18 12:23:14 +03:00
|
|
|
#include "stm32wbxx_nucleo.h"
|
|
|
|
#endif
|
2022-01-05 19:10:18 +03:00
|
|
|
#ifdef USE_X_NUCLEO_EPD
|
2021-05-18 12:23:14 +03:00
|
|
|
#include "x_nucleo_epd.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
/******************************************************************************
|
2021-05-18 12:23:14 +03:00
|
|
|
* HW UART
|
|
|
|
******************************************************************************/
|
2022-01-05 19:10:18 +03:00
|
|
|
typedef enum {
|
2021-05-18 12:23:14 +03:00
|
|
|
hw_uart1,
|
|
|
|
hw_uart2,
|
|
|
|
hw_lpuart1,
|
2022-01-05 19:10:18 +03:00
|
|
|
} hw_uart_id_t;
|
2021-05-18 12:23:14 +03:00
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
typedef enum {
|
2021-05-18 12:23:14 +03:00
|
|
|
hw_uart_ok,
|
|
|
|
hw_uart_error,
|
|
|
|
hw_uart_busy,
|
|
|
|
hw_uart_to,
|
2022-01-05 19:10:18 +03:00
|
|
|
} hw_status_t;
|
2021-05-18 12:23:14 +03:00
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
void HW_UART_Init(hw_uart_id_t hw_uart_id);
|
|
|
|
void HW_UART_Receive_IT(
|
|
|
|
hw_uart_id_t hw_uart_id,
|
|
|
|
uint8_t* pData,
|
|
|
|
uint16_t Size,
|
|
|
|
void (*Callback)(void));
|
|
|
|
void HW_UART_Transmit_IT(
|
|
|
|
hw_uart_id_t hw_uart_id,
|
|
|
|
uint8_t* pData,
|
|
|
|
uint16_t Size,
|
|
|
|
void (*Callback)(void));
|
|
|
|
hw_status_t
|
|
|
|
HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t* p_data, uint16_t size, uint32_t timeout);
|
|
|
|
hw_status_t HW_UART_Transmit_DMA(
|
|
|
|
hw_uart_id_t hw_uart_id,
|
|
|
|
uint8_t* p_data,
|
|
|
|
uint16_t size,
|
|
|
|
void (*Callback)(void));
|
|
|
|
void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id);
|
|
|
|
void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id);
|
2021-05-18 12:23:14 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*HW_IF_H */
|
|
|
|
|
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|