communication.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
  2. .. module:: communication
  3. .. _communication:
  4. Module communication
  5. ====================
  6. Communication part of the board package
  7. .. py:class:: PCI(object)
  8. The Interface to the pci command
  9. .. py:method:: __init__(self)
  10. .. py:method:: _safe_call(self, cmd)
  11. Actually call the pci command
  12. :param cmd: the command line to execute as list
  13. :return: the output of the command
  14. .. py:method:: _format(self, output)
  15. Format output values (remove unnecessary parts of the output)
  16. :param output: the unformatted output
  17. :return: the formatted output
  18. .. py:method:: read(self, board_id, amount=1, reg=None, dma=None, destination=None, decimal=False, timeout=None)
  19. Read from boards
  20. :param board_id: id of the board to write to (mandatory)
  21. :param amount: number of 32byte blocks to read (default is 1) [1]
  22. :param reg: register to read from [1]
  23. :param dma: the dma to read from [1]
  24. :param destination: the destination to write the retrieved data to ('memory' to return the data)
  25. :param decimal: whether to return the result as decimal number (default is False)
  26. :param timeout: the timeout for the read (only useful when reading data from dma)
  27. [1]: If neither reg nor dma are given reg will default to 0x9000 and data from registers will be read
  28. If reg is given, data from registers will be read
  29. If dma is given, data from dma will be read and amount is ignored
  30. If both reg and dma are given, an error will be raised
  31. .. py:method:: write(self, board_id, value, reg='0x9040', hex_mask='FFFFFFFF')
  32. Write to boards
  33. :param board_id: id of the board to write to (mandatory)
  34. :param value: value to write (mandatory)
  35. :param reg: register to write to (optional, default is '0x9040')
  36. :param hex_mask: hex mask to apply to value before writing (optional)
  37. .. py:method:: read_data_to_file(self, board_id, filename, dma='dma0', timeout=None)
  38. Read data from board and write to file
  39. :param board_id: the board to read from
  40. :param filename: the filename to write to
  41. :param dma: the dma to use?
  42. :param timeout: if not None: the timeout for the underlying pci command
  43. .. py:method:: read_data_to_variable(self, board_id, dma='dma0', timeout=None)
  44. Read data and return it.
  45. :param board_id: the board to read from
  46. :param dma: the dma to use?
  47. :param timeout: if not None: the timeout for the underlying pci command
  48. :return: string with data read from board
  49. .. py:method:: start_dma(self, board_id, dma='dma0r')
  50. Start dma engine.
  51. :param board_id: the board to start the dma engine for
  52. :param dma: the dma to use
  53. .. py:method:: stop_dma(self, board_id, dma='dma0r')
  54. Stop dma engine.
  55. :param board_id: the board to stop the dma engine for
  56. :param dma: the dma to use
  57. .. py:method:: info(self, board_id=None, dev_file=None)
  58. Get Device info (output of pci -i)
  59. :return: Information string returned by pci -i