You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.1 KiB
64 lines
2.1 KiB
4 months ago
|
/*
|
||
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2008-2019. All rights reserved.
|
||
|
* Description:supply the api for userspace application
|
||
|
*/
|
||
|
|
||
|
#include "uapi_gpio.h"
|
||
|
#include "mpi_gpio_ext.h"
|
||
|
|
||
|
td_s32 uapi_gpio_init(td_void)
|
||
|
{
|
||
|
return ext_mpi_gpio_init();
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_deinit(td_void)
|
||
|
{
|
||
|
return ext_mpi_gpio_deinit();
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_set_direction(td_u32 group_number, td_u32 bit_number, td_bool input)
|
||
|
{
|
||
|
return ext_mpi_gpio_set_direction(group_number, bit_number, input);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_get_direction(td_u32 group_number, td_u32 bit_number, td_bool *input)
|
||
|
{
|
||
|
return ext_mpi_gpio_get_direction(group_number, bit_number, input);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_write(td_u32 group_number, td_u32 bit_number, td_bool high_volt)
|
||
|
{
|
||
|
return ext_mpi_gpio_write(group_number, bit_number, high_volt);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_read(td_u32 group_number, td_u32 bit_number, td_bool *high_volt)
|
||
|
{
|
||
|
return ext_mpi_gpio_read(group_number, bit_number, high_volt);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_set_output_type(td_u32 group_number, td_u32 bit_number, uapi_gpio_output_type output_type)
|
||
|
{
|
||
|
return ext_mpi_gpio_set_output_type(group_number, bit_number, (ext_mpi_gpio_output_type)output_type);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_get_output_type(td_u32 group_number, td_u32 bit_number, uapi_gpio_output_type *output_type)
|
||
|
{
|
||
|
return ext_mpi_gpio_get_output_type(group_number, bit_number, (ext_mpi_gpio_output_type *)output_type);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_set_interrupt_type(td_u32 group_number, td_u32 bit_number,
|
||
|
uapi_gpio_interrupt_type interrupt_type)
|
||
|
{
|
||
|
return ext_mpi_gpio_set_interrupt_type(group_number, bit_number, (ext_mpi_gpio_interrupt_type)interrupt_type);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_set_interrupt_enable(td_u32 group_number, td_u32 bit_number, td_bool enable)
|
||
|
{
|
||
|
return ext_mpi_gpio_set_interrupt_enable(group_number, bit_number, enable);
|
||
|
}
|
||
|
|
||
|
td_s32 uapi_gpio_query_interrupt(td_u32 *group_number, td_u32 *bit_number, td_u32 timeout_ms)
|
||
|
{
|
||
|
return ext_mpi_gpio_query_interrupt(group_number, bit_number, timeout_ms);
|
||
|
}
|