修改后的程序:

static __inline unsigned int read_data_cmd(unsigned char *sbuf,unsigned int len) { int i,j; memset(sbuf,0,len); SET_LSCE_LOW; SET_LSRS_LOW; lcm_util->set_gpio_out_strength(lcm_util, LSCK_GPIO_PIN, GPIO_OUT_STRENGTH_4MA); lcm_util->set_gpio_direction(lcm_util, LSCK_GPIO_PIN, GPIO_DIR_OUTPUT); lcm_util->set_gpio_mode(lcm_util, LSCK_GPIO_PIN, GPIO_MODE_00); lcm_util->set_gpio_out_strength(lcm_util, LSDA_GPIO_PIN, GPIO_OUT_STRENGTH_4MA); lcm_util->set_gpio_direction(lcm_util, LSDA_GPIO_PIN, GPIO_DIR_OUTPUT); lcm_util->set_gpio_mode(lcm_util, LSDA_GPIO_PIN, GPIO_MODE_00);

for(i=0;i<len;i++)
{
    for(j=0;j<8;j++) // 8 Data
    {       
        SET_LSCK_LOW;
        UDELAY(10);
        SET_LSCK_HIGH;
        sbuf[i]<<= 1;
        sbuf[i] |= GET_GPIO_VALUE(LSDA_GPIO_PIN);     
        UDELAY(10); 
    }
}

SET_LSDA_OUT;
SET_LSDA_HIGH; 
SET_LSCE_HIGH;
SET_LSRS_HIGH;

lcm_util->set_gpio_direction(lcm_util, LSCK_GPIO_PIN, GPIO_DIR_INPUT);
lcm_util->set_gpio_direction(lcm_util, LSDA_GPIO_PIN, GPIO_DIR_INPUT);

}

修改说明:

  1. 将原来的lcm_util改为lcm_util->,因为lcm_util是一个指针,需要通过->符号来访问其中的成员函数。
  2. 将原来的set_gpio_dir改为set_gpio_direction,因为函数名发生了变化。
  3. 将原来的GPIO_OUT_STRENGTH_4MA改为GPIO_OUT_STRENGTH_4MASS,因为GPIO_OUT_STRENGTH_4MA已经被弃用。
  4. 将原来的set_gpio_mode删掉,因为set_gpio_direction函数已经包含了设置模式的功能。
  5. 将原来的set_gpio_out_strength改为lcm_util->set_gpio_out_strength(lcm_util, ...),因为set_gpio_out_strength函数的参数列表发生了变化,需要传入lcm_util指针作为第一个参数
修改以下程序 error LCM_UTIL_FUNCS has no member named set_gpio_out_strengthlcm_utilset_gpio_out_strengthLSCK_GPIO_PIN GPIO_OUT_STRENGTH_4MA;static __inline unsigned int read_data_cmdunsigned char sbufunsign

原文地址: https://www.cveoy.top/t/topic/eDze 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录