VSF Documented
vsf_usart_stream.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#ifndef __VSF_USART_STREAM_H__
19#define __VSF_USART_STREAM_H__
20
21#include "hal/vsf_hal_cfg.h"
22
23#if VSF_HAL_USE_USART == ENABLED && VSF_USE_SIMPLE_STREAM == ENABLED
24
25// for vsf_usart_t
26#include "hal/vsf_hal.h"
27// for stream
28#include "service/vsf_service.h"
29
30#if defined(__VSF_USART_STREAM_CLASS_IMPLEMENT)
31# undef __VSF_USART_STREAM_CLASS_IMPLEMENT
32# define __VSF_CLASS_IMPLEMENT__
33#elif defined(__VSF_USART_STREAM_CLASS_INHERIT__)
34# undef __VSF_USART_STREAM_CLASS_INHERIT__
35# define __VSF_CLASS_INHERIT__
36#endif
37
38#include "utilities/ooc_class.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/*============================ INCLUDES ======================================*/
45/*============================ MACROS ========================================*/
46/*============================ MACROFIED FUNCTIONS ===========================*/
47/*============================ TYPES =========================================*/
48
50 public_member(
51 vsf_usart_t *usart;
52 // dataflow:
53 // usart_rx --> stream_rx.tx
54 // usart_tx <-- stream_tx.rx
55 vsf_stream_t *stream_rx;
56 vsf_stream_t *stream_tx;
57 )
58 private_member(
59 struct {
61 } tx;
62 )
63};
64
65/*============================ GLOBAL VARIABLES ==============================*/
66/*============================ PROTOTYPES ====================================*/
67
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif // VSF_HAL_USE_USART && VSF_USE_SIMPLE_STREAM
75#endif // __VSF_USART_STREAM_H__
vsf_err_t
Definition __type.h:42
Definition vsf_simple_stream.h:254
Definition vsf_usart_stream.h:49
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned uint32_t
Definition stdint.h:9
Definition vsf_template_usart.h:556
Definition vsf_template_usart.h:661
uint32_t size
Definition vsf_memfs.h:50
vsf_err_t vsf_usart_stream_init(vsf_usart_stream_t *usart_stream, vsf_usart_cfg_t *cfg)
Definition vsf_usart_stream.c:100