Uboot using GPIO

  • Using the command line

    # gpio output 12 0   // PAD_GPIO12 outputs low
    # gpio input 10      //Set PAD_GPIO10 as input
    # gpio get 10        //Gets the input level of PAD_GPIO10
    # gpio toggle 12     // For example, if PAD_GPIO12 outputs a low level before, then after executing a command, PAD_GPIO12 outputs a high level
  • Use the API

Set GPIO as input mode:
void MDrv_GPIO_Pad_Odn(MS_GPIO_NUM u32IndexGPIO);

Get the input level of GPIO:
U8 MDrv_GPIO_Pad_Read(MS_GPIO_NUM u32IndexGPIO);

Set GPIO to output mode:
void MDrv_GPIO_Pad_Oen(MS_GPIO_NUM u32IndexGPIO);

Output high level:
void MDrv_GPIO_Pull_High(MS_GPIO_NUM u32IndexGPIO);

Output low level:
void MDrv_GPIO_Pull_Low(MS_GPIO_NUM u32IndexGPIO);

文档更新时间: 2021-03-17 17:13   作者:Aeeditor