AnsweredAssumed Answered

A GPIO Programming problem

Question asked by yxd4038@sina.com on May 9, 2013
Latest reply on Jul 3, 2013 by yxd4038@sina.com

Hi, all

     I've got a bf518f-ezbrd.Now I write a simple prog to test GPIO, the source code is shown below.

 

 

#include <asm/gpio.h>
static __init int sample_module_init(void)
{
    int ret;

    ret = gpio_request(GPIO_PH7, "Sample Driver");
    if (ret) {
        printk(KERN_WARNING "sample_driver: unable to request GPIO_PH7\n");
        return ret;
    }

    return 0;
}
static __exit void sample_module_exit(void)
{
    gpio_free(GPIO_PH7);
}
void main(bool inp)
{
module_init(sample_module_init);
    gpio_direction_output(GPIO_PH7, 1);
    gpio_set_value(GPIO_PH7, inp);

module_exit(sample_module_exit);
}

 

but when i want to compile the prog the error is occuer.

 

root@debian:/adf518/systools# bfin-uclinux-gcc gpio.c -o gpio

gpio.c:1:22: error:asm/gpio.h:no such file or directory

 

what should  i do to test my gpio?

Outcomes