mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-07-06 18:55:39 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
52
Living_SDK/kernel/vfs/include/device/vfs_adc.h
Normal file
52
Living_SDK/kernel/vfs/include/device/vfs_adc.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_ADC_H
|
||||
#define AOS_VFS_ADC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* adc driver struct */
|
||||
extern const struct file_ops adc_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open adc device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_adc_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close adc device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_adc_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to complete the data sample and get the sampled value.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for sampled data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_adc_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_ADC_H */
|
||||
|
||||
26
Living_SDK/kernel/vfs/include/device/vfs_device.h
Normal file
26
Living_SDK/kernel/vfs/include/device/vfs_device.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_DEVICE_H
|
||||
#define AOS_VFS_DEVICE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_adc.h"
|
||||
#include "vfs_gpio.h"
|
||||
#include "vfs_i2c.h"
|
||||
#include "vfs_pwm.h"
|
||||
#include "vfs_rtc.h"
|
||||
#include "vfs_spi.h"
|
||||
#include "vfs_uart.h"
|
||||
#include "vfs_wdg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_DEVICE_H */
|
||||
|
||||
68
Living_SDK/kernel/vfs/include/device/vfs_gpio.h
Normal file
68
Living_SDK/kernel/vfs/include/device/vfs_gpio.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_GPIO_H
|
||||
#define AOS_VFS_GPIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* cmd for ioctl */
|
||||
#define IOCTL_GPIO_OUTPUT_HIGHT 1 /* output hight */
|
||||
#define IOCTL_GPIO_OUTPUT_LOW 2 /* output low */
|
||||
#define IOCTL_GPIO_OUTPUT_TOGGLE 3 /* toggle output */
|
||||
|
||||
/* gpio driver struct */
|
||||
extern const struct file_ops gpio_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open gpio device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_gpio_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close gpio device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_gpio_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to get data from gpio.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_gpio_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
/**
|
||||
* This function performs device input and output operations.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[in] cmd command of input and output operating.
|
||||
* @param[in] arg argument of input and output operating.
|
||||
*
|
||||
* @return 0 on success, negative on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_gpio_ioctl(file_t *fp, int cmd, unsigned long arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_GPIO_H */
|
||||
|
||||
64
Living_SDK/kernel/vfs/include/device/vfs_i2c.h
Normal file
64
Living_SDK/kernel/vfs/include/device/vfs_i2c.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_I2C_H
|
||||
#define AOS_VFS_I2C_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* i2c driver struct */
|
||||
extern const struct file_ops i2c_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open i2c device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_i2c_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close i2c device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_i2c_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to get data from i2c.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_i2c_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
/**
|
||||
* This function is used to send data through i2c.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes write on success,
|
||||
* 0 on write nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_i2c_write(file_t *fp, const void *buf, size_t nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_I2C_H */
|
||||
|
||||
55
Living_SDK/kernel/vfs/include/device/vfs_pwm.h
Normal file
55
Living_SDK/kernel/vfs/include/device/vfs_pwm.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_PWM_H
|
||||
#define AOS_VFS_PWM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* cmd for ioctl */
|
||||
#define IOCTL_PWM_OUTPUT_START 1 /* start output pwm */
|
||||
#define IOCTL_PWM_OUTPUT_STOP 2 /* stop output pwm */
|
||||
|
||||
/* pwm driver struct */
|
||||
extern const struct file_ops pwm_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open pwm device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_pwm_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close pwm device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_pwm_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function performs device input and output operations.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[in] cmd command of input and output operating.
|
||||
* @param[in] arg argument of input and output operating.
|
||||
*
|
||||
* @return 0 on success, negative on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_pwm_ioctl(file_t *fp, int cmd, unsigned long arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_PWM_H */
|
||||
|
||||
64
Living_SDK/kernel/vfs/include/device/vfs_rtc.h
Normal file
64
Living_SDK/kernel/vfs/include/device/vfs_rtc.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_RTC_H
|
||||
#define AOS_VFS_RTC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* rtc driver struct */
|
||||
extern const struct file_ops rtc_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open rtc device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_rtc_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close rtc device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_rtc_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to get Real-Time Clock.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_rtc_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
/**
|
||||
* This function is used to set Real-Time Clock.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes write on success,
|
||||
* 0 on write nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_rtc_write(file_t *fp, const void *buf, size_t nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_RTC_H */
|
||||
|
||||
64
Living_SDK/kernel/vfs/include/device/vfs_spi.h
Normal file
64
Living_SDK/kernel/vfs/include/device/vfs_spi.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_SPI_H
|
||||
#define AOS_VFS_SPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* spi driver struct */
|
||||
extern const struct file_ops spi_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open spi device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_spi_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close spi device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_spi_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to get data from spi.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_spi_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
/**
|
||||
* This function is used to send data through spi.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes write on success,
|
||||
* 0 on write nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_spi_write(file_t *fp, const void *buf, size_t nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_SPI_H */
|
||||
|
||||
64
Living_SDK/kernel/vfs/include/device/vfs_uart.h
Normal file
64
Living_SDK/kernel/vfs/include/device/vfs_uart.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_UART_H
|
||||
#define AOS_VFS_UART_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* uart driver struct */
|
||||
extern const struct file_ops uart_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open uart device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_uart_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close uart device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_uart_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to get data from uart.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes read on success,
|
||||
* 0 on read nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_uart_read(file_t *fp, void *buf, size_t nbytes);
|
||||
|
||||
/**
|
||||
* This function is used to send data through uart.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[out] buf data buffer for data.
|
||||
* @param[in] nbytes the maximum size of the user-provided buffer.
|
||||
*
|
||||
* @return The positive non-zero number of bytes write on success,
|
||||
* 0 on write nothing, or negative on failure with errno set appropriately.
|
||||
*/
|
||||
ssize_t vfs_uart_write(file_t *fp, const void *buf, size_t nbytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_UART_H */
|
||||
|
||||
54
Living_SDK/kernel/vfs/include/device/vfs_wdg.h
Normal file
54
Living_SDK/kernel/vfs/include/device/vfs_wdg.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef AOS_VFS_WDG_H
|
||||
#define AOS_VFS_WDG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vfs_inode.h"
|
||||
|
||||
/* cmd for ioctl */
|
||||
#define IOCTL_WDG_RELOAD 1 /* reload watchdog */
|
||||
|
||||
/* wdg driver struct */
|
||||
extern const struct file_ops wdg_ops;
|
||||
|
||||
/**
|
||||
* This function is used to open wdg device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_wdg_open(inode_t *inode, file_t *fp);
|
||||
|
||||
/**
|
||||
* This function is used to close wdg device.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
*
|
||||
* @return 0 on success, others on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_wdg_close(file_t *fp);
|
||||
|
||||
/**
|
||||
* This function performs device input and output operations.
|
||||
*
|
||||
* @param[in] fp device pointer.
|
||||
* @param[in] cmd command of input and output operating.
|
||||
* @param[in] arg argument of input and output operating.
|
||||
*
|
||||
* @return 0 on success, negative on failure with errno set appropriately.
|
||||
*/
|
||||
int vfs_wdg_ioctl(file_t *fp, int cmd, unsigned long arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AOS_VFS_WDG_H */
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue