Skip to content

Commit

Permalink
coredevice/TCA6424A: convert 'outputs' value to little endian. Closes #…
Browse files Browse the repository at this point in the history
sbourdeauducq committed May 22, 2016
1 parent 852ddb7 commit 3d6f551
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -42,6 +42,13 @@ unreleased [2.x]
takes into account the repository revision field.


1.1 (unreleased)
----------------

* TCA6424A.set converts the "outputs" value to little-endian before programming
it into the registers.


1.0
---

7 changes: 6 additions & 1 deletion artiq/coredevice/i2c.py
Original file line number Diff line number Diff line change
@@ -108,5 +108,10 @@ def set(self, outputs):
A bit set to 1 means the TTL is an output.
"""
outputs_le = (
((outputs & 0xff0000) >> 16) |
(outputs & 0x00ff00) |
(outputs & 0x0000ff) << 16)

self._write24(0x8c, 0) # set all directions to output
self._write24(0x84, outputs) # set levels
self._write24(0x84, outputs_le) # set levels

0 comments on commit 3d6f551

Please sign in to comment.