[rtems commit] bsp/lpc24xx: Add lpc24xx_pin_get_first_index()

Sebastian Huber sebh at rtems.org
Fri Mar 14 07:55:25 UTC 2014


Module:    rtems
Branch:    master
Commit:    986ddf50c2c7328244110e8a47205400a26fda9d
Changeset: http://git.rtems.org/rtems/commit/?id=986ddf50c2c7328244110e8a47205400a26fda9d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb 21 14:03:50 2014 +0100

bsp/lpc24xx: Add lpc24xx_pin_get_first_index()

---

 c/src/lib/libbsp/arm/lpc24xx/include/io.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/c/src/lib/libbsp/arm/lpc24xx/include/io.h b/c/src/lib/libbsp/arm/lpc24xx/include/io.h
index 497d4a7..ade8545 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/include/io.h
+++ b/c/src/lib/libbsp/arm/lpc24xx/include/io.h
@@ -295,6 +295,16 @@ rtems_status_code lpc24xx_pin_config(
 );
 
 /**
+ * @brief Returns the first pin index of a pin range.
+ */
+static inline unsigned lpc24xx_pin_get_first_index(
+  const lpc24xx_pin_range *range
+)
+{
+  return LPC24XX_IO_INDEX_BY_PORT(range->fields.port, range->fields.port_bit);
+}
+
+/**
  * @name ADC Pins
  *
  * @{




More information about the vc mailing list