Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Board.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GPIO_PIN(index, pin)   (((index) << 8) | (pin))
 
#define GPIO_REG(pin)   ((pin) >> 8)
 
#define GPIO_MASK(pin)   (1U << ((pin) & 0xff))
 

Detailed Description

Version
1.1

License

Copyright (C) 2017, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Definition in file Board.h.

Macro Definition Documentation

#define GPIO_MASK (   pin)    (1U << ((pin) & 0xff))

Return pin mask from board pin value.

Returns
pin mask

Definition at line 40 of file Board.h.

#define GPIO_PIN (   index,
  pin 
)    (((index) << 8) | (pin))

Board pin values are constructed from port control register index and pin bit position.

Parameters
[in]indexcontrol register index.
[in]pinpin bit position in control register.

Definition at line 28 of file Board.h.

#define GPIO_REG (   pin)    ((pin) >> 8)

Return port control register index from board pin value.

Returns
io port address

Definition at line 34 of file Board.h.