Skip to content

Commit 61bd4b6

Browse files
committed
- Making pylint happy
- Moved I2C Config doc to CFG_TLS_HEX description - Corrected BIN representation of 0x6A
1 parent 4d9addf commit 61bd4b6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

adafruit_atecc/adafruit_atecc.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def _convert_i2c_addr_to_atecc_addr(i2c_addr=0x60):
110110
\x00<\x00<\x00<\x00\x1c\x00"
111111

112112
"""
113+
Configuration Zone Bytes
114+
113115
Serial Number (Bytes 0-3 and 8-12), Revision Number (Bytes 4-7)
114116
AES Enable (Byte 13), I2C Enable (Byte 14), Reserved (Byte 15)
115117
I2C Address (Byte 16), Reserved (Byte 17); Count Match (Byte 18)
@@ -120,6 +122,15 @@ def _convert_i2c_addr_to_atecc_addr(i2c_addr=0x60):
120122
Reserved (Bytes 75-83), User Extra (Bytes 84-85)
121123
Lock Config (Bytes 86-89), Chip Options (Bytes 90-91)
122124
X509 (Bytes 92-95), Key Config (Bytes 96-127)
125+
126+
I2C Config
127+
128+
HEX DEC BIN Description
129+
Byte 14: C0 192 1100 0000
130+
^xxx xxxx Bit 0 (MSB): 0:Single Wire, 1:I2C; Bit 1-7: Set by Microchip
131+
Byte 16: C0 192 0010 0000 Default 7 bit I2C Address: 0xC0>>1: 0x60 ATECC608A-MAHDA
132+
Byte 16: 6A 106 0110 1010 Default 7 bit I2C Address: 0x6A>>1: 0x35 ATECC608A-TNGTLS
133+
Byte 16: 20 32 0010 0000 Default 7 bit I2C Address: 0x20>>1: 0x10 ATECC608A-UNKNOWN
123134
"""
124135
CFG_TLS_HEX = bytes(
125136
bytearray.fromhex(
@@ -144,16 +155,7 @@ def _convert_i2c_addr_to_atecc_addr(i2c_addr=0x60):
144155
# TODO: Decide whether to use alternate representation of config bytes
145156
# TODO: Remove assertion tests
146157
assert CFG_TLS == CFG_TLS_HEX
147-
assert bytearray(CFG_TLS)[16] == 0x20 #
148-
149-
"""I2C Config
150-
HEX DEC BIN Description
151-
Byte 14: C0 192 1100 0000
152-
^xxx xxxx Bit 0 (MSB): 0:Single Wire, 1:I2C; Bit 1-7: Set by Microchip
153-
Byte 16: C0 192 0010 0000 Default 7 bit I2C Address: 0xC0>>1: 0x60 ATECC608A-MAHDA
154-
Byte 16: 6A 106 0010 0000 Default 7 bit I2C Address: 0x6A>>1: 0x35 ATECC608A-TNGTLS
155-
Byte 16: 20 32 0010 0000 Default 7 bit I2C Address: 0x20>>1: 0x10 ATECC608A-UNKNOWN
156-
"""
158+
assert bytearray(CFG_TLS)[16] == 0x20
157159

158160
# Convert I2C address to config byte 16 and update CFG_TLS
159161
_CFG_BYTES = bytearray(CFG_TLS)

0 commit comments

Comments
 (0)