diff options
author | Nao Pross <naopross@thearcway.org> | 2018-05-05 18:35:39 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-05-05 18:35:39 +0200 |
commit | 7c6e90299de97b51f6ba17d1a50cedb824d0c82f (patch) | |
tree | 2a032bbec8a11e1b5f7a189ff2750936982576fc /hal/pin.tpp | |
parent | Fix split() (diff) | |
download | SAMLiquidSmoke-7c6e90299de97b51f6ba17d1a50cedb824d0c82f.tar.gz SAMLiquidSmoke-7c6e90299de97b51f6ba17d1a50cedb824d0c82f.zip |
Add gpio::is_set() to read from _latch register, update command parsing
Diffstat (limited to 'hal/pin.tpp')
-rw-r--r-- | hal/pin.tpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hal/pin.tpp b/hal/pin.tpp index 42d03de..527ba0a 100644 --- a/hal/pin.tpp +++ b/hal/pin.tpp @@ -52,6 +52,12 @@ unsigned io_pin<bit>::read() const } template<unsigned bit> +unsigned io_pin<bit>::is_set() const +{ + return (*_latch & (1<<bit)) ? 1 : 0; +} + +template<unsigned bit> void io_pin<bit>::set(unsigned s) { if (s > 0) |