Andy K / Lib17_Core
Committer:
AjK
Date:
Mon Apr 11 15:39:47 2011 +0000
Revision:
1:2f99edb5545c
Parent:
0:127224866798
Child:
2:b77d327026af

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AjK 0:127224866798 1 /****************************************************************************
AjK 0:127224866798 2 * Product: LIB17 Open Source Library
AjK 0:127224866798 3 *
AjK 0:127224866798 4 * Steller Technologies Limited
AjK 0:127224866798 5 * ----------------------------
AjK 0:127224866798 6 *
AjK 0:127224866798 7 * Copyright (C) 2002-2011 Steller Technologies Limited. All rights reserved.
AjK 0:127224866798 8 *
AjK 0:127224866798 9 * This software may be distributed and modified under the terms of the GNU
AjK 0:127224866798 10 * General Public License version 2 (GPL) as published by the Free Software
AjK 0:127224866798 11 * Foundation and appearing in the file GPL.TXT included in the packaging of
AjK 0:127224866798 12 * this file. Please note that GPL Section 2[b] requires that all works based
AjK 0:127224866798 13 * on this software must also be made publicly available under the terms of
AjK 0:127224866798 14 * the GPL ("Copyleft").
AjK 0:127224866798 15 *
AjK 0:127224866798 16 * Alternatively, this software may be distributed and modified under the
AjK 0:127224866798 17 * terms of Steller Technologies Limited commercial licenses, which expressly
AjK 0:127224866798 18 * supersede the GPL and are specifically designed for licensees interested in
AjK 0:127224866798 19 * retaining the proprietary status of their code.
AjK 0:127224866798 20 *
AjK 1:2f99edb5545c 21 * $Id:$
AjK 1:2f99edb5545c 22 *
AjK 0:127224866798 23 ***************************************************************************/
AjK 0:127224866798 24
AjK 1:2f99edb5545c 25 /**
AjK 1:2f99edb5545c 26 * @file Lib17_DIO.h
AjK 1:2f99edb5545c 27 * @see http://cornflakes.wikidot.com/lib17:core
AjK 1:2f99edb5545c 28 * @defgroup API The Lib17 Core API
AjK 1:2f99edb5545c 29 * @defgroup Lib17_DIO Lib17_DIO functions
AjK 1:2f99edb5545c 30 */
AjK 1:2f99edb5545c 31
AjK 0:127224866798 32 #ifndef AJK_Lib17_DIO_H
AjK 0:127224866798 33 #define AJK_Lib17_DIO_H
AjK 0:127224866798 34
AjK 0:127224866798 35 #include "Lib17_Mbed.h"
AjK 0:127224866798 36 #include "Lib17_IOmacros.h"
AjK 0:127224866798 37
AjK 0:127224866798 38 namespace AjK {
AjK 0:127224866798 39
AjK 1:2f99edb5545c 40 /** Lib17_DIO - Adds pin input/output objects.
AjK 1:2f99edb5545c 41 *
AjK 1:2f99edb5545c 42 * The Mbed library supplies the DigitalIn and DigitalOut objects to allow you
AjK 1:2f99edb5545c 43 * to specify ins and outs.
AjK 1:2f99edb5545c 44 *
AjK 1:2f99edb5545c 45 * Lib17_DIO allows library objects to implement pins without the requirement
AjK 1:2f99edb5545c 46 * to link against the Mbed library. This increase portability when using
AjK 1:2f99edb5545c 47 * alternate compilers (such as the Code Red GCC C++ compiler for LPCXpresso).
AjK 1:2f99edb5545c 48 */
AjK 0:127224866798 49 class Lib17_DIO {
AjK 0:127224866798 50 public:
AjK 0:127224866798 51 enum Direction {
AjK 0:127224866798 52 Out = 0
AjK 0:127224866798 53 , In
AjK 0:127224866798 54 };
AjK 0:127224866798 55
AjK 0:127224866798 56 protected:
AjK 0:127224866798 57 PinName pin;
AjK 0:127224866798 58 uint32_t mask;
AjK 0:127224866798 59 uint32_t fiodir;
AjK 0:127224866798 60 uint32_t fiomask;
AjK 0:127224866798 61 uint32_t fiopin;
AjK 0:127224866798 62 uint32_t fioset;
AjK 0:127224866798 63 uint32_t fioclr;
AjK 0:127224866798 64
AjK 0:127224866798 65 inline void setpin(PinName p) { pin = p; }
AjK 0:127224866798 66 inline void setmask(PinName p) { mask = (uint32_t)(1UL << ((uint32_t)p & 0x1F)); }
AjK 0:127224866798 67 inline void setDir(PinName p) { fiodir = (uint32_t)(p & ~0x1F) + 0x00; }
AjK 0:127224866798 68 inline void setMask(PinName p) { fiomask = (uint32_t)(p & ~0x1F) + 0x10; }
AjK 0:127224866798 69 inline void setPin(PinName p) { fiopin = (uint32_t)(p & ~0x1F) + 0x14; }
AjK 0:127224866798 70 inline void setSet(PinName p) { fioset = (uint32_t)(p & ~0x1F) + 0x18; }
AjK 0:127224866798 71 inline void setClr(PinName p) { fioclr = (uint32_t)(p & ~0x1F) + 0x1C; }
AjK 0:127224866798 72
AjK 0:127224866798 73 inline void pinUp() { *((volatile uint32_t *)fioset) = mask; }
AjK 0:127224866798 74 inline void pinDn() { *((volatile uint32_t *)fioclr) = mask; }
AjK 0:127224866798 75 inline uint32_t pinIs() { return *((volatile uint32_t *)(fiopin)) & mask; }
AjK 0:127224866798 76
AjK 0:127224866798 77 public:
AjK 0:127224866798 78
AjK 0:127224866798 79 Lib17_DIO(PinName p, Direction d = Out, PinMode m = PullDown) { init(p, d, m); };
AjK 0:127224866798 80
AjK 1:2f99edb5545c 81 /**
AjK 1:2f99edb5545c 82 * write
AjK 1:2f99edb5545c 83 *
AjK 1:2f99edb5545c 84 * Writes a value to the pin.
AjK 1:2f99edb5545c 85 *
AjK 1:2f99edb5545c 86 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 87 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 88 * @ingroup API
AjK 1:2f99edb5545c 89 * @param i Zero makes the pin 0v, non-zero makes the pin 1.
AjK 1:2f99edb5545c 90 */
AjK 0:127224866798 91 void write(int i) { if (i!=0) { pinUp(); } else { pinDn(); } }
AjK 1:2f99edb5545c 92
AjK 1:2f99edb5545c 93 /**
AjK 1:2f99edb5545c 94 * read
AjK 1:2f99edb5545c 95 *
AjK 1:2f99edb5545c 96 * Reads the value on the pin.
AjK 1:2f99edb5545c 97 *
AjK 1:2f99edb5545c 98 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 99 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 100 * @ingroup API
AjK 1:2f99edb5545c 101 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 102 */
AjK 0:127224866798 103 int read(void) { return pinIs() ? 1 : 0; };
AjK 1:2f99edb5545c 104
AjK 1:2f99edb5545c 105 /**
AjK 1:2f99edb5545c 106 * output
AjK 1:2f99edb5545c 107 *
AjK 1:2f99edb5545c 108 * Setup the pin to be an output.
AjK 1:2f99edb5545c 109 *
AjK 1:2f99edb5545c 110 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 111 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 112 * @ingroup API
AjK 1:2f99edb5545c 113 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 114 */
AjK 0:127224866798 115 void output(void) { *((volatile uint32_t *)fiodir) |= mask; }
AjK 1:2f99edb5545c 116
AjK 1:2f99edb5545c 117 /**
AjK 1:2f99edb5545c 118 * input
AjK 1:2f99edb5545c 119 *
AjK 1:2f99edb5545c 120 * Setup the pin to be an input.
AjK 1:2f99edb5545c 121 *
AjK 1:2f99edb5545c 122 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 123 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 124 * @ingroup API
AjK 1:2f99edb5545c 125 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 126 */
AjK 0:127224866798 127 void input(void) { *((volatile uint32_t *)fiodir) &= ~mask; }
AjK 0:127224866798 128
AjK 1:2f99edb5545c 129 /**
AjK 1:2f99edb5545c 130 * getPin
AjK 1:2f99edb5545c 131 *
AjK 1:2f99edb5545c 132 * Get the PinName this object is operating on.
AjK 1:2f99edb5545c 133 *
AjK 1:2f99edb5545c 134 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 135 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 136 * @ingroup API
AjK 1:2f99edb5545c 137 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 138 */
AjK 0:127224866798 139 PinName getPin(void) { return pin; }
AjK 1:2f99edb5545c 140
AjK 1:2f99edb5545c 141 /**
AjK 1:2f99edb5545c 142 * getDirection
AjK 1:2f99edb5545c 143 *
AjK 1:2f99edb5545c 144 * Get the operational direction this pin is setup for.
AjK 1:2f99edb5545c 145 *
AjK 1:2f99edb5545c 146 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 147 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 148 * @ingroup API
AjK 1:2f99edb5545c 149 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 150 */
AjK 0:127224866798 151 int getDirection(void) { return *((volatile uint32_t *)fiomask) & mask ? 1 : 0; }
AjK 0:127224866798 152
AjK 1:2f99edb5545c 153 /**
AjK 1:2f99edb5545c 154 * operator int()
AjK 1:2f99edb5545c 155 *
AjK 1:2f99edb5545c 156 * Reads the value on the pin.
AjK 1:2f99edb5545c 157 *
AjK 1:2f99edb5545c 158 * @see read
AjK 1:2f99edb5545c 159 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 160 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 161 * @ingroup API
AjK 1:2f99edb5545c 162 * @return int 0v returns zero, otherwise returns 1.
AjK 1:2f99edb5545c 163 */
AjK 0:127224866798 164 operator int() { return read(); }
AjK 1:2f99edb5545c 165
AjK 1:2f99edb5545c 166 /**
AjK 1:2f99edb5545c 167 * operator=
AjK 1:2f99edb5545c 168 *
AjK 1:2f99edb5545c 169 * Writes a value to the pin.
AjK 1:2f99edb5545c 170 *
AjK 1:2f99edb5545c 171 * @see write
AjK 1:2f99edb5545c 172 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 173 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 174 * @ingroup API
AjK 1:2f99edb5545c 175 */
AjK 0:127224866798 176 Lib17_DIO& operator= (int value) { write(value); return *this; }
AjK 1:2f99edb5545c 177
AjK 1:2f99edb5545c 178 /**
AjK 1:2f99edb5545c 179 * operator=
AjK 1:2f99edb5545c 180 *
AjK 1:2f99edb5545c 181 * Writes a value to the pin.
AjK 1:2f99edb5545c 182 *
AjK 1:2f99edb5545c 183 * @see write
AjK 1:2f99edb5545c 184 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 185 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 186 * @ingroup API
AjK 1:2f99edb5545c 187 */
AjK 0:127224866798 188 Lib17_DIO& operator= (Lib17_DIO& rhs) { write(rhs.read()); return *this; }
AjK 0:127224866798 189
AjK 1:2f99edb5545c 190 /**
AjK 1:2f99edb5545c 191 * getMask
AjK 1:2f99edb5545c 192 *
AjK 1:2f99edb5545c 193 * Get the mask value for this pin.
AjK 1:2f99edb5545c 194 *
AjK 1:2f99edb5545c 195 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 196 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 197 * @ingroup API
AjK 1:2f99edb5545c 198 * @return uint32_t The mask value used by this pin.
AjK 1:2f99edb5545c 199 */
AjK 0:127224866798 200 uint32_t getMask(void) { return mask; }
AjK 1:2f99edb5545c 201
AjK 1:2f99edb5545c 202 /**
AjK 1:2f99edb5545c 203 * getFiodir
AjK 1:2f99edb5545c 204 *
AjK 1:2f99edb5545c 205 * Get the FIODIR register for the port the pin is on.
AjK 1:2f99edb5545c 206 *
AjK 1:2f99edb5545c 207 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 208 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 209 * @ingroup API
AjK 1:2f99edb5545c 210 * @return uint32_t The register value.
AjK 1:2f99edb5545c 211 */
AjK 0:127224866798 212 uint32_t getFiodir(void) { return fiodir; }
AjK 1:2f99edb5545c 213
AjK 1:2f99edb5545c 214 /**
AjK 1:2f99edb5545c 215 * getFiomask
AjK 1:2f99edb5545c 216 *
AjK 1:2f99edb5545c 217 * Get the FIOMASK register for the port the pin is on.
AjK 1:2f99edb5545c 218 *
AjK 1:2f99edb5545c 219 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 220 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 221 * @ingroup API
AjK 1:2f99edb5545c 222 * @return uint32_t The register value.
AjK 1:2f99edb5545c 223 */
AjK 0:127224866798 224 uint32_t getFiomask(void) { return fiomask; }
AjK 1:2f99edb5545c 225
AjK 1:2f99edb5545c 226 /**
AjK 1:2f99edb5545c 227 * getFiopin
AjK 1:2f99edb5545c 228 *
AjK 1:2f99edb5545c 229 * Get the FIOPIN register for the port the pin is on.
AjK 1:2f99edb5545c 230 *
AjK 1:2f99edb5545c 231 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 232 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 233 * @ingroup API
AjK 1:2f99edb5545c 234 * @return uint32_t The register value.
AjK 1:2f99edb5545c 235 */
AjK 0:127224866798 236 uint32_t getFiopin(void) { return fiopin; }
AjK 1:2f99edb5545c 237
AjK 1:2f99edb5545c 238 /**
AjK 1:2f99edb5545c 239 * getFioset
AjK 1:2f99edb5545c 240 *
AjK 1:2f99edb5545c 241 * Get the FIOSET register for the port the pin is on.
AjK 1:2f99edb5545c 242 *
AjK 1:2f99edb5545c 243 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 244 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 245 * @ingroup API
AjK 1:2f99edb5545c 246 * @return uint32_t The register value.
AjK 1:2f99edb5545c 247 */
AjK 0:127224866798 248 uint32_t getFioset(void) { return fioset; }
AjK 1:2f99edb5545c 249
AjK 1:2f99edb5545c 250 /**
AjK 1:2f99edb5545c 251 * getFioclr
AjK 1:2f99edb5545c 252 *
AjK 1:2f99edb5545c 253 * Get the FIOCLR register for the port the pin is on.
AjK 1:2f99edb5545c 254 *
AjK 1:2f99edb5545c 255 * @see http://cornflakes.wikidot.com/lib17:core:lib17-dio
AjK 1:2f99edb5545c 256 * @ingroup Lib17_DIO
AjK 1:2f99edb5545c 257 * @ingroup API
AjK 1:2f99edb5545c 258 * @return uint32_t The register value.
AjK 1:2f99edb5545c 259 */
AjK 0:127224866798 260 uint32_t getFioclr(void) { return fioclr; }
AjK 0:127224866798 261
AjK 0:127224866798 262
AjK 0:127224866798 263 protected:
AjK 0:127224866798 264 void init(PinName p, Direction d, PinMode m)
AjK 0:127224866798 265 {
AjK 0:127224866798 266 // We rely on the fact that by default the LPC1768
AjK 0:127224866798 267 // sets all pins to be GPIO. The user will change
AjK 0:127224866798 268 // that if they need to. So we don't bother trying
AjK 0:127224866798 269 // to setup PINSELx
AjK 0:127224866798 270
AjK 0:127224866798 271 // psel(); // Not used, see above.
AjK 0:127224866798 272
AjK 0:127224866798 273 setpin(p);
AjK 0:127224866798 274 setmask(p);
AjK 0:127224866798 275 setDir(p);
AjK 0:127224866798 276 setMask(p);
AjK 0:127224866798 277 setPin(p);
AjK 0:127224866798 278 setSet(p);
AjK 0:127224866798 279 setClr(p);
AjK 0:127224866798 280
AjK 0:127224866798 281 if (d == Out) output();
AjK 0:127224866798 282 else mode( m );
AjK 0:127224866798 283 }
AjK 0:127224866798 284
AjK 0:127224866798 285 protected:
AjK 0:127224866798 286 void psel(void)
AjK 0:127224866798 287 {
AjK 0:127224866798 288 uint32_t ppsel, pumask;
AjK 0:127224866798 289
AjK 0:127224866798 290 if (pin >= P0_0 && pin <= P0_15) ppsel = (uint32_t)(&LPC_PINCON->PINSEL0);
AjK 0:127224866798 291 else if (pin >= P0_16 && pin <= P0_31) ppsel = (uint32_t)(&LPC_PINCON->PINSEL1);
AjK 0:127224866798 292 else if (pin >= P1_0 && pin <= P1_15) ppsel = (uint32_t)(&LPC_PINCON->PINSEL2);
AjK 0:127224866798 293 else if (pin >= P1_16 && pin <= P1_31) ppsel = (uint32_t)(&LPC_PINCON->PINSEL3);
AjK 0:127224866798 294 else if (pin >= P2_0 && pin <= P2_15) ppsel = (uint32_t)(&LPC_PINCON->PINSEL4);
AjK 0:127224866798 295 else if (pin >= P3_16 && pin <= P3_31) ppsel = (uint32_t)(&LPC_PINCON->PINSEL7);
AjK 0:127224866798 296 else if (pin >= P4_16 && pin <= P4_31) ppsel = (uint32_t)(&LPC_PINCON->PINSEL9);
AjK 0:127224866798 297 else return;
AjK 0:127224866798 298
AjK 0:127224866798 299 pumask = ~(3UL << ((pin & 0x1F)>>1));
AjK 0:127224866798 300 *((volatile uint32_t *)ppsel) &= pumask;
AjK 0:127224866798 301 }
AjK 0:127224866798 302
AjK 0:127224866798 303 public:
AjK 0:127224866798 304 void mode(PinMode m)
AjK 0:127224866798 305 {
AjK 0:127224866798 306 uint32_t ppmod, pumask;
AjK 0:127224866798 307
AjK 0:127224866798 308 if (m == OpenDrain) {
AjK 0:127224866798 309 openDrain(1);
AjK 0:127224866798 310 }
AjK 0:127224866798 311 else {
AjK 0:127224866798 312 if (pin >= P0_0 && pin <= P0_15) {
AjK 0:127224866798 313 ppmod = (uint32_t)(&LPC_PINCON->PINMODE0);
AjK 0:127224866798 314 pumask = ((m & 0x3) << ( ((pin & 0x1F)-0)*2) );
AjK 0:127224866798 315 }
AjK 0:127224866798 316 else if (pin >= P0_16 && pin <= P0_31) {
AjK 0:127224866798 317 ppmod = (uint32_t)(&LPC_PINCON->PINMODE1);
AjK 0:127224866798 318 pumask = ((m & 0x3) << ( ((pin & 0x1F)-16)*2) );
AjK 0:127224866798 319 }
AjK 0:127224866798 320 else if (pin >= P1_0 && pin <= P1_15) {
AjK 0:127224866798 321 ppmod = (uint32_t)(&LPC_PINCON->PINMODE2);
AjK 0:127224866798 322 pumask = ((m & 0x3) << ( ((pin & 0x1F)-0)*2) );
AjK 0:127224866798 323 }
AjK 0:127224866798 324 else if (pin >= P1_16 && pin <= P1_31) {
AjK 0:127224866798 325 ppmod = (uint32_t)(&LPC_PINCON->PINMODE3);
AjK 0:127224866798 326 pumask = ((m & 0x3) << ( ((pin & 0x1F)-16)*2) );
AjK 0:127224866798 327 }
AjK 0:127224866798 328 else if (pin >= P2_0 && pin <= P2_15) {
AjK 0:127224866798 329 ppmod = (uint32_t)(&LPC_PINCON->PINMODE4);
AjK 0:127224866798 330 pumask = ((m & 0x3) << ( ((pin & 0x1F)-0)*2) );
AjK 0:127224866798 331 }
AjK 0:127224866798 332 else if (pin >= P3_16 && pin <= P3_31) {
AjK 0:127224866798 333 ppmod = (uint32_t)(&LPC_PINCON->PINMODE7);
AjK 0:127224866798 334 pumask = ((m & 0x3) << ( ((pin & 0x1F)-16)*2) );
AjK 0:127224866798 335 }
AjK 0:127224866798 336 else if (pin >= P4_16 && pin <= P4_31) {
AjK 0:127224866798 337 ppmod = (uint32_t)(&LPC_PINCON->PINMODE9);
AjK 0:127224866798 338 pumask = ((m & 0x3) << ( ((pin & 0x1F)-16)*2) );
AjK 0:127224866798 339 }
AjK 0:127224866798 340 else return;
AjK 0:127224866798 341
AjK 0:127224866798 342 *((volatile uint32_t *)ppmod) |= pumask;
AjK 0:127224866798 343 }
AjK 0:127224866798 344 }
AjK 0:127224866798 345
AjK 0:127224866798 346 public:
AjK 0:127224866798 347 void openDrain(int i = 1)
AjK 0:127224866798 348 {
AjK 0:127224866798 349 if (pin >= P0_0 && pin <= P0_31) { if (i) LPC_PINCON->PINMODE_OD0 |= mask; else LPC_PINCON->PINMODE_OD0 &= ~mask; }
AjK 0:127224866798 350 else if (pin >= P1_0 && pin <= P1_31) { if (i) LPC_PINCON->PINMODE_OD1 |= mask; else LPC_PINCON->PINMODE_OD1 &= ~mask; }
AjK 0:127224866798 351 else if (pin >= P2_0 && pin <= P2_31) { if (i) LPC_PINCON->PINMODE_OD2 |= mask; else LPC_PINCON->PINMODE_OD2 &= ~mask; }
AjK 0:127224866798 352 else if (pin >= P3_16 && pin <= P3_31) { if (i) LPC_PINCON->PINMODE_OD3 |= mask; else LPC_PINCON->PINMODE_OD3 &= ~mask; }
AjK 0:127224866798 353 else if (pin >= P4_16 && pin <= P4_31) { if (i) LPC_PINCON->PINMODE_OD4 |= mask; else LPC_PINCON->PINMODE_OD4 &= ~mask; }
AjK 0:127224866798 354 }
AjK 0:127224866798 355
AjK 0:127224866798 356 };
AjK 0:127224866798 357
AjK 0:127224866798 358 }; /* namespace AjK ends. */
AjK 0:127224866798 359
AjK 0:127224866798 360 using namespace AjK;
AjK 0:127224866798 361
AjK 0:127224866798 362 #endif /* AJK_Lib17_DIO_H */