forked from alibaba/AliOS-Things
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BugID:16846667: added hal syscall APIs
Details: - Added hal adc/dac/flash/gpio/i2c/nand/nor/rtc/sd/spi syscall file in syscall/include, syscall/ksyscall, syscall/usyscall - Updated syscall/include/syscall_no.h - Updated syscall/ksyscall/ksyscall_tbl.c - Updated uspace/aos.mk Change-Id: I41f24d437f7fa8e3bfa5bd1a5a685036fe787cc2
- Loading branch information
1 parent
8221f34
commit 9f3b687
Showing
47 changed files
with
2,319 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_ADC_SYSCALL_ARG_H | ||
#define HAL_ADC_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/adc.h> | ||
|
||
typedef struct { | ||
adc_dev_t *adc; | ||
} hal_adc_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
adc_dev_t *adc; | ||
void *output; | ||
uint32_t timeout; | ||
} hal_adc_value_get_syscall_arg_t; | ||
|
||
typedef struct { | ||
adc_dev_t *adc; | ||
} hal_adc_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_ADC_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_DAC_SYSCALL_ARG_H | ||
#define HAL_DAC_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/dac.h> | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
} hal_dac_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
uint32_t channel; | ||
} hal_dac_start_syscall_arg_t; | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
uint32_t channel; | ||
} hal_dac_stop_syscall_arg_t; | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
uint32_t channel; | ||
uint32_t data; | ||
} hal_dac_set_value_syscall_arg_t; | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
uint32_t channel; | ||
} hal_dac_get_value_syscall_arg_t; | ||
|
||
typedef struct { | ||
dac_dev_t *dac; | ||
} hal_dac_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_DAC_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_FLASH_SYSCALL_ARG_H | ||
#define HAL_FLASH_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/flash.h> | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
} hal_flash_get_info_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
uint32_t off_set; | ||
uint32_t size; | ||
} hal_flash_erase_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
uint32_t *off_set; | ||
const void *in_buf; | ||
uint32_t in_buf_len; | ||
} hal_flash_write_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
uint32_t *off_set; | ||
const void *in_buf; | ||
uint32_t in_buf_len; | ||
} hal_flash_erase_write_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
uint32_t *off_set; | ||
const void *out_buf; | ||
uint32_t in_buf_len; | ||
} hal_flash_read_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t partition; | ||
uint32_t off_set; | ||
uint32_t size; | ||
} hal_flash_enable_secure_syscall_arg_t; | ||
|
||
typedef struct { | ||
hal_partition_t in_partition; | ||
uint32_t off_set; | ||
uint32_t size; | ||
} hal_flash_dis_secure_syscall_arg_t; | ||
|
||
#endif /* HAL_FLASH_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_GPIO_SYSCALL_ARG_H | ||
#define HAL_GPIO_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/gpio.h> | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_output_high_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_output_low_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_output_toggle_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
uint32_t *value; | ||
} hal_gpio_input_get_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
gpio_irq_trigger_t trigger; | ||
gpio_irq_handler_t handler; | ||
void *arg; | ||
} hal_gpio_enable_irq_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_disable_irq_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_clear_irq_syscall_arg_t; | ||
|
||
typedef struct { | ||
gpio_dev_t *gpio; | ||
} hal_gpio_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_GPIO_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_I2C_SYSCALL_ARG_H | ||
#define HAL_I2C_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/i2c.h> | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
} hal_i2c_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
uint16_t dev_addr; | ||
const uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_master_send_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
uint16_t dev_addr; | ||
uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_master_recv_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
const uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_slave_send_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_slave_recv_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
uint16_t dev_addr; | ||
uint16_t mem_addr; | ||
uint16_t mem_addr_size; | ||
const uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_mem_write_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
uint16_t dev_addr; | ||
uint16_t mem_addr; | ||
uint16_t mem_addr_size; | ||
uint8_t *data; | ||
uint16_t size; | ||
uint32_t timeout; | ||
} hal_i2c_mem_read_syscall_arg_t; | ||
|
||
typedef struct { | ||
i2c_dev_t *i2c; | ||
} hal_i2c_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_I2C_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_NAND_SYSCALL_ARG_H | ||
#define HAL_NAND_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/nand.h> | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
} hal_nand_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
nand_addr_t *addr; | ||
uint8_t *data; | ||
uint32_t page_count; | ||
} hal_nand_read_page_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
nand_addr_t *addr; | ||
uint8_t *data; | ||
uint32_t page_count; | ||
} hal_nand_write_page_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
nand_addr_t *addr; | ||
uint8_t *data; | ||
uint32_t data_len; | ||
} hal_nand_read_spare_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
nand_addr_t *addr; | ||
uint8_t *data; | ||
uint32_t data_len; | ||
} hal_nand_write_spare_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
nand_addr_t *addr; | ||
} hal_nand_erase_block_syscall_arg_t; | ||
|
||
typedef struct { | ||
nand_dev_t *nand; | ||
} hal_nand_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_NAND_SYSCALL_ARG_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#ifndef HAL_NOR_SYSCALL_ARG_H | ||
#define HAL_NOR_SYSCALL_ARG_H | ||
|
||
#include <aos/hal/nor.h> | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
} hal_nor_init_syscall_arg_t; | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
uint32_t *addr; | ||
uint8_t *data; | ||
uint32_t len; | ||
} hal_nor_read_syscall_arg_t; | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
uint32_t *addr; | ||
uint8_t *data; | ||
uint32_t len; | ||
} hal_nor_write_syscall_arg_t; | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
uint32_t *addr; | ||
uint32_t block_count; | ||
} hal_nor_erase_block_syscall_arg_t; | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
uint32_t *addr; | ||
} hal_nor_erase_chip_syscall_arg_t; | ||
|
||
typedef struct { | ||
nor_dev_t *nor; | ||
} hal_nor_finalize_syscall_arg_t; | ||
|
||
#endif /* HAL_NOR_SYSCALL_ARG_H */ | ||
|
Oops, something went wrong.