def burn_bit(esp, efuses, args): num_block = efuses.get_index_block_by_name(args.block) block = efuses.blocks[num_block] data_block = BitString(block.get_block_len() * 8) data_block.set(0) try: data_block.set(True, args.bit_number) except IndexError: raise esptool.FatalError("%s has bit_number in [0..%d]" % (args.block, data_block.len - 1)) data_block.reverse() print("bit_number: [%-03d]........................................................[0]" % (data_block.len - 1)) print("BLOCK%-2d :" % block.id, data_block) block.print_block(data_block, "regs_to_write", debug=True) block.save(data_block.bytes[::-1]) efuses.burn_all() print("Successful")
def bitreverse(N=256,nbit=9): """ Parameters ---------- N : ideally a power of 2 Returns ------- t : list of the N integers in time reverse order Notes ----- This function is used for example in buildGv. One error has been fixed by forbidding the value 0 The value 0 is not return """ t = [] for k in np.arange(N-1)+1: b = BitString(uint=k,length=nbit) b.reverse() b.ror(1) t.append(b.uint) return(np.array(t))
def bitreverse(N=256,nbit=9): """ Parameters ---------- N : ideally a power of 2 Returns ------- t : list of the N integers in time reverse order Notes ----- This function is used for example in buildGv. One error has been fixed by forbidding the value 0 The value 0 is not return """ t = [] for k in np.arange(N-1)+1: b = BitString(uint=k,length=nbit) b.reverse() #b.ror(1) t.append(b.uint) return(np.array(t))