Third idea: create our own hw independent ranges and define the
meaning of the bits (we could use 16 bit, for example).
Better, let decide that bit 31 means auto-sr and use 16 or 24
or 30 bits for ranges.That is:
if (bit31==0) (bit29-bit0)=symbol rate in baud
if (bit31==1) (bit29-bit0)=symbol rate range mask
bit30 reserved for future use, must be 0
Yes, I like it.
We could define the ranges directly or in relation to sr_min and
sr_max, but with 30 bits I'd avoid this extra complication.
We could have ranges coded this way
SR_SEARCH_RANGES 1<<31
SR_RESERVED_MUST_BE_0 1<<30
SR_RANGE_30M_25M 1<<29
SR_RANGE_25M_20M 1<<28
...
SR_RANGE_6M_5M 1<<12
SR_RANGE_5M_4M 1<<11
...
SR_RANGE_500k_300k 1<<0
and use (SR_AUTO|SR_30M_25M|SR_6M_5M) in apps.
sounds hard to use. I would prefer the approach similiar to thy Zarlink
Evalsoftware: pass the frequency and symbol rate ranges to the driver
and then get interrupted/notified as soon something is found, thenafter
continue there.