Skip to content

Commit d3e6401

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

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

adafruit_atecc/adafruit_atecc.py

Lines changed: 11 additions & 9 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(
@@ -146,15 +157,6 @@ def _convert_i2c_addr_to_atecc_addr(i2c_addr=0x60):
146157
assert CFG_TLS == CFG_TLS_HEX
147158
assert bytearray(CFG_TLS)[16] == 0x20 #
148159

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-
"""
157-
158160
# Convert I2C address to config byte 16 and update CFG_TLS
159161
_CFG_BYTES = bytearray(CFG_TLS)
160162
_CFG_BYTE_16 = hex(_I2C_ADDR << 1)

0 commit comments

Comments
 (0)