VSF Documented
fifo2req_spi.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 __HAL_DRIVER_FIFO2REQ_SPI_H__
19#define __HAL_DRIVER_FIFO2REQ_SPI_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if (VSF_HAL_USE_SPI == ENABLED) && (VSF_HAL_USE_FIFO2REQ_SPI == ENABLED)
26
27#if defined(__VSF_HAL_USE_FIFO2REQ_SPI_CLASS_IMPLEMENT)
28# define __VSF_CLASS_IMPLEMENT__
29#endif
30
31#include "utilities/ooc_class.h"
32
33/*============================ MACROS ========================================*/
34
35#ifndef VSF_FIFO2REQ_SPI_CFG_MULTI_CLASS
36# define VSF_FIFO2REQ_SPI_CFG_MULTI_CLASS VSF_SPI_CFG_MULTI_CLASS
37#endif
38
39/*============================ MACROFIED FUNCTIONS ===========================*/
40
41#if VSF_FIFO2REQ_SPI_CFG_MULTI_CLASS == ENABLED
42# define __describe_fifo2req_spi_op() .op = &vsf_fifo2req_spi_op,
43#else
44# define __describe_fifo2req_spi_op()
45#endif
46
47#define __describe_fifo2req_spi(__name, __spi) \
48 vsf_fifo2req_spi_t __name = { \
49 __describe_fifo2req_spi_op() \
50 .spi = __spi, \
51 };
52
53#define describe_fifo2req_spi(__name, __spi) \
54 __describe_fifo2req_spi(__name, __spi)
55
56/*============================ TYPES =========================================*/
57
59 public_member(
61 implement(vsf_spi_t)
62#endif
63 vsf_spi_t * spi;
64 )
65
66 private_member(
67 struct {
68 void * buffer_ptr;
69 uint_fast32_t cnt;
71 } out, in;
72
75 )
76};
77
78/*============================ GLOBAL VARIABLES ==============================*/
79/*============================ INCLUDES ======================================*/
80
81#define VSF_SPI_CFG_DEC_PREFIX vsf_fifo2req
82#define VSF_SPI_CFG_DEC_UPCASE_PREFIX VSF_FIFO2REQ
83#define VSF_SPI_CFG_DEC_EXTERN_OP ENABLED
85
86/*============================ PROTOTYPES ====================================*/
87/*============================ IMPLEMENTATION ================================*/
88
89#endif
90
91#endif
92/* EOF */
#define ENABLED
Definition __type.h:28
Definition fifo2req_spi.h:58
#define VSF_FIFO2REQ_SPI_CFG_MULTI_CLASS
Definition fifo2req_spi.h:36
#define vsf_class(__name)
Definition ooc_class.h:48
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned int uint_fast32_t
Definition stdint.h:27
spi isr for api
Definition vsf_template_spi.h:518
Definition vsf_template_spi.h:541
vsf_adc_isr_t isr
Definition adc.h:83
uint64_t offset
Definition vsf_memfs.h:49
vsf_spi_irq_mask_t
Predefined VSF SPI interrupt that can be reimplemented in specific hal drivers.
Definition vsf_template_spi.h:454