Home > Software engineering >  Is there a way to program do not care bits in python for an embedded system?
Is there a way to program do not care bits in python for an embedded system?

Time:06-22

I am writing a driver for a DDS(AD9959, analog devices) chip in python. Some of the modes written in the datasheet require writing the register bits as do not care. What is the correct way to implement the same? I tried to use 'x', but the bits are not being written on the chip.

CodePudding user response:

The term "don't care" does not mean some special value for a bit. A bit can only be 0 or 1.

When reading it means that you can ignore the value. Commonly you mask it away.

When writing it means that you are free to choose any value. Most developers write a 0.

  • Related