diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2013-11-25 18:54:37 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2013-11-25 18:54:37 +0100 |
commit | 043e8eb4929ca2078bba9aab3ca763beb429f237 (patch) | |
tree | 7753c982f8c8ed3a002c9a70265198bfdae51999 | |
parent | b1362aa792552373a6a2c028aefcc8a0878f09c6 (diff) |
Added PinArray::set_type().
-rw-r--r-- | gpio/gpio.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gpio/gpio.h b/gpio/gpio.h index 705f3cf..8eb2eea 100644 --- a/gpio/gpio.h +++ b/gpio/gpio.h @@ -165,6 +165,10 @@ class GPIO_t { g.reg.MODER = (g.reg.MODER & ~mask2()) | ((0x55555555 * m) & mask2()); } + void set_type(Pin::Type t) { + g.reg.OTYPER = (g.reg.OTYPER & ~mask2()) | ((0x55555555 * t) & mask2()); + } + void set_pull(Pin::Pull p) { g.reg.PUPDR = (g.reg.PUPDR & ~mask2()) | ((0x55555555 * p) & mask2()); } |