XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_hal_posix.c 文件参考
#include "xf_hal_kernel_config.h"
#include "xf_hal_posix.h"
#include "xf_hal_dev.h"
#include <stdarg.h>
#include "../device/xf_hal_reg_table.inc"
xf_hal_posix.c 的引用(Include)关系图:

浏览源代码.

结构体

struct  dev_name_t
 

宏定义

#define DEV_STR_NUM   (sizeof(dev_str) / sizeof(const char *))
 
#define TAG   "hal_posix"
 
#define XF_HAL_TABLE_STR
 
#define FD_TO_ID(fd)   ((fd) & 0xffff)
 
#define FD_TO_TYPE(fd)   (((fd) >> 16) & 0xffff)
 
#define TYPE_ID_TO_FD(type, id)   (((type) << 16) | (id))
 

类型定义

typedef struct dev_name_t dev_name_t
 

函数

static const char * is_prefix (const char *substr, const char *str)
 
static bool _atoi (const char *src, uint16_t *num)
 
static bool name_to_type_and_id (const char *pathname, uint16_t *type, uint16_t *id)
 
int open (const char *pathname, int flags)
 
int ioctl (int fd, unsigned long request,...)
 
size_t write (int fd, const void *buf, size_t count)
 
size_t read (int fd, void *buf, size_t count)
 
int close (int fd)
 

变量

static const char * dev_str []
 

详细描述

作者
cangyu (sky.k.nosp@m.irto.nosp@m.@qq.c.nosp@m.om)
版本
0.1
日期
2024-05-10

在文件 xf_hal_posix.c 中定义.

宏定义说明

◆ DEV_STR_NUM

#define DEV_STR_NUM   (sizeof(dev_str) / sizeof(const char *))

在文件 xf_hal_posix.c24 行定义.

◆ TAG

#define TAG   "hal_posix"

在文件 xf_hal_posix.c25 行定义.

◆ XF_HAL_TABLE_STR

#define XF_HAL_TABLE_STR

◆ FD_TO_ID

#define FD_TO_ID (   fd)    ((fd) & 0xffff)

在文件 xf_hal_posix.c49 行定义.

◆ FD_TO_TYPE

#define FD_TO_TYPE (   fd)    (((fd) >> 16) & 0xffff)

在文件 xf_hal_posix.c50 行定义.

◆ TYPE_ID_TO_FD

#define TYPE_ID_TO_FD (   type,
  id 
)    (((type) << 16) | (id))

在文件 xf_hal_posix.c51 行定义.

类型定义说明

◆ dev_name_t

typedef struct dev_name_t dev_name_t

函数说明

◆ is_prefix()

static const char * is_prefix ( const char *  substr,
const char *  str 
)
static

在文件 xf_hal_posix.c198 行定义.

◆ _atoi()

static bool _atoi ( const char *  src,
uint16_t *  num 
)
static

在文件 xf_hal_posix.c210 行定义.

◆ name_to_type_and_id()

static bool name_to_type_and_id ( const char *  pathname,
uint16_t *  type,
uint16_t *  id 
)
static

在文件 xf_hal_posix.c225 行定义.

◆ open()

int open ( const char *  pathname,
int  flags 
)

在文件 xf_hal_posix.c55 行定义.

◆ ioctl()

int ioctl ( int  fd,
unsigned long  request,
  ... 
)

在文件 xf_hal_posix.c106 行定义.

◆ write()

size_t write ( int  fd,
const void *  buf,
size_t  count 
)

在文件 xf_hal_posix.c133 行定义.

◆ read()

size_t read ( int  fd,
void *  buf,
size_t  count 
)

在文件 xf_hal_posix.c154 行定义.

◆ close()

int close ( int  fd)

在文件 xf_hal_posix.c175 行定义.

变量说明

◆ dev_str

const char* dev_str[]
static
初始值:
= {
#define XF_HAL_TABLE_STR
}

在文件 xf_hal_posix.c42 行定义.