534
edits
m (→HT16K33 Methods: Section reorganisation) |
|||
| Line 131: | Line 131: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === getName() === | ||
Return | Return device name. | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Python 3.4.2 (default, Oct 19 2014, 13:31:11) | Python 3.4.2 (default, Oct 19 2014, 13:31:11) | ||
| Line 143: | Line 141: | ||
>>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | >>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | ||
>>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | >>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | ||
>>> | >>> LEDPACK2.getName() | ||
'LEDPACK2' | |||
>>> | >>> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === getType() === | ||
Return | Return device type | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Python 3.4.2 (default, Oct 19 2014, 13:31:11) | Python 3.4.2 (default, Oct 19 2014, 13:31:11) | ||
| Line 162: | Line 156: | ||
>>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | >>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | ||
>>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | >>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | ||
>>> | >>> LEDPACK2.getType() | ||
'HT16K33' | |||
>>> | |||
>>> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === getAddress() === | ||
Return device | Return device addresse. | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Python 3.4.2 (default, Oct 19 2014, 13:31:11) | Python 3.4.2 (default, Oct 19 2014, 13:31:11) | ||
| Line 183: | Line 171: | ||
>>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | >>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | ||
>>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | >>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | ||
>>> LEDPACK2. | >>> LEDPACK2.getAddress() | ||
' | '0x71' | ||
>>> | >>> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === GetComRegister(com) === | ||
Return | Return register address. | ||
*com : Register Number [1...16], regarding of the out latch you want to write. '''1''' is register for output '''1 - 8''' and Common '''1''', '''2''' is register for output '''9 - 16''' and Common '''1''' ... etc. Method GetComPortRegister() should be used in place of GetComRegister(). | |||
Except for development or debugging and knowing what you are doing, there is no reason to invoke this method directly. It is a system method internal to the operation of the driver. | |||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Python 3.4.2 (default, Oct 19 2014, 13:31:11) | Python 3.4.2 (default, Oct 19 2014, 13:31:11) | ||
| Line 198: | Line 188: | ||
>>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | >>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | ||
>>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | >>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | ||
>>> LEDPACK2. | >>> print(hex(LEDPACK2.GetComRegister(3))) | ||
0x2 | |||
>>> | >>> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === GetComPortRegister(port, com) === | ||
Return | Return register address. | ||
Considering 2 output port with eight output each. named '''A''' and '''B'''. Port '''A''' will manage output '''1...8''' regarding of the Common selected. Port '''B''' will drive output '''9-16''' in the same way.<br /> | |||
* port : '''A''' or '''B'''. Allow to choose witch range of output will be affected. | |||
* com : Register Number [1...8] | |||
Except for development or debugging and knowing what you are doing, there is no reason to invoke this method directly. It is a system method internal to the operation of the driver. | |||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Python 3.4.2 (default, Oct 19 2014, 13:31:11) | Python 3.4.2 (default, Oct 19 2014, 13:31:11) | ||
| Line 213: | Line 207: | ||
>>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | >>> MODULE_HT16K33 = FGINT1.getModule('HT16K33') | ||
>>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | >>> LEDPACK2 = MODULE_HT16K33('LEDPACK2', '0x71', 0) | ||
>>> LEDPACK2. | >>> print(hex(LEDPACK2.GetComPortRegister('A', 1))) | ||
' | 0x0 | ||
>>> | >>> print(hex(LEDPACK2.GetComPortRegister('A', 2))) | ||
0x2 | |||
>>> print(hex(LEDPACK2.GetComPortRegister('B', 4))) | |||
0x7 | |||
>>> print(hex(LEDPACK2.GetComPortRegister('B', 1))) | |||
0x1 | |||
>>> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
edits