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 void *target;
59 void (*on_error)(void *target, vsf_usart_stream_t *stream, vsf_usart_irq_mask_t irq_mask_err);
60 )
61 private_member(
62 struct {
64 } tx;
65 )
66};
67
68/*============================ GLOBAL VARIABLES ==============================*/
69/*============================ PROTOTYPES ====================================*/
70
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif // VSF_HAL_USE_USART && VSF_USE_SIMPLE_STREAM
78#endif // __VSF_USART_STREAM_H__
vsf_err_t
Definition __type.h:42
vsf_usart_irq_mask_t
Definition uart.h:106
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
USART configuration structure Contains all parameters needed to initialize and configure a USART inst...
Definition vsf_template_usart.h:687
USART instance structure Used for USART Multi Class support.
Definition vsf_template_usart.h:850
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:107
Generated from commit: vsfteam/vsf@74aa6ce