Merge pull request #34 from dmbryson/setgpios

Add support for directly setting the GPIO values
This commit is contained in:
Morgan Redfield 2017-09-05 20:38:30 -07:00 committed by GitHub
commit 23c8c85b98
2 changed files with 5 additions and 0 deletions

View File

@ -1061,6 +1061,10 @@ uint16_t HamShield::getGpioMode(uint16_t gpio){
return radio_i2c_buf[0]; return radio_i2c_buf[0];
} }
void HamShield::setGpios(uint16_t mode){
HSwriteWord(devAddr, A1846S_GPIO_MODE_REG, mode);
}
uint16_t HamShield::getGpios(){ uint16_t HamShield::getGpios(){
HSreadWord(devAddr, A1846S_GPIO_MODE_REG, radio_i2c_buf); HSreadWord(devAddr, A1846S_GPIO_MODE_REG, radio_i2c_buf);
return radio_i2c_buf[0]; return radio_i2c_buf[0];

View File

@ -403,6 +403,7 @@ class HamShield {
void setGpioLow(uint16_t gpio); void setGpioLow(uint16_t gpio);
void setGpioHi(uint16_t gpio); void setGpioHi(uint16_t gpio);
uint16_t getGpioMode(uint16_t gpio); uint16_t getGpioMode(uint16_t gpio);
void setGpios(uint16_t mode);
uint16_t getGpios(); uint16_t getGpios();
// Int // Int