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 && VSF_USE_SIMPLE_STREAM == 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 defined(VSF_CFG_DEBUG_STREAM_TX)
83# define vsf_start_trace(...) \
84 vsf_trace_init(((vsf_stream_t *)&VSF_CFG_DEBUG_STREAM_TX, ##__VA_ARGS__))
85# elif VSF_USE_SIMPLE_STREAM == ENABLED
86# define vsf_start_trace(...) \
87 vsf_trace_init(((vsf_stream_t *)&VSF_DEBUG_STREAM_TX, ##__VA_ARGS__))
88# elif VSF_USE_STREAM == ENABLED
89# define vsf_start_trace(...) \
90 vsf_trace_init(((vsf_stream_tx_t *)&VSF_DEBUG_STREAM_TX, ##__VA_ARGS__))
91# endif
92# else
93 // no default debug stream, user should define a stream
94# if VSF_USE_SIMPLE_STREAM == ENABLED
95# define vsf_start_trace(__stream) \
96 vsf_trace_init((vsf_stream_t *)(__stream))
97# elif VSF_USE_STREAM == ENABLED
98# define vsf_start_trace(__stream) \
99 vsf_trace_init((vsf_stream_tx_t *)(__stream))
100# endif
101# endif
102#endif
103
104/*============================ MACROFIED FUNCTIONS ===========================*/
105/*============================ TYPES =========================================*/
106/*============================ GLOBAL VARIABLES ==============================*/
107
108#if VSF_USE_SIMPLE_STREAM == ENABLED
109
110#ifdef VSF_CFG_DEBUG_STREAM_TX_T
111# ifdef VSF_CFG_DEBUG_STREAM_TX_DECLARE
112VSF_CFG_DEBUG_STREAM_TX_DECLARE
113# endif
114# ifdef VSF_CFG_DEBUG_STREAM_TX
115extern VSF_CFG_DEBUG_STREAM_TX_T VSF_CFG_DEBUG_STREAM_TX;
116# else
117extern VSF_CFG_DEBUG_STREAM_TX_T VSF_DEBUG_STREAM_TX;
118# endif
119#endif
120
121#ifdef VSF_CFG_DEBUG_STREAM_RX_T
122# ifdef VSF_CFG_DEBUG_STREAM_RX_DECLARE
123VSF_CFG_DEBUG_STREAM_RX_DECLARE
124# endif
125# ifdef VSF_CFG_DEBUG_STREAM_RX
126extern VSF_CFG_DEBUG_STREAM_RX_T VSF_CFG_DEBUG_STREAM_RX;
127# else
128extern VSF_CFG_DEBUG_STREAM_RX_T VSF_DEBUG_STREAM_RX;
129# endif
130#endif
131
132#endif
133
134/*============================ LOCAL VARIABLES ===============================*/
135/*============================ PROTOTYPES ====================================*/
136/*============================ INCLUDES ======================================*/
137
149#ifdef VSF_CFG_USER_HEADER
150# include VSF_CFG_USER_HEADER
151#endif
152
153#ifdef __cplusplus
154}
155#endif
156
//vsf group
158
159#endif
160/* 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
Generated from commit: vsfteam/vsf@c3767bf