File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,25 @@ void ATECCX08A::idleMode()
111
111
_i2cPort->endTransmission (); // actually send it
112
112
}
113
113
114
+ /* * \brief
115
+
116
+ sleep()
117
+
118
+ The ATECCX08A is forcefully put into sleep (LOW POWER) mode and ignores all subsequent I/O transitions
119
+ until the next wake flag. The contents of TempKey and RNG Seed registers are NOT retained.
120
+ Idle Power Supply Current: 150nA.
121
+ This helps avoid waiting for watchdog timer and immidiately puts the device in sleep mode.
122
+ With this sleep/wakeup cycle, RNG seed registers are updated from internal entropy.
123
+ */
124
+
125
+ void ATECCX08A::sleep ()
126
+ {
127
+ idleMode ();
128
+ _i2cPort->beginTransmission (_i2caddr); // set up to write to address
129
+ _i2cPort->write (WORD_ADDRESS_VALUE_SLEEP); // enter sleep command (aka word address - the first part of every communication to the IC)
130
+ _i2cPort->endTransmission (); // actually send it
131
+ }
132
+
114
133
/* * \brief
115
134
116
135
getInfo()
Original file line number Diff line number Diff line change 121
121
#define WORD_ADDRESS_VALUE_COMMAND 0x03 // This is the "command" word address,
122
122
// this tells the IC we are going to send a command, and is used for most communications to the IC
123
123
#define WORD_ADDRESS_VALUE_IDLE 0x02 // used to enter idle mode
124
+ // this tells the IC to enter sleep mode
125
+ #define WORD_ADDRESS_VALUE_SLEEP 0x01 // used to enter sleep mode
124
126
125
127
// COMMANDS (aka "opcodes" in the datasheet)
126
128
#define COMMAND_OPCODE_INFO 0x30 // Return device state information.
@@ -218,6 +220,7 @@ class ATECCX08A {
218
220
219
221
boolean wakeUp ();
220
222
void idleMode ();
223
+ void sleep ();
221
224
boolean getInfo ();
222
225
boolean writeConfigSparkFun ();
223
226
boolean lockConfig (); // note, this PERMINANTLY disables changes to config zone - including changing the I2C address!
You can’t perform that action at this time.
0 commit comments