/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2018-11-7 SummerGift first version */ #ifndef __DRV_COMMON_H__ #define __DRV_COMMON_H__ #include #include #ifdef __cplusplus extern "C" { #endif void _Error_Handler(char *s, int num); #ifndef Error_Handler #define Error_Handler() _Error_Handler(__FILE__, __LINE__) #endif #define DMA_NOT_AVAILABLE ((DMA_INSTANCE_TYPE *)0xFFFFFFFFU) #define __STM32_PORT(port) GPIO##port##_BASE #define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__STM32_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN) #ifdef __cplusplus } #endif #endif