Hi.
I am starting to use GPIO pins and ports.
I have read that I use :
const uint_32 puerto_set[]=
{
puertox_pin0|GPIO_PIN_STATUS_0,
puertox_pin1|GPIO_PIN_STATUS_0,
puertox_pin2|GPIO_PIN_STATUS_0,
puertox_pin3|GPIO_PIN_STATUS_0,
puertox_pin4|GPIO_PIN_STATUS_0,
puertox_pin5|GPIO_PIN_STATUS_0,
puertox_pin6|GPIO_PIN_STATUS_0,
puertox_pin7|GPIO_PIN_STATUS_0,
GPIO_LIST_END
};
If I want read:
puerto=fopen("gpio:read",(char_ptr)&puerto_set);
static const uint_32 data_a[]=
{
dato0,
dato1,
dato2,
dato3,
dato4,
dato5,
dato6,
dato7,
GPIO_LIST_END
}
ioctl(puerto,GPIO_IOCTL_READ,(char_ptr)&data_a);
In this case, I can read all the pins only once.
But when I want write, I only write pins one by one. For example:
puerto=fopen("gpio:write",(char_ptr)&puerto_set);
static const uint_32 data_b=
{
dato0,
GPIO_LIST_END
}
ioctl(puerto,GPIO_IOCTL_WRITE_LOG0,(char_ptr)&data_b);
I know that if change the last definition of "data_b", I can include some pins more. But I am interested to output the port in one go. All pins simultaneously. But, the value of the pins can be different at any time.
I want know what function carry out : output(data_a, puerto_set);
Do you understand me?
Thanks.
Message Edited by d.vara on 28-07-2009 02:37 PM