Add bool read/write function and macro