for tris, 0 is output and 1 is input