VSF Documented
vsf_linux_devfs.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_LINUX_FS_DEVFS_INTERNAL_H__
19#define __VSF_LINUX_FS_DEVFS_INTERNAL_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../../../vsf_linux_cfg.h"
24
25#if VSF_USE_LINUX == ENABLED && VSF_LINUX_USE_DEVFS == ENABLED
26
28
29// for hardware info
30#include "hal/vsf_hal.h"
31
32#if VSF_USE_UI == ENABLED && (defined(__VSF_LINUX_FS_CLASS_IMPLEMENT) || defined(__VSF_LINUX_FS_CLASS_INHERIT__))
33// for vk_disp_area_t
34# include "component/ui/vsf_ui.h"
35#endif
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/*============================ MACROS ========================================*/
42
43#if VSF_USE_BTSTACK == ENABLED
44# define VSF_LINUX_BTHCI_PATH_PREFIX "/dev/ttyhci"
45#endif
46
47/*============================ MACROFIED FUNCTIONS ===========================*/
48/*============================ TYPES =========================================*/
49
50#if VSF_HAL_USE_GPIO == ENABLED
51typedef struct vsf_linux_gpio_chip_t {
55#endif
56
57#if VSF_USE_INPUT == ENABLED && VSF_INPUT_CFG_REGISTRATION_MECHANISM == ENABLED
58typedef struct vsf_linux_mouse_t {
62
63typedef struct vsf_linux_joystick_t {
65 // name MUST be initialized by user as result of JSIOCGNAME
66 const char *name;
68
72#endif
73
74#if VSF_USE_BTSTACK == ENABLED
75typedef struct vsf_linux_bthci_t {
76 const void *hci_transport_instance; // hci_transport_t
78 const void *chipset_instance; // btstack_chipset_t
79
80 void *__priv;
82#endif
83
84#if VSF_USE_UI == ENABLED && (defined(__VSF_LINUX_FS_CLASS_IMPLEMENT) || defined(__VSF_LINUX_FS_CLASS_INHERIT__))
85typedef struct vsf_linux_fb_priv_t {
86 implement(vsf_linux_fs_priv_t)
87 void *front_buffer;
88#if VSF_DISP_USE_FB == ENABLED
89 uint16_t is_disp_fb : 1;
90#endif
91 uint16_t is_area_set : 1;
92 uint16_t is_refreshing : 1;
93 uint16_t is_closing : 1;
94 uint16_t user_bits0 : 1;
95 uint16_t user_bits1 : 1;
96 uint16_t user_bits2 : 1;
97 uint16_t user_bits3 : 1;
98 uint16_t user_byte : 8;
99 int16_t frame_interval_ms;
100 vk_disp_area_t area;
101 vsf_trig_t fresh_trigger;
102 vsf_teda_t fresh_task;
103 vsf_eda_t *eda_pending;
104} vsf_linux_fb_priv_t;
105#endif
106
107/*============================ GLOBAL VARIABLES ==============================*/
108/*============================ LOCAL VARIABLES ===============================*/
109/*============================ PROTOTYPES ====================================*/
110
111#if VSF_HAL_USE_USART == ENABLED
112extern int vsf_linux_fs_bind_uart(char *path, vsf_usart_t *uart);
113#endif
114#if VSF_HAL_USE_I2C == ENABLED
115extern int vsf_linux_fs_bind_i2c(char *path, vsf_i2c_t *i2c);
116#endif
117#if VSF_HAL_USE_SPI == ENABLED
118extern int vsf_linux_fs_bind_spi(char *path, vsf_spi_t *spi);
119#endif
120#if VSF_HAL_USE_GPIO == ENABLED
121extern int vsf_linux_fs_bind_gpio(char *path, vsf_linux_gpio_chip_t *gpio_chip);
122# if VSF_HW_GPIO_COUNT > 0
123extern int vsf_linux_fs_bind_gpio_hw(char *path);
124# endif
125#endif
126
127#if VSF_USE_MAL == ENABLED
128typedef struct vk_mal_t vk_mal_t;
129extern int vsf_linux_fs_bind_mal(char *path, vk_mal_t *mal);
130#endif
131
132#if VSF_USE_INPUT == ENABLED && VSF_INPUT_CFG_REGISTRATION_MECHANISM == ENABLED
134extern int vsf_linux_fs_bind_mouse(char *path, vsf_linux_mouse_t *mouse);
135extern int vsf_linux_fs_bind_joystick(char *path, vsf_linux_joystick_t *joystick);
136# if VSF_LINUX_USE_TERMINAL_KEYBOARD == ENABLED
138# endif
139#endif
140
141#if VSF_USE_UI == ENABLED
142typedef struct vk_disp_t vk_disp_t;
143extern int vsf_linux_fs_bind_disp(char *path, vk_disp_t *disp);
144#endif
145
146#if VSF_USE_BTSTACK == ENABLED
147extern int vsf_linux_fs_bind_bthci(char *path, vsf_linux_bthci_t *bthci);
148#endif
149
150extern int vsf_linux_devfs_init(void);
151
152#ifdef __cplusplus
153}
154#endif
155
156/*============================ INCLUDES ======================================*/
157
158#if VSF_LINUX_DEVFS_USE_ALSA == ENABLED
160#endif
161
162#if VSF_USE_USB_DEVICE == ENABLED
164#endif
165
166#if VSF_LINUX_USE_DRM == ENABLED
167# include "./drm/vsf_linux_drm.h"
168#endif
169
170#endif // VSF_USE_LINUX && VSF_LINUX_USE_DEVFS
171#endif // __VSF_LINUX_FS_DEV_INTERNAL_H__
172/* EOF */
Definition vsf_disp.h:176
Definition vsf_input.h:114
mal class
Definition vsf_mal.h:168
Definition vsf_eda.h:769
Definition vsf_eda.h:867
Definition vsf_eda.h:837
unsigned short uint16_t
Definition stdint.h:7
short int16_t
Definition stdint.h:6
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_disp.h:146
Definition vsf_template_gpio.h:844
I2C instance structure for multi-class support.
Definition vsf_template_i2c.h:1056
Definition vsf_linux_devfs.h:75
void * hci_transport_config
Definition vsf_linux_devfs.h:77
const void * chipset_instance
Definition vsf_linux_devfs.h:78
const void * hci_transport_instance
Definition vsf_linux_devfs.h:76
void * __priv
Definition vsf_linux_devfs.h:80
Definition vsf_linux_devfs.h:51
uint8_t port_num
Definition vsf_linux_devfs.h:52
vsf_gpio_t * ports[0]
Definition vsf_linux_devfs.h:53
Definition vsf_linux_devfs.h:63
const char * name
Definition vsf_linux_devfs.h:66
vk_input_notifier_t notifier
Definition vsf_linux_devfs.h:64
Definition vsf_linux_devfs.h:58
vk_input_notifier_t notifier
Definition vsf_linux_devfs.h:59
float default_sensitivity
Definition vsf_linux_devfs.h:60
Definition vsf_linux_devfs.h:69
vk_input_notifier_t notifier
Definition vsf_linux_devfs.h:70
SPI instance structure, used for SPI Multi Class support, not needed in non Multi Class mode.
Definition vsf_template_spi.h:1131
USART instance structure Used for USART Multi Class support.
Definition vsf_template_usart.h:1138
int vsf_linux_fs_bind_spi(char *path, vsf_spi_t *spi)
Definition vsf_linux_devfs.c:984
int vsf_linux_fs_bind_uart(char *path, vsf_usart_t *uart)
Definition vsf_linux_devfs.c:387
int vsf_linux_fs_bind_mal(char *path, vk_mal_t *mal)
Definition vsf_linux_devfs.c:1071
int vsf_linux_fs_bind_terminal_keyboard(char *path, vsf_linux_terminal_keyboard_t *keyboard)
Definition vsf_linux_devfs.c:1818
int vsf_linux_devfs_init(void)
Definition vsf_linux_devfs.c:2515
int vsf_linux_fs_bind_mouse(char *path, vsf_linux_mouse_t *mouse)
Definition vsf_linux_devfs.c:1673
int vsf_linux_fs_bind_i2c(char *path, vsf_i2c_t *i2c)
Definition vsf_linux_devfs.c:758
int vsf_linux_fs_bind_gpio(char *path, vsf_linux_gpio_chip_t *gpio_chip)
Definition vsf_linux_devfs.c:2386
int vsf_linux_fs_bind_bthci(char *path, vsf_linux_bthci_t *bthci)
Definition vsf_linux_devfs.c:575
int vsf_linux_fs_bind_input(char *path, vk_input_notifier_t *notifier)
Definition vsf_linux_devfs.c:1627
int vsf_linux_fs_bind_disp(char *path, vk_disp_t *disp)
Definition vsf_linux_devfs.c:2195
int vsf_linux_fs_bind_joystick(char *path, vsf_linux_joystick_t *joystick)
Definition vsf_linux_devfs.c:1735
vk_input_notifier_t notifier
Definition vsf_xboot.c:31
Generated from commit: vsfteam/vsf@85be636