Module zio :: Class DAC

Class DAC

object --+        
         |        
    Module --+    
             |    
        Analog --+
                 |
                DAC

DAC class is used to drive analog output pins, usually used for generating waveforms, audio signals, etc.
Instance Methods
 
__init__(self, agent)
Constructs an Module object.
 
write_pin(self, pin, value)
Drives out a voltage (0 - Vref) on specified pin.
 
write_pin_raw(self, pin, value)
Drives out a value (0 - 0xFFFF) on specified pin.
float
read_pin(self, pin)
Reads and returns the voltage (0 - Vref) currently driven on specified pin.
int
read_pin_raw(self, pin)
Reads and returns the value (0 - 0xFFFF) currently driven on specified pin.

Inherited from Module: do_op

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  output_pin_count
The no.

Inherited from Analog: vref

Inherited from object: __class__

Method Details

__init__(self, agent)
(Constructor)

 
Constructs an Module object.
Parameters:
  • agent - the agent interface object
Overrides: object.__init__
(inherited documentation)

write_pin(self, pin, value)

 
Drives out a voltage (0 - Vref) on specified pin.
Parameters:
  • pin (int) - the pin to be driven
  • value (float) - the voltage to be driven (0 - Vref)
Raises:
  • ProtocolError - If communication with agent fails or if data sent of received is corrupted

write_pin_raw(self, pin, value)

 
Drives out a value (0 - 0xFFFF) on specified pin.
Parameters:
  • pin (int) - the pin to be driven
  • value (int) - the voltage to be driven (0 - 0xFFFF)
Raises:
  • ProtocolError - If communication with agent fails or if data sent of received is corrupted

read_pin(self, pin)

 
Reads and returns the voltage (0 - Vref) currently driven on specified pin.
Parameters:
  • pin (int) - the pin to read
Returns: float
the voltage (0 - Vref) currently driven on the pin
Raises:
  • ProtocolError - If communication with agent fails or if data sent of received is corrupted

read_pin_raw(self, pin)

 
Reads and returns the value (0 - 0xFFFF) currently driven on specified pin.
Parameters:
  • pin (int) - the pin to read
Returns: int
the value (0 - 0xFFFF) currently driven on the pin
Raises:
  • ProtocolError - If communication with agent fails or if data sent of received is corrupted

Property Details

output_pin_count

The no. of output pins available in this module.
Get Method:
_get_output_pin_count(self)