A.writeGPIO(2, 2, 1, 0); // pin 2 is set to 1 pin 3 is set to 0 the rest is unchanged.
void ADS1256::setGPIO(uint8_t dir0, uint8_t dir1, uint8_t dir2, uint8_t dir3) //Setting GPIO
{
_GPIO = readRegister(IO_REG); //Read the most recent value of the register
A.writeGPIO(2, 2, 1, 0); // pin 2 is set to 1 pin 3 is set to 0 the rest is unchanged.
void ADS1256::setGPIO(uint8_t dir0, uint8_t dir1, uint8_t dir2, uint8_t dir3) //Setting GPIO {
_GPIO = readRegister(IO_REG); //Read the most recent value of the register
//Bit7: DIR3 if (dir3 != 2) { if(dir3 == 1) { GPIO_bit7 = 1; //D3 is input (default) } else { GPIO_bit7 = 0; //D3 is output }
bitWrite(_GPIO, 7, GPIO_bit7); //----------------------------------------------------- } if (dir2 != 2) { //Bit6: DIR2 if(dir2 == 1) { GPIO_bit6 = 1; //D2 is input (default) } else { GPIO_bit6 = 0; //D2 is output } bitWrite(_GPIO, 6, GPIO_bit6);