参照如下:
GPIO 分为4类模式 0是GPIO模式,其他根据datasheet 区别
GPIO DIR GPIO_DIR_IN =0输入 GPIO_DIR_OUT =1 输出 Default =GPIO_DIR_IN =0
是输入还是输出。
GPIO_PULLEN GPIO_PULL_DISABLE =0; GPIO_PULL_
ENABLE=1; Default =GPIO_PULL_ENABLE=1;
能否拉高或拉低、默认可以拉
if GPIO_PULL = GPIO_PULL_ENABLE;
then you can config GPIO_PULL_DOWN or GPIO_PULL_UP;
是上拉还是下拉
GPIO_PULL_DOWN=0; GPIO_PULL_UP=1 GPIO_PULL_Default =GPIO_PULL_DOWN =0;
GPIO_INVERSION
数据反响
GPIO_DATA_UNINV =0;
GPIO_DATA_INV =1
GPIO_DATA_INV_Default= GPIO_UNINV=0;
可以反向 GPIO_DATA_INV; 不可以反向 GPIO_DATA_UNINV=1;
默认不可以反向
if GPIO PIN is output pin then config High or Low
GPIO_OUT_ZERO =0 (Low)
GPIO_OUT_ONE = 1 (High)
GPIO_OUT_DEFAULT = GPIO_OUT_ZERO;
GPIO_CLKOUT
6573 have seven CLK OUT source;
1) CLK_OUT_UNSUPPORT =-1
CLK_OUT0,
CLK_OUT1,
.......
CLK_OUT7,
each clock out put source can be config as flow these mode
S32 mt_set_gpio_dir(pin,dir); return 0
S32 mt_get_gpio_dir(pin); return value is (out or in)
S32 mt_set_gpio_pull_enable(pin,enable); pin is gpio pin number; enable is gpio_pull_enable
S32 mt_get_gpio_pull_enable(pin); return is gpio enable;
S32 mt_set_gpio_pull_select(pin,enPull); en pull is GPIO_PULL is down or up;
S32 mt_get_gpio_pull_select(pin)l return GPIO_PULL (Down or up);
S32 mt_set_gpio_inversion(pin,unInv); UnInv is Uninversion or inversion;
S32 mt_get_gpio_inversion(pin);
S32 mt_set_gpio_out(pin,out); out is zero or high
S32 mt_get_gpio_out(pin); return is zero(0) or high(1)
S32 mt_get_gpio_in(pin) return is zero (0) or high (1)
S32 mt_set_gpio_in(pin,in) in is zero (0) or high (1)
S32 mt_set_gpio_mode(pin,mode);
S32 mt_get_gpio_mode(pin);
S32 mt_set_gpio_clock_output(CLKOUT, CLKsrc);