VSF Documented
usart_interface.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_TEMPLATE_USART_H__
19#define __VSF_TEMPLATE_USART_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if VSF_HAL_USE_USART == ENABLED
26
27#include "utilities/ooc_class.h"
28
29/*============================ MACROS ========================================*/
30/*============================ MACROFIED FUNCTIONS ===========================*/
31/*============================ TYPES =========================================*/
32
35def_interface(i_usart_t)
36 union {
37 implement(i_peripheral_t);
38 struct {
39 vsf_usart_status_t (*Status)(void);
41 } USART;
42 };
44
46 struct {
47 void (*Enable)(vsf_usart_irq_mask_t tEventMask);
48 void (*Disable)(vsf_usart_irq_mask_t tEventMask);
49 } Irq;
50
52 struct {
54 uint_fast16_t (*Read)(void *pBuffer, uint_fast16_t nCount);
56 uint_fast16_t (*Write)(void *pBuffer, uint_fast16_t nCount);
58 bool (*Flush)(void);
60
61 struct {
62 vsf_async_block_access_t Read;
63 vsf_async_block_access_t Write;
65
66end_def_interface(i_usart_t)
68
69
70/*============================ GLOBAL VARIABLES ==============================*/
71/*============================ INCLUDES ======================================*/
72/*============================ PROTOTYPES ====================================*/
73/*============================ IMPLEMENTATION ================================*/
74
75#endif
76
77#endif
78/* EOF */
vsf_err_t
Definition __type.h:42
vsf_usart_irq_mask_t
Definition uart.h:105
bool
Definition type.h:60
end_def_interface(i_pm_wakeup_t) struct vsf_pm_pclk_cfg_t
Definition device.h:249
unsigned short uint_fast16_t
Definition stdint.h:25
Definition vsf_template_usart.h:630
Definition vsf_template_usart.h:556
Definition uart.h:156
void(* Disable)(vsf_usart_irq_mask_t tEventMask)
Definition usart_interface.h:48
struct @573 FIFO
fifo access
struct @572 Irq
Irq.
uint_fast16_t(* Read)(void *pBuffer, uint_fast16_t nCount)
< read from fifo
Definition usart_interface.h:54
struct @574 Block
void(* Enable)(vsf_usart_irq_mask_t tEventMask)
Definition usart_interface.h:47
bool(* Flush)(void)
Definition usart_interface.h:58
def_interface(i_usart_t) union
Definition usart_interface.h:35
vsf_err_t(* Init)(vsf_usart_cfg_t *pCfg)
Definition usart_interface.h:43
uint_fast16_t(* Write)(void *pBuffer, uint_fast16_t nCount)
flush fifo
Definition usart_interface.h:56
struct @749 Capability