VSF Documented
debug_stream_tx_blocked.inc
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 "vsf_cfg.h"
21
22#if VSF_HAL_USE_DEBUG_STREAM == ENABLED
23
24#if VSF_USE_SIMPLE_STREAM == ENABLED
25# define __VSF_SIMPLE_STREAM_CLASS_INHERIT__
26# include "service/vsf_service.h"
27#endif
28
29/*============================ MACROS ========================================*/
30/*============================ MACROFIED FUNCTIONS ===========================*/
31/*============================ TYPES =========================================*/
32/*============================ PROTOTYPES ====================================*/
33
34#if VSF_USE_SIMPLE_STREAM == ENABLED
35static void __vsf_debug_stream_tx_init(vsf_stream_t *stream);
36static uint_fast32_t __vsf_debug_stream_tx_write(vsf_stream_t* stream, uint8_t* buf, uint_fast32_t size);
37static uint_fast32_t __vsf_debug_stream_tx_stream_get_data_length(vsf_stream_t* stream);
38static uint_fast32_t __vsf_debug_stream_tx_stream_get_avail_length(vsf_stream_t* stream);
39#endif
40
41/*============================ GLOBAL VARIABLES ==============================*/
42/*============================ LOCAL VARIABLES ===============================*/
43
44#if VSF_USE_SIMPLE_STREAM == ENABLED
45static const vsf_stream_op_t __vsf_debug_stream_tx_op = {
46 .init = __vsf_debug_stream_tx_init,
47 .write = __vsf_debug_stream_tx_write,
48 .get_data_length = __vsf_debug_stream_tx_stream_get_data_length,
49 .get_avail_length = __vsf_debug_stream_tx_stream_get_avail_length,
50};
51#endif
52
53/*============================ GLOBAL VARIABLES ==============================*/
54
55#if VSF_USE_SIMPLE_STREAM == ENABLED
57 .op = &__vsf_debug_stream_tx_op,
58};
59#elif VSF_USE_STREAM == ENABLED
60#endif
61
62/*============================ IMPLEMENTATION ================================*/
63
64#if VSF_USE_SIMPLE_STREAM == ENABLED
65static void __vsf_debug_stream_tx_init(vsf_stream_t *stream)
66{
67 __VSF_DEBUG_STREAM_TX_INIT();
69}
70
71static uint_fast32_t __vsf_debug_stream_tx_write(vsf_stream_t *stream, uint8_t *buf, uint_fast32_t size)
72{
73 __VSF_DEBUG_STREAM_TX_WRITE_BLOCKED(buf, size);
74 return size;
75}
76
77static uint_fast32_t __vsf_debug_stream_tx_stream_get_data_length(vsf_stream_t* stream)
78{
79 return 0;
80}
81
82static uint_fast32_t __vsf_debug_stream_tx_stream_get_avail_length(vsf_stream_t* stream)
83{
84 return 0xFFFFFFFF;
85}
86
87#elif VSF_USE_STREAM == ENABLED
88#endif
89
90#endif // VSF_HAL_USE_DEBUG_STREAM
vsf_stream_t VSF_DEBUG_STREAM_TX
Definition NuConsole_stream.c:83
Definition vsf_simple_stream.h:176
void(* init)(vsf_stream_t *stream)
Definition vsf_simple_stream.h:221
Definition vsf_simple_stream.h:254
vsf_stream_op_t const * op
Definition vsf_simple_stream.h:262
void vsf_stream_connect_rx(vsf_stream_t *stream)
Definition vsf_simple_stream.c:170
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned char uint8_t
Definition stdint.h:5
uint32_t size
Definition vsf_memfs.h:50