Pin Reading
Gedare Bloom
gedare at rtems.org
Wed Apr 4 15:27:23 UTC 2012
On Wed, Apr 4, 2012 at 9:29 AM, Binkowski, Cassio <cassioiks at gmail.com> wrote:
> On Mon, Apr 2, 2012 at 10:34 AM, Binkowski, Cassio <cassioiks at gmail.com>
> wrote:
>>
>> On Mon, Apr 2, 2012 at 9:58 AM, Sebastian Huber
>> <sebastian.huber at embedded-brains.de> wrote:
>>>
>>> On 04/02/2012 02:45 PM, Binkowski, Cassio wrote:
>>>>
>>>> Hi Sebastian,
>>>>
>>>> I'm interested in three of them: ARM, AVR and SPARC.
>>>>
>>>> But if I want any other board, is there a way of looking for this
>>>> information?
>>>
>>>
>>> You have to look in the BSP source code, e.g. the header files. The
>>> lpc24xx ARM BSP has for example this API:
>>>
>>> http://git.rtems.org/rtems/tree/c/src/lib/libbsp/arm/lpc24xx/include/io.h
>>
>>
>> I'm afraid I didn't find any READ method.
>> I found just a GET, and it returns a boolean:
>>
>>
>> static inline bool lpc24xx_gpio_get(unsigned index)
>> {
>> if (index <= LPC24XX_IO_INDEX_MAX) {
>> unsigned port = LPC24XX_IO_PORT(index);
>> unsigned bit = LPC24XX_IO_PORT_BIT(index);
>>
>> return (LPC24XX_FIO [port].pin & (1U << bit)) != 0;
>> } else {
>> return false;
>> }
>>
>> }
>>
>> Can you advise?
>
>
> Any thoughts on this?
Unless I'm mistaken this will check the status of a specific gpio pin
(on/off) and return that status. So it is in essence 'reading' the
pin...
>
> Thanks.
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>
More information about the users
mailing list