docs: def set_freq(self, fout, freq):
          """
          Sets new output frequency, required parameters are real current frequency at output and new required frequency.
          """
          hsdiv_tuple = (4, 5, 6, 7, 9, 11)           # possible dividers
          n1div_tuple = (1,) + tuple(range(2,129,2))  #
          fdco_min = 5670.0           # set maximum as minimum
          hsdiv = self.get_hs_div()   # read curent dividers
          n1div = self.get_n1_div()   #
  
          if abs((freq-fout)*1e6/fout) > 3500:  
              # Large change of frequency      
              fdco = fout * hsdiv * n1div # calculate high frequency oscillator
              fxtal =  fdco / self.get_rfreq()  # should be fxtal = 114.285        
          
              for hsdiv_iter in hsdiv_tuple:      # find dividers with minimal power consumption
                  for n1div_iter in n1div_tuple:
                      fdco_new = freq * hsdiv_iter * n1div_iter
                      if (fdco_new >= 4850) and (fdco_new <= 5670):
                          if (fdco_new <= fdco_min):
                              fdco_min = fdco_new        
                              hsdiv = hsdiv_iter
                              n1div = n1div_iter
              rfreq = fdco_min / fxtal        
          
              self.freeze_dco()       # write registers
              self.set_hs_div(hsdiv)
              self.set_n1_div(n1div)
              self.set_rfreq(rfreq)
              self.unfreeze_dco()
              self.new_freq()
          else:
              # Small change of frequency
              rfreq = self.get_rfreq() * (freq/fout)
  
              self.freeze_m()         # write registers           
              self.set_rfreq(rfreq)
              self.unfreeze_m()