123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
- .. module:: communication
- .. _communication:
- Module communication
- ====================
- Communication part of the board package
- .. py:class:: PCI(object)
- The Interface to the pci command
- .. py:method:: __init__(self)
- .. py:method:: _safe_call(self, cmd)
- Actually call the pci command
- :param cmd: the command line to execute as list
- :return: the output of the command
- .. py:method:: _format(self, output)
- Format output values (remove unnecessary parts of the output)
- :param output: the unformatted output
- :return: the formatted output
- .. py:method:: read(self, board_id, amount=1, reg=None, dma=None, destination=None, decimal=False, timeout=None)
- Read from boards
-
- :param board_id: id of the board to write to (mandatory)
- :param amount: number of 32byte blocks to read (default is 1) [1]
- :param reg: register to read from [1]
- :param dma: the dma to read from [1]
- :param destination: the destination to write the retrieved data to ('memory' to return the data)
- :param decimal: whether to return the result as decimal number (default is False)
- :param timeout: the timeout for the read (only useful when reading data from dma)
-
- [1]: If neither reg nor dma are given reg will default to 0x9000 and data from registers will be read
- If reg is given, data from registers will be read
- If dma is given, data from dma will be read and amount is ignored
- If both reg and dma are given, an error will be raised
- .. py:method:: write(self, board_id, value, reg='0x9040', hex_mask='FFFFFFFF')
- Write to boards
- :param board_id: id of the board to write to (mandatory)
- :param value: value to write (mandatory)
- :param reg: register to write to (optional, default is '0x9040')
- :param hex_mask: hex mask to apply to value before writing (optional)
- .. py:method:: read_data_to_file(self, board_id, filename, dma='dma0', timeout=None)
- Read data from board and write to file
-
- :param board_id: the board to read from
- :param filename: the filename to write to
- :param dma: the dma to use?
- :param timeout: if not None: the timeout for the underlying pci command
- .. py:method:: read_data_to_variable(self, board_id, dma='dma0', timeout=None)
- Read data and return it.
-
- :param board_id: the board to read from
- :param dma: the dma to use?
- :param timeout: if not None: the timeout for the underlying pci command
- :return: string with data read from board
- .. py:method:: start_dma(self, board_id, dma='dma0r')
- Start dma engine.
-
- :param board_id: the board to start the dma engine for
- :param dma: the dma to use
- .. py:method:: stop_dma(self, board_id, dma='dma0r')
- Stop dma engine.
-
- :param board_id: the board to stop the dma engine for
- :param dma: the dma to use
- .. py:method:: info(self, board_id=None, dev_file=None)
- Get Device info (output of pci -i)
- :return: Information string returned by pci -i
|