From aca7de33288ebd9d382151027bbb70a7963ad8b1 Mon Sep 17 00:00:00 2001 From: "David M. Bryson" Date: Wed, 3 May 2017 19:42:02 -0700 Subject: [PATCH] Add support for directly setting the GPIO values --- src/HamShield.cpp | 4 ++++ src/HamShield.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/HamShield.cpp b/src/HamShield.cpp index 2de61bc..4dd559b 100644 --- a/src/HamShield.cpp +++ b/src/HamShield.cpp @@ -1060,6 +1060,10 @@ uint16_t HamShield::getGpioMode(uint16_t gpio){ return radio_i2c_buf[0]; } +void HamShield::setGpios(uint16_t mode){ + HSwriteWord(devAddr, A1846S_GPIO_MODE_REG, mode); +} + uint16_t HamShield::getGpios(){ HSreadWord(devAddr, A1846S_GPIO_MODE_REG, radio_i2c_buf); return radio_i2c_buf[0]; diff --git a/src/HamShield.h b/src/HamShield.h index 5a5f7a0..117ed21 100644 --- a/src/HamShield.h +++ b/src/HamShield.h @@ -440,6 +440,7 @@ class HamShield { void setGpioLow(uint16_t gpio); void setGpioHi(uint16_t gpio); uint16_t getGpioMode(uint16_t gpio); + void setGpios(uint16_t mode); uint16_t getGpios(); // Int