VSF Documented
device.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/*============================ INCLUDES ======================================*/
19
20#include "hal/vsf_hal_cfg.h"
21
22/*============================ MACROS ========================================*/
23
24/*\note first define basic info for arch. */
25#if defined(__VSF_HEADER_ONLY_SHOW_ARCH_INFO__)
26
27#ifndef VSF_ARCH_SWI_NUM
28# define VSF_ARCH_SWI_NUM 4
29#endif
30
31#ifndef VSF_ARCH_RTOS_CFG_STACK_DEPTH
32# define VSF_ARCH_RTOS_CFG_STACK_DEPTH 4096
33#endif
34
35#define VSF_ARCH_FREERTOS_CFG_IS_IN_ISR xPortIsInsideInterrupt
36#ifndef VSF_ARCH_PROVIDE_HEAP
37# define VSF_ARCH_PROVIDE_HEAP ENABLED
38# define VSF_ARCH_HEAP_HAS_STATISTICS ENABLED
39#endif
40
41// there is malloc/free/realloc/calloc/memalign in bl_sdk
42#define VSF_LINUX_SIMPLE_LIBC_CFG_NO_MM ENABLED
43
44// software interrupt provided by a dedicated device
45#define VSF_DEV_SWI_NUM 0
46
47#ifndef __RTOS__
48# define __RTOS__
49#endif
50#ifndef __FREERTOS__
51# define __FREERTOS__
52#endif
53
54// alu types, should be defined in target-specified compiler header
55// but xtensa uses generic compiler header, so define alu types here
56typedef unsigned int uintalu_t;
57typedef int intalu_t;
58
59#define VSF_ARCH_STACK_ALIGN_BIT 4
60
61#else
62
63#ifndef __HAL_DEVICE_BL_BL616_H__
64#define __HAL_DEVICE_BL_BL616_H__
65
66/*============================ INCLUDES ======================================*/
67
68// TODO: include header from vendor here
69
70/*\note this is should be the only place where __common.h is included.*/
71#include "../common/__common.h"
72
73/*============================ MACROS ========================================*/
74
75#define VSF_HW_IO_PORT_COUNT 1
76#define VSF_HW_IO_PIN_COUNT 35
77#define VSF_HW_IO_FUNCTION_MAX 32
78#define VSF_HW_IO_PORT0_DEVNAME "gpio"
79
80#define VSF_HW_GPIO_COUNT VSF_HW_IO_PORT_COUNT
81#define VSF_HW_GPIO_PIN_COUNT VSF_HW_IO_PIN_COUNT
82
83/*============================ MACROFIED FUNCTIONS ===========================*/
84/*============================ TYPES =========================================*/
85/*============================ GLOBAL VARIABLES ==============================*/
86/*============================ LOCAL VARIABLES ===============================*/
87/*============================ PROTOTYPES ====================================*/
88
89#endif // __HAL_DEVICE_BL_BL616_H__
90#endif // __VSF_HEADER_ONLY_SHOW_ARCH_INFO__
91/* EOF */
int_fast8_t intalu_t
Definition type.h:89
uint_fast8_t uintalu_t
Definition type.h:88