HT16K33 Class: Difference between revisions

Jump to navigation Jump to search
m
→‎HT16K33 Methods: Section reorganisation
m (→‎HT16K33 Methods: Section reorganisation)
Line 131: Line 131:
</syntaxhighlight>
</syntaxhighlight>


=== GetComRegister(com) ===
=== getName() ===
Return register address.
Return device name.
*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 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)
>>> print(hex(LEDPACK2.GetComRegister(3)))
>>> LEDPACK2.getName()
0x2
'LEDPACK2'
>>>  
>>>  
</syntaxhighlight>
</syntaxhighlight>


=== GetComPortRegister(port, com) ===
=== getType() ===
Return register address.
Return device type
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 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)
>>> print(hex(LEDPACK2.GetComPortRegister('A', 1)))
>>> LEDPACK2.getType()
0x0
'HT16K33'
>>> print(hex(LEDPACK2.GetComPortRegister('A', 2)))
>>>  
0x2
>>> print(hex(LEDPACK2.GetComPortRegister('B', 4)))
0x7
>>> print(hex(LEDPACK2.GetComPortRegister('B', 1)))
0x1
>>>
</syntaxhighlight>
</syntaxhighlight>


=== getName() ===
=== getAddress() ===
Return device name.
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.getName()
>>> LEDPACK2.getAddress()
'LEDPACK2'
'0x71'
>>>  
>>>  
</syntaxhighlight>
</syntaxhighlight>


=== getType() ===
=== GetComRegister(com) ===
Return device type
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.getType()
>>> print(hex(LEDPACK2.GetComRegister(3)))
'HT16K33'
0x2
>>>  
>>>  
</syntaxhighlight>
</syntaxhighlight>


=== getAddress() ===
=== GetComPortRegister(port, com) ===
Return device addresse.
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.getAddress()
>>> print(hex(LEDPACK2.GetComPortRegister('A', 1)))
'0x71'
0x0
>>>  
>>> print(hex(LEDPACK2.GetComPortRegister('A', 2)))
0x2
>>> print(hex(LEDPACK2.GetComPortRegister('B', 4)))
0x7
>>> print(hex(LEDPACK2.GetComPortRegister('B', 1)))
0x1
>>>
</syntaxhighlight>
</syntaxhighlight>


534

edits

Navigation menu