remove toggleBit method and add writeAndWaitForResetToZero parameter