<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello<br>
<br>
<div class="moz-cite-prefix">Às 17:31 de 02-11-2015, Steve B
escreveu:<br>
</div>
<blockquote
cite="mid:CAEMXjGwF+BsdXOecJJ=YiO=i-PTamsPpeP5ys5QNFRN4SG7vCg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>I just looked at some sample code on Ketul's github,
and the source code of the API itself, rather than any
actual documentation.<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Documentation on the GPIO API can be found in
<a class="moz-txt-link-freetext" href="https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#RTEMSGPIOAPI">https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#RTEMSGPIOAPI</a><br>
<br>
<br>
<blockquote
cite="mid:CAEMXjGwF+BsdXOecJJ=YiO=i-PTamsPpeP5ys5QNFRN4SG7vCg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div><br>
</div>
I have already made calls to rtems_gpio_initialize() and
rtems_gpio_request_pin() as Ketul suggested.<br>
</div>
I am about to go on travel but I will attach my code once
tonight I get settled in, and maybe one of you can run it and
see if you agree with me on the symptom.<br>
<br>
</div>
Steve<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Oct 31, 2015 at 6:45 AM, Gedare
Bloom <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">This
problem indicates a lack of clear documentation. Steve,
where did<br>
you look for guidance on using the API?<br>
<div class="HOEnZb">
<div class="h5"><br>
On Sat, Oct 31, 2015 at 5:11 AM, Ketul Shah <<a
moz-do-not-send="true"
href="mailto:ketulshah1993@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:ketulshah1993@gmail.com">ketulshah1993@gmail.com</a></a>>
wrote:<br>
> Hi Steve,<br>
><br>
> I suggest you to kindly configure GPIO API by using
following functions in<br>
> your code,<br>
><br>
> rtems_gpio_initialize();<br>
> rtems_gpio_request_pin(.....);<br>
><br>
> After using it should work properly. Me and Ben had
tested on our BBBs.<br>
><br>
> For example code you can have a loot at link.<br>
><br>
> Hope this helps.<br>
><br>
> Thanks,<br>
><br>
> Ketul<br>
><br>
> On 31 October 2015 at 05:11, Steve B <<a
moz-do-not-send="true"
href="mailto:sbattazzo@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:sbattazzo@gmail.com">sbattazzo@gmail.com</a></a>>
wrote:<br>
>><br>
>> Hi again guys,<br>
>> I've noticed an unexpected (to me) behavior in
the GPIO API for Beaglebone<br>
>> Black.<br>
>><br>
>> I borrowed a periodic task from the clock test
source, and set it up to<br>
>> toggle the GPIOs once every couple seconds..
here's what I have:<br>
>><br>
>> rtems_task Test_task(<br>
>> rtems_task_argument task_index<br>
>> )<br>
>> {<br>
>> int task_count = 0;<br>
>> rtems_time_of_day time;<br>
>> rtems_interval ticks;<br>
>><br>
>> ticks = task_index * 2 *
rtems_clock_get_ticks_per_second();<br>
>><br>
>> for ( ; ; ) {<br>
>> task_count++;<br>
>> (void) rtems_clock_get_tod( &time );<br>
>> if ( time.second >= 35 ) {<br>
>> puts( "*** END OF CLOCK TICK TEST ***" );<br>
>> //exit( 0 );<br>
>> while(1);<br>
>> }<br>
>> put_name( Task_name[ task_index ], FALSE );<br>
>> print_time( " - rtems_clock_get_tod - ",
&time, "\n" );<br>
>><br>
>> //Toggle GPIO<br>
>> if(task_count & 1) {<br>
>> rtems_gpio_set(LED1);<br>
>> rtems_gpio_set(LED2);<br>
>> }<br>
>> else rtems_gpio_clear(LED1);<br>
>><br>
>> (void) rtems_task_wake_after( ticks );<br>
>> }<br>
>> }<br>
>><br>
>> Notice I've defined that if the least
significant bit of my variable<br>
>> task_count is 1, then I set both LED1 and LED2.
If that LSB is zero, I just<br>
>> call to clear LED1.<br>
>> When I actually run this, both LED1 and LED2
are being cleared! Same is<br>
>> true with the 3rd and 4th user LEDs as well, if
I happen to set all four of<br>
>> them. So I think somehow rtems_gpio_bsp_clear()
is clearing the entire bank,<br>
>> not just the single pin specified in the
argument. Can somebody confirm this<br>
>> behavior?<br>
>> I will dig around and see if I can figure out
why it's happening and<br>
>> generate a patch if I find it.<br>
>><br>
>> Also, I was hoping to be able to toggle a GPIO
output by checking its<br>
>> current state and using that to decide whether
to set or clear, but I don't<br>
>> see anything in the API that would allow me to
check the state of an output.<br>
>> Is this a known/intended limitation?<br>
>><br>
>> Cheers,<br>
>><br>
>> Steve<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> users mailing list<br>
>> <a moz-do-not-send="true"
href="mailto:users@rtems.org">users@rtems.org</a><br>
>> <a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"
rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> users mailing list<br>
> <a moz-do-not-send="true"
href="mailto:users@rtems.org">users@rtems.org</a><br>
> <a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"
rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@rtems.org">users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/mailman/listinfo/users</a></pre>
</blockquote>
<br>
--André Marques<br>
</body>
</html>