44 lines
1011 B
C
44 lines
1011 B
C
|
#include "hal_interface_gpio.h"
|
||
|
#include "hlog.h"
|
||
|
|
||
|
#define TAG "TAG_GPIO"
|
||
|
|
||
|
uint32_t hal_gpio_init(){
|
||
|
hlogi("%s ok", __func__);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
uint32_t hal_gpio_deinit(){
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
static int32_t gpio_output(int32_t argc, char **argv)
|
||
|
{
|
||
|
CHECK_LESS_RETURN(argc, 2);
|
||
|
{
|
||
|
int32_t io = atoi(argv[0]);
|
||
|
int32_t lvl = atoi(argv[1]);
|
||
|
hal_gpio_output(io, lvl);
|
||
|
hlogi("%s argc:%u io:%d, lvl:%d", __func__, argc, io, lvl);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
static int32_t gpio_input(int32_t argc, char **argv)
|
||
|
{
|
||
|
CHECK_LESS_RETURN(argc, 1);
|
||
|
{
|
||
|
int32_t io = atoi(argv[0]);
|
||
|
hal_gpio_input(io);
|
||
|
hlogi("%s argc:%u io:%d", __func__, argc, io);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
unittest_cmd g_ut_cmd_gpio[UT_CMDCNT_GPIO] =
|
||
|
{
|
||
|
DECLAR_UT_CMD(gpio_output, NULL, "output", "output 1 1/0"),
|
||
|
DECLAR_UT_CMD(gpio_input, NULL, "input", "No Param"),
|
||
|
};
|
||
|
|