it only test on those adi codecs ad198x which need 0.02 seconds for the measured impedance value become steady
according the specification
7.3.3.15 Pin Sense
The Pin Sense control returns the Presence Detect status, EDID-Like Data (ELD) Valid, and the impedance measurement of the device attached to the pin
Impedance returns the measured impedance of the widget. A returned value of 0x7FFF,FFFF (all 1‟s) indicates that a valid sense reading is not available, or the sense measurement is busy (refer to Section 7.3.1) if it has been recently triggered. This field is only valid if the widget has Sense capability as indicated by the “Impedance Sense Capable” bit of the Pin Capabilities parameter
for nid in codec.nodes:
node = codec.get_node(nid)
if WIDGET_TYPE_IDS[node.wtype] == 'PIN':
pd = " "
impedance = " "
if ((node.pincaps & 4) == 4):
if (node.pincaps & 2): codec.rw(nid, VERBS['SET_PIN_SENSE'], 0) time.sleep(0.02)
sense = codec.rw(nid, VERBS['GET_PIN_SENSE'], 0)
if (node.pincaps & 1):
impedance = "Imp=%d" % (sense & 0x7fffffff)
if (sense & 0x80000000):
pd = "PD=1"
else:
pd = "PD=0"
print "Pin 0x%.2x [%s] %s %s at %s (%s) %s : %s %s" % (nid, node.jack_conn_name, node.jack_type_name, node.jack_location_name, node.jack_location2_name, node.jack_color_name, node.defcfg_misc , pd, impedance)
it only test on those adi codecs ad198x which need 0.02 seconds for the measured impedance value become steady
according the specification
7.3.3.15 Pin Sense
The Pin Sense control returns the Presence Detect status, EDID-Like Data (ELD) Valid, and the impedance measurement of the device attached to the pin
Impedance returns the measured impedance of the widget. A returned value of 0x7FFF,FFFF (all 1‟s) indicates that a valid sense reading is not available, or the sense measurement is busy (refer to Section 7.3.1) if it has been recently triggered. This field is only valid if the widget has Sense capability as indicated by the “Impedance Sense Capable” bit of the Pin Capabilities parameter
for nid in codec.nodes: TYPE_IDS[ node.wtype] == 'PIN':
codec. rw(nid, VERBS[' SET_PIN_ SENSE'] , 0)
time. sleep(0. 02) GET_PIN_ SENSE'] , 0) conn_name, node.jack_ type_name, node.jack_ location_ name, node.jack_ location2_ name, node.jack_ color_name, node.defcfg_misc , pd, impedance)
node = codec.get_node(nid)
if WIDGET_
pd = " "
impedance = " "
if ((node.pincaps & 4) == 4):
if (node.pincaps & 2):
sense = codec.rw(nid, VERBS['
if (node.pincaps & 1):
impedance = "Imp=%d" % (sense & 0x7fffffff)
if (sense & 0x80000000):
pd = "PD=1"
else:
pd = "PD=0"
print "Pin 0x%.2x [%s] %s %s at %s (%s) %s : %s %s" % (nid, node.jack_