gt9271-device

ivanmason/gt9271/gt9271-device

No description
gt9271-device
@/gt9271-device
I2Cxod/i2c/i2c
gt9271-device
DONE
I2C
DONEpulse
To use the node in your project you should have the ivanmason/gt9271 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

unsigned char  GTP_CFG_DATA[] =
{
    0x63,0x00,0x04,0x58,0x02,0x0A,0x3D,0x00,
    0x01,0x08,0x28,0x0F,0x50,0x32,0x03,0x05,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x17,
    0x19,0x1D,0x14,0x90,0x2F,0x89,0x23,0x25,
    0xD3,0x07,0x00,0x00,0x00,0x02,0x03,0x1D,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x19,0x32,0x94,0xD5,0x02,
    0x07,0x00,0x00,0x04,0xA2,0x1A,0x00,0x90,
    0x1E,0x00,0x80,0x23,0x00,0x73,0x28,0x00,
    0x68,0x2E,0x00,0x68,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x16,0x15,0x14,0x11,0x10,0x0F,0x0E,0x0D,
    0x0C,0x09,0x08,0x07,0x06,0x05,0x04,0x01,
    0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x29,0x28,
    0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20,
    0x1F,0x1E,0x1C,0x1B,0x19,0x14,0x13,0x12,
    0x11,0x10,0x0F,0x0E,0x0D,0x0C,0x0A,0x08,
    0x07,0x06,0x04,0x02,0x00,0xFF,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x71,0x01
};

void evaluate(Context ctx) {
    if (!isSettingUp())
        return;

    auto wire = getValue<input_I2C>(ctx);

    ::pinMode(7,OUTPUT);
    ::digitalWrite(10,LOW);
    ::digitalWrite(7,LOW);
    delay(2);
    ::digitalWrite(10,HIGH);
    delay(20);
    ::pinMode(7,INPUT);
    delay(50);

    uint8_t retry=0;
    uint16_t i=0;
	for(retry=0;retry<5;retry++)
	{
		wire->beginTransmission(0x14);
        wire->write( 0x8047>>8 );  // register 0
        wire->write( 0x8047);  // register 0 
	    for(i=0;i<sizeof(GTP_CFG_DATA);i++)//data
	    {
          wire->write(GTP_CFG_DATA[i] );  // value
	    }
        uint8_t retVal = wire->endTransmission(); 
		delay(10);
	}
    emitValue<output_DONE>(ctx, 1);
}