1 /* 2 * Copyright (c) 2020-2020, BLUETRUM Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef AB32VG1_HAL_DEF_H__ 8 #define AB32VG1_HAL_DEF_H__ 9 10 #include "ab32vgx.h" 11 12 typedef int hal_bool_t; 13 typedef long hal_base_t; 14 typedef unsigned long hal_ubase_t; 15 16 typedef hal_base_t hal_error_t; 17 typedef volatile unsigned long* hal_sfr_t; 18 19 20 /* HAL error code definitions */ 21 #define HAL_EOK 0 /**< There is no error */ 22 #define HAL_ERROR 1 /**< A generic error happens */ 23 #define HAL_ETIMEOUT 2 /**< Timed out */ 24 #define HAL_EFULL 3 /**< The resource is full */ 25 #define HAL_EEMPTY 4 /**< The resource is empty */ 26 #define HAL_ENOMEM 5 /**< No memory */ 27 #define HAL_ENOSYS 6 /**< No system */ 28 #define HAL_EBUSY 7 /**< Busy */ 29 #define HAL_EIO 8 /**< IO error */ 30 #define HAL_EINTR 9 /**< Interrupted system call */ 31 #define HAL_EINVAL 10 /**< Invalid argument */ 32 33 #define HAL_NULL ((void *)0) 34 35 #define HAL_DISABLE (0) 36 #define HAL_ENABLE (1) 37 38 #define HAL_RESET (0) 39 #define HAL_SET (1) 40 41 #endif 42