VSF Documented
vsf_hal_distbus_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 __VSF_HAL_DISTBUS_SPI_H__
19#define __VSF_HAL_DISTBUS_SPI_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if VSF_HAL_USE_SPI == ENABLED && VSF_HAL_DISTBUS_USE_SPI == ENABLED
26
27#if defined(__VSF_HAL_DISTBUS_SPI_CLASS_IMPLEMENT)
28# define __VSF_CLASS_IMPLEMENT__
29#elif defined(__VSF_HAL_DISTBUS_SPI_CLASS_INHERIT__)
30# define __VSF_CLASS_INHERIT__
31#endif
32
33#include "utilities/ooc_class.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/*============================ MACROS ========================================*/
40
41#ifndef VSF_HAL_DISTBUS_SPI_CFG_MULTI_CLASS
42# define VSF_HAL_DISTBUS_SPI_CFG_MULTI_CLASS VSF_SPI_CFG_MULTI_CLASS
43#endif
44
45/*============================ MACROFIED FUNCTIONS ===========================*/
46/*============================ TYPES =========================================*/
47
48#if defined(__VSF_HAL_DISTBUS_SPI_CLASS_IMPLEMENT) || defined(__VSF_HAL_DISTBUS_SPI_CLASS_INHERIT__)
49enum {
50 VSF_HAL_DISTBUS_SPI_CMD_ADDR_RANGE,
51};
52#endif
53
54/*============================ INCLUDES ======================================*/
55
56#ifdef VSF_HAL_DISTBUS_AS_REAL_DRIVER
58#endif
59
60/*============================ TYPES =========================================*/
61
63#if VSF_HAL_DISTBUS_SPI_CFG_MULTI_CLASS == ENABLED
64 public_member(
65 implement(vsf_spi_t)
66 )
67#endif
68 protected_member(
70 struct {
71 vsf_spi_isr_handler_t *handler;
72 void *target;
73 uint32_t enabled_mask;
74 uint32_t triggered_mask;
75 uint16_t no;
76 } irq;
77 )
78 private_member(
79 vsf_distbus_t *distbus;
80 )
81};
82
83/*============================ GLOBAL VARIABLES ==============================*/
84/*============================ INCLUDES ======================================*/
85/*============================ PROTOTYPES ====================================*/
86
88
89#ifdef __cplusplus
90}
91#endif
92
93#undef __VSF_HAL_DISTBUS_SPI_CLASS_IMPLEMENT
94#undef __VSF_HAL_DISTBUS_SPI_CLASS_INHERIT__
95
96#endif
97#endif
98/* EOF */
99
Definition vsf_distbus.h:87
Definition vsf_distbus.h:122
Definition vsf_hal_distbus_spi.h:62
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned short uint16_t
Definition stdint.h:7
unsigned uint32_t
Definition stdint.h:9
SPI instance structure, used for SPI Multi Class support, not needed in non Multi Class mode.
Definition vsf_template_spi.h:1072
uint32_t vsf_hal_distbus_spi_register_service(vsf_distbus_t *distbus, vsf_hal_distbus_spi_t *spi, void *info, uint32_t infolen)
Definition vsf_hal_distbus_spi.c:63
void vsf_spi_isr_handler_t(void *target_ptr, vsf_spi_t *spi_ptr, vsf_spi_irq_mask_t irq_mask)
SPI interrupt handler type declaration.
Definition vsf_template_spi.h:761
Generated from commit: vsfteam/vsf@3f091ef