VSF Documented
vsf.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
19
21
22#ifndef __VSF_H__
23#define __VSF_H__
24
29#if defined(__cplusplus) && !defined(__IAR_SYSTEMS_ICC__)
30# define __STDC_VERSION__ 201112L
31#endif
32
33/*============================ INCLUDES ======================================*/
34#include "vsf_cfg.h"
36#include "hal/arch/vsf_arch.h"
37#include "service/vsf_service.h"
38
39#if VSF_USE_KERNEL == ENABLED
40# include "kernel/vsf_kernel.h"
41#endif
42
44#include "hal/vsf_hal.h"
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51/*============================ MACROS ========================================*/
52
53#ifndef vsf_log_info
54# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
55# define vsf_log_info(__ARG)
56# else
57# define vsf_log_info(...)
58# endif
59#endif
60
61#ifndef vsf_log_warning
62# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
63# define vsf_log_warning(__ARG)
64# else
65# define vsf_log_warning(...)
66# endif
67#endif
68
69#ifndef vsf_log_debug
70# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
71# define vsf_log_debug(__ARG)
72# else
73# define vsf_log_debug(...)
74# endif
75#endif
76
77#if VSF_USE_TRACE == ENABLED
78# if defined(VSF_DEBUGGER_CFG_CONSOLE) \
79 || (defined(VSF_HAL_USE_DEBUG_STREAM) && VSF_HAL_USE_DEBUG_STREAM == ENABLED)\
80 || defined(VSF_CFG_DEBUG_STREAM_TX_T)
81 // use default debug stream from debugger/hardware debug uart/user
82# if VSF_USE_SIMPLE_STREAM == ENABLED
83# define vsf_start_trace(...) \
84 vsf_trace_init(((vsf_stream_t *)&VSF_DEBUG_STREAM_TX, ##__VA_ARGS__))
85# elif VSF_USE_STREAM == ENABLED
86# define vsf_start_trace(...) \
87 vsf_trace_init(((vsf_stream_tx_t *)&VSF_DEBUG_STREAM_TX, ##__VA_ARGS__))
88# endif
89# else
90 // no default debug stream, user should define a stream
91# if VSF_USE_SIMPLE_STREAM == ENABLED
92# define vsf_start_trace(__stream) \
93 vsf_trace_init((vsf_stream_t *)(__stream))
94# elif VSF_USE_STREAM == ENABLED
95# define vsf_start_trace(__stream) \
96 vsf_trace_init((vsf_stream_tx_t *)(__stream))
97# endif
98# endif
99#endif
100
101/*============================ MACROFIED FUNCTIONS ===========================*/
102/*============================ TYPES =========================================*/
103/*============================ GLOBAL VARIABLES ==============================*/
104
105#ifdef VSF_CFG_DEBUG_STREAM_TX_T
106# ifdef VSF_CFG_DEBUG_STREAM_TX_DECLARE
107VSF_CFG_DEBUG_STREAM_TX_DECLARE
108# endif
109extern VSF_CFG_DEBUG_STREAM_TX_T VSF_DEBUG_STREAM_TX;
110#endif
111
112#ifdef VSF_CFG_DEBUG_STREAM_RX_T
113# ifdef VSF_CFG_DEBUG_STREAM_RX_DECLARE
114VSF_CFG_DEBUG_STREAM_RX_DECLARE
115# endif
116extern VSF_CFG_DEBUG_STREAM_RX_T VSF_DEBUG_STREAM_RX;
117#endif
118
119/*============================ LOCAL VARIABLES ===============================*/
120/*============================ PROTOTYPES ====================================*/
121/*============================ INCLUDES ======================================*/
122
134#ifdef VSF_CFG_USER_HEADER
135# include VSF_CFG_USER_HEADER
136#endif
137
138#ifdef __cplusplus
139}
140#endif
141
//vsf group
143
144#endif
145/* EOF */
vsf_mem_stream_t VSF_DEBUG_STREAM_RX
Definition NuConsole_stream.c:87
vsf_stream_t VSF_DEBUG_STREAM_TX
Definition NuConsole_stream.c:83