parameters: (self, addr, val)
docstring: reg_write writes val to the addr in the regmap
docstring_summary: reg_write writes val to the addr in the regmap
docstring_tokens: reg_write writes val to the addr in the regmap
function: def reg_write(self, addr, val):
          """reg_write writes val to the addr in the regmap"""
  
          for range_dict in self.ranges:
              if range_dict['min'] <= addr <= range_dict['max']:
                  break
  
          else:
              sys.exit("bad write address")
  
          with open(self.registers_path, 'rb+') as _file:
              _file.write("{:x} {:x}".format(addr, val).encode())
function_tokens: def reg_write ( self , addr , val ) : for range_dict in self . ranges : if range_dict [ 'min' ] <= addr <= range_dict [ 'max' ] : break else : sys . exit ( "bad write address" ) with open ( self . registers_path , 'rb+' ) as _file : _file . write ( "{:x} {:x}" . format ( addr , val ) . encode ( ) )