diff --git a/html/AES128_8cpp_source.html b/html/AES128_8cpp_source.html new file mode 100644 index 00000000..ba3576e4 --- /dev/null +++ b/html/AES128_8cpp_source.html @@ -0,0 +1,183 @@ + + + + + + +ArduinoLibs: AES128.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
AES128.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "AES.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
41 {
+
42  rounds = 10;
+
43  schedule = sched;
+
44 }
+
45 
+
46 AES128::~AES128()
+
47 {
+
48  clean(sched);
+
49 }
+
50 
+
55 size_t AES128::keySize() const
+
56 {
+
57  return 16;
+
58 }
+
59 
+
60 bool AES128::setKey(const uint8_t *key, size_t len)
+
61 {
+
62  if (len != 16)
+
63  return false;
+
64 
+
65  // Copy the key itself into the first 16 bytes of the schedule.
+
66  uint8_t *schedule = sched;
+
67  memcpy(schedule, key, 16);
+
68 
+
69  // Expand the key schedule until we have 176 bytes of expanded key.
+
70  uint8_t iteration = 1;
+
71  uint8_t n = 16;
+
72  uint8_t w = 4;
+
73  while (n < 176) {
+
74  if (w == 4) {
+
75  // Every 16 bytes (4 words) we need to apply the key schedule core.
+
76  keyScheduleCore(schedule + 16, schedule + 12, iteration);
+
77  schedule[16] ^= schedule[0];
+
78  schedule[17] ^= schedule[1];
+
79  schedule[18] ^= schedule[2];
+
80  schedule[19] ^= schedule[3];
+
81  ++iteration;
+
82  w = 0;
+
83  } else {
+
84  // Otherwise just XOR the word with the one 16 bytes previous.
+
85  schedule[16] = schedule[12] ^ schedule[0];
+
86  schedule[17] = schedule[13] ^ schedule[1];
+
87  schedule[18] = schedule[14] ^ schedule[2];
+
88  schedule[19] = schedule[15] ^ schedule[3];
+
89  }
+
90 
+
91  // Advance to the next word in the schedule.
+
92  schedule += 4;
+
93  n += 4;
+
94  ++w;
+
95  }
+
96 
+
97  return true;
+
98 }
+
size_t keySize() const
Size of a 128-bit AES key in bytes.
Definition: AES128.cpp:55
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES128.cpp:60
+
AES128()
Constructs an AES 128-bit block cipher with no initial key.
Definition: AES128.cpp:40
+
+ + + + diff --git a/html/AES192_8cpp_source.html b/html/AES192_8cpp_source.html new file mode 100644 index 00000000..3195b686 --- /dev/null +++ b/html/AES192_8cpp_source.html @@ -0,0 +1,183 @@ + + + + + + +ArduinoLibs: AES192.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
AES192.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "AES.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
41 {
+
42  rounds = 12;
+
43  schedule = sched;
+
44 }
+
45 
+
46 AES192::~AES192()
+
47 {
+
48  clean(sched);
+
49 }
+
50 
+
55 size_t AES192::keySize() const
+
56 {
+
57  return 24;
+
58 }
+
59 
+
60 bool AES192::setKey(const uint8_t *key, size_t len)
+
61 {
+
62  if (len != 24)
+
63  return false;
+
64 
+
65  // Copy the key itself into the first 24 bytes of the schedule.
+
66  uint8_t *schedule = sched;
+
67  memcpy(schedule, key, 24);
+
68 
+
69  // Expand the key schedule until we have 208 bytes of expanded key.
+
70  uint8_t iteration = 1;
+
71  uint8_t n = 24;
+
72  uint8_t w = 6;
+
73  while (n < 208) {
+
74  if (w == 6) {
+
75  // Every 24 bytes (6 words) we need to apply the key schedule core.
+
76  keyScheduleCore(schedule + 24, schedule + 20, iteration);
+
77  schedule[24] ^= schedule[0];
+
78  schedule[25] ^= schedule[1];
+
79  schedule[26] ^= schedule[2];
+
80  schedule[27] ^= schedule[3];
+
81  ++iteration;
+
82  w = 0;
+
83  } else {
+
84  // Otherwise just XOR the word with the one 24 bytes previous.
+
85  schedule[24] = schedule[20] ^ schedule[0];
+
86  schedule[25] = schedule[21] ^ schedule[1];
+
87  schedule[26] = schedule[22] ^ schedule[2];
+
88  schedule[27] = schedule[23] ^ schedule[3];
+
89  }
+
90 
+
91  // Advance to the next word in the schedule.
+
92  schedule += 4;
+
93  n += 4;
+
94  ++w;
+
95  }
+
96 
+
97  return true;
+
98 }
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES192.cpp:60
+
size_t keySize() const
Size of a 192-bit AES key in bytes.
Definition: AES192.cpp:55
+
AES192()
Constructs an AES 192-bit block cipher with no initial key.
Definition: AES192.cpp:40
+
+ + + + diff --git a/html/AES256_8cpp_source.html b/html/AES256_8cpp_source.html new file mode 100644 index 00000000..b74e6209 --- /dev/null +++ b/html/AES256_8cpp_source.html @@ -0,0 +1,190 @@ + + + + + + +ArduinoLibs: AES256.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
AES256.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "AES.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
41 {
+
42  rounds = 14;
+
43  schedule = sched;
+
44 }
+
45 
+
46 AES256::~AES256()
+
47 {
+
48  clean(sched);
+
49 }
+
50 
+
55 size_t AES256::keySize() const
+
56 {
+
57  return 32;
+
58 }
+
59 
+
60 bool AES256::setKey(const uint8_t *key, size_t len)
+
61 {
+
62  if (len != 32)
+
63  return false;
+
64 
+
65  // Copy the key itself into the first 32 bytes of the schedule.
+
66  uint8_t *schedule = sched;
+
67  memcpy(schedule, key, 32);
+
68 
+
69  // Expand the key schedule until we have 240 bytes of expanded key.
+
70  uint8_t iteration = 1;
+
71  uint8_t n = 32;
+
72  uint8_t w = 8;
+
73  while (n < 240) {
+
74  if (w == 8) {
+
75  // Every 32 bytes (8 words) we need to apply the key schedule core.
+
76  keyScheduleCore(schedule + 32, schedule + 28, iteration);
+
77  schedule[32] ^= schedule[0];
+
78  schedule[33] ^= schedule[1];
+
79  schedule[34] ^= schedule[2];
+
80  schedule[35] ^= schedule[3];
+
81  ++iteration;
+
82  w = 0;
+
83  } else if (w == 4) {
+
84  // At the 16 byte mark we need to apply the S-box.
+
85  applySbox(schedule + 32, schedule + 28);
+
86  schedule[32] ^= schedule[0];
+
87  schedule[33] ^= schedule[1];
+
88  schedule[34] ^= schedule[2];
+
89  schedule[35] ^= schedule[3];
+
90  } else {
+
91  // Otherwise just XOR the word with the one 32 bytes previous.
+
92  schedule[32] = schedule[28] ^ schedule[0];
+
93  schedule[33] = schedule[29] ^ schedule[1];
+
94  schedule[34] = schedule[30] ^ schedule[2];
+
95  schedule[35] = schedule[31] ^ schedule[3];
+
96  }
+
97 
+
98  // Advance to the next word in the schedule.
+
99  schedule += 4;
+
100  n += 4;
+
101  ++w;
+
102  }
+
103 
+
104  return true;
+
105 }
+
AES256()
Constructs an AES 256-bit block cipher with no initial key.
Definition: AES256.cpp:40
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES256.cpp:60
+
size_t keySize() const
Size of a 256-bit AES key in bytes.
Definition: AES256.cpp:55
+
+ + + + diff --git a/html/AESCommon_8cpp_source.html b/html/AESCommon_8cpp_source.html new file mode 100644 index 00000000..0cea2abd --- /dev/null +++ b/html/AESCommon_8cpp_source.html @@ -0,0 +1,423 @@ + + + + + + +ArduinoLibs: AESCommon.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
AESCommon.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "AES.h"
+
24 #include "Crypto.h"
+
25 #include "utility/ProgMemUtil.h"
+
26 
+
48 // AES S-box (http://en.wikipedia.org/wiki/Rijndael_S-box)
+
49 static uint8_t const sbox[256] PROGMEM = {
+
50  0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, // 0x00
+
51  0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
+
52  0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, // 0x10
+
53  0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
+
54  0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, // 0x20
+
55  0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
+
56  0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, // 0x30
+
57  0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
+
58  0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, // 0x40
+
59  0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
+
60  0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, // 0x50
+
61  0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
+
62  0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, // 0x60
+
63  0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
+
64  0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, // 0x70
+
65  0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
+
66  0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, // 0x80
+
67  0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
+
68  0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, // 0x90
+
69  0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
+
70  0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, // 0xA0
+
71  0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
+
72  0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, // 0xB0
+
73  0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
+
74  0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, // 0xC0
+
75  0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
+
76  0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, // 0xD0
+
77  0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
+
78  0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, // 0xE0
+
79  0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
+
80  0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, // 0xF0
+
81  0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
+
82 };
+
83 
+
84 // AES inverse S-box (http://en.wikipedia.org/wiki/Rijndael_S-box)
+
85 static uint8_t const sbox_inverse[256] PROGMEM = {
+
86  0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, // 0x00
+
87  0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
+
88  0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, // 0x10
+
89  0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
+
90  0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, // 0x20
+
91  0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
+
92  0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, // 0x30
+
93  0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
+
94  0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, // 0x40
+
95  0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
+
96  0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, // 0x50
+
97  0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
+
98  0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, // 0x60
+
99  0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
+
100  0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, // 0x70
+
101  0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
+
102  0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, // 0x80
+
103  0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
+
104  0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, // 0x90
+
105  0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
+
106  0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, // 0xA0
+
107  0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
+
108  0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, // 0xB0
+
109  0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
+
110  0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, // 0xC0
+
111  0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
+
112  0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, // 0xD0
+
113  0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
+
114  0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, // 0xE0
+
115  0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
+
116  0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, // 0xF0
+
117  0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
+
118 };
+
119 
+ +
126  : rounds(0), schedule(0)
+
127 {
+
128 }
+
129 
+ +
135 {
+
136  clean(state1);
+
137  clean(state2);
+
138 }
+
139 
+
144 size_t AESCommon::blockSize() const
+
145 {
+
146  return 16;
+
147 }
+
148 
+
149 // Constants to correct Galois multiplication for the high bits
+
150 // that are shifted out when multiplying by powers of two.
+
151 static uint8_t const K[8] = {
+
152  0x00,
+
153  0x1B,
+
154  (0x1B << 1),
+
155  (0x1B << 1) ^ 0x1B,
+
156  (0x1B << 2),
+
157  (0x1B << 2) ^ 0x1B,
+
158  (0x1B << 2) ^ (0x1B << 1),
+
159  (0x1B << 2) ^ (0x1B << 1) ^ 0x1B
+
160 };
+
161 
+
162 // Multiply x by 2 in the Galois field, to achieve the effect of the following:
+
163 //
+
164 // if (x & 0x80)
+
165 // return (x << 1) ^ 0x1B;
+
166 // else
+
167 // return (x << 1);
+
168 //
+
169 // However, we don't want to use runtime conditionals if we can help it
+
170 // to avoid leaking timing information from the implementation.
+
171 // In this case, multiplication is slightly faster than table lookup on AVR.
+
172 #define gmul2(x) (t = ((uint16_t)(x)) << 1, \
+
173  ((uint8_t)t) ^ (uint8_t)(0x1B * ((uint8_t)(t >> 8))))
+
174 
+
175 // Multiply x by 4 in the Galois field.
+
176 #define gmul4(x) (t = ((uint16_t)(x)) << 2, ((uint8_t)t) ^ K[t >> 8])
+
177 
+
178 // Multiply x by 8 in the Galois field.
+
179 #define gmul8(x) (t = ((uint16_t)(x)) << 3, ((uint8_t)t) ^ K[t >> 8])
+
180 
+
181 #define OUT(col, row) output[(col) * 4 + (row)]
+
182 #define IN(col, row) input[(col) * 4 + (row)]
+
183 
+
184 static void subBytesAndShiftRows(uint8_t *output, const uint8_t *input)
+
185 {
+
186  OUT(0, 0) = pgm_read_byte(sbox + IN(0, 0));
+
187  OUT(0, 1) = pgm_read_byte(sbox + IN(1, 1));
+
188  OUT(0, 2) = pgm_read_byte(sbox + IN(2, 2));
+
189  OUT(0, 3) = pgm_read_byte(sbox + IN(3, 3));
+
190  OUT(1, 0) = pgm_read_byte(sbox + IN(1, 0));
+
191  OUT(1, 1) = pgm_read_byte(sbox + IN(2, 1));
+
192  OUT(1, 2) = pgm_read_byte(sbox + IN(3, 2));
+
193  OUT(1, 3) = pgm_read_byte(sbox + IN(0, 3));
+
194  OUT(2, 0) = pgm_read_byte(sbox + IN(2, 0));
+
195  OUT(2, 1) = pgm_read_byte(sbox + IN(3, 1));
+
196  OUT(2, 2) = pgm_read_byte(sbox + IN(0, 2));
+
197  OUT(2, 3) = pgm_read_byte(sbox + IN(1, 3));
+
198  OUT(3, 0) = pgm_read_byte(sbox + IN(3, 0));
+
199  OUT(3, 1) = pgm_read_byte(sbox + IN(0, 1));
+
200  OUT(3, 2) = pgm_read_byte(sbox + IN(1, 2));
+
201  OUT(3, 3) = pgm_read_byte(sbox + IN(2, 3));
+
202 }
+
203 
+
204 static void inverseShiftRowsAndSubBytes(uint8_t *output, const uint8_t *input)
+
205 {
+
206  OUT(0, 0) = pgm_read_byte(sbox_inverse + IN(0, 0));
+
207  OUT(0, 1) = pgm_read_byte(sbox_inverse + IN(3, 1));
+
208  OUT(0, 2) = pgm_read_byte(sbox_inverse + IN(2, 2));
+
209  OUT(0, 3) = pgm_read_byte(sbox_inverse + IN(1, 3));
+
210  OUT(1, 0) = pgm_read_byte(sbox_inverse + IN(1, 0));
+
211  OUT(1, 1) = pgm_read_byte(sbox_inverse + IN(0, 1));
+
212  OUT(1, 2) = pgm_read_byte(sbox_inverse + IN(3, 2));
+
213  OUT(1, 3) = pgm_read_byte(sbox_inverse + IN(2, 3));
+
214  OUT(2, 0) = pgm_read_byte(sbox_inverse + IN(2, 0));
+
215  OUT(2, 1) = pgm_read_byte(sbox_inverse + IN(1, 1));
+
216  OUT(2, 2) = pgm_read_byte(sbox_inverse + IN(0, 2));
+
217  OUT(2, 3) = pgm_read_byte(sbox_inverse + IN(3, 3));
+
218  OUT(3, 0) = pgm_read_byte(sbox_inverse + IN(3, 0));
+
219  OUT(3, 1) = pgm_read_byte(sbox_inverse + IN(2, 1));
+
220  OUT(3, 2) = pgm_read_byte(sbox_inverse + IN(1, 2));
+
221  OUT(3, 3) = pgm_read_byte(sbox_inverse + IN(0, 3));
+
222 }
+
223 
+
224 static void mixColumn(uint8_t *output, uint8_t *input)
+
225 {
+
226  uint16_t t; // Needed by the gmul2 macro.
+
227  uint8_t a = input[0];
+
228  uint8_t b = input[1];
+
229  uint8_t c = input[2];
+
230  uint8_t d = input[3];
+
231  uint8_t a2 = gmul2(a);
+
232  uint8_t b2 = gmul2(b);
+
233  uint8_t c2 = gmul2(c);
+
234  uint8_t d2 = gmul2(d);
+
235  output[0] = a2 ^ b2 ^ b ^ c ^ d;
+
236  output[1] = a ^ b2 ^ c2 ^ c ^ d;
+
237  output[2] = a ^ b ^ c2 ^ d2 ^ d;
+
238  output[3] = a2 ^ a ^ b ^ c ^ d2;
+
239 }
+
240 
+
241 static void inverseMixColumn(uint8_t *output, const uint8_t *input)
+
242 {
+
243  uint16_t t; // Needed by the gmul2, gmul4, and gmul8 macros.
+
244  uint8_t a = input[0];
+
245  uint8_t b = input[1];
+
246  uint8_t c = input[2];
+
247  uint8_t d = input[3];
+
248  uint8_t a2 = gmul2(a);
+
249  uint8_t b2 = gmul2(b);
+
250  uint8_t c2 = gmul2(c);
+
251  uint8_t d2 = gmul2(d);
+
252  uint8_t a4 = gmul4(a);
+
253  uint8_t b4 = gmul4(b);
+
254  uint8_t c4 = gmul4(c);
+
255  uint8_t d4 = gmul4(d);
+
256  uint8_t a8 = gmul8(a);
+
257  uint8_t b8 = gmul8(b);
+
258  uint8_t c8 = gmul8(c);
+
259  uint8_t d8 = gmul8(d);
+
260  output[0] = a8 ^ a4 ^ a2 ^ b8 ^ b2 ^ b ^ c8 ^ c4 ^ c ^ d8 ^ d;
+
261  output[1] = a8 ^ a ^ b8 ^ b4 ^ b2 ^ c8 ^ c2 ^ c ^ d8 ^ d4 ^ d;
+
262  output[2] = a8 ^ a4 ^ a ^ b8 ^ b ^ c8 ^ c4 ^ c2 ^ d8 ^ d2 ^ d;
+
263  output[3] = a8 ^ a2 ^ a ^ b8 ^ b4 ^ b ^ c8 ^ c ^ d8 ^ d4 ^ d2;
+
264 }
+
265 
+
266 void AESCommon::encryptBlock(uint8_t *output, const uint8_t *input)
+
267 {
+
268  const uint8_t *roundKey = schedule;
+
269  uint8_t posn;
+
270  uint8_t round;
+
271 
+
272  // Copy the input into the state and XOR with the first round key.
+
273  for (posn = 0; posn < 16; ++posn)
+
274  state1[posn] = input[posn] ^ roundKey[posn];
+
275  roundKey += 16;
+
276 
+
277  // Perform all rounds except the last.
+
278  for (round = rounds; round > 1; --round) {
+
279  subBytesAndShiftRows(state2, state1);
+
280  mixColumn(state1, state2);
+
281  mixColumn(state1 + 4, state2 + 4);
+
282  mixColumn(state1 + 8, state2 + 8);
+
283  mixColumn(state1 + 12, state2 + 12);
+
284  for (posn = 0; posn < 16; ++posn)
+
285  state1[posn] ^= roundKey[posn];
+
286  roundKey += 16;
+
287  }
+
288 
+
289  // Perform the final round.
+
290  subBytesAndShiftRows(state2, state1);
+
291  for (posn = 0; posn < 16; ++posn)
+
292  output[posn] = state2[posn] ^ roundKey[posn];
+
293 }
+
294 
+
295 void AESCommon::decryptBlock(uint8_t *output, const uint8_t *input)
+
296 {
+
297  const uint8_t *roundKey = schedule + rounds * 16;
+
298  uint8_t round;
+
299  uint8_t posn;
+
300 
+
301  // Copy the input into the state and reverse the final round.
+
302  for (posn = 0; posn < 16; ++posn)
+
303  state1[posn] = input[posn] ^ roundKey[posn];
+
304  inverseShiftRowsAndSubBytes(state2, state1);
+
305 
+
306  // Perform all other rounds in reverse.
+
307  for (round = rounds; round > 1; --round) {
+
308  roundKey -= 16;
+
309  for (posn = 0; posn < 16; ++posn)
+
310  state2[posn] ^= roundKey[posn];
+
311  inverseMixColumn(state1, state2);
+
312  inverseMixColumn(state1 + 4, state2 + 4);
+
313  inverseMixColumn(state1 + 8, state2 + 8);
+
314  inverseMixColumn(state1 + 12, state2 + 12);
+
315  inverseShiftRowsAndSubBytes(state2, state1);
+
316  }
+
317 
+
318  // Reverse the initial round and create the output words.
+
319  roundKey -= 16;
+
320  for (posn = 0; posn < 16; ++posn)
+
321  output[posn] = state2[posn] ^ roundKey[posn];
+
322 }
+
323 
+ +
325 {
+
326  clean(schedule, (rounds + 1) * 16);
+
327  clean(state1);
+
328  clean(state2);
+
329 }
+
330 
+
333 void AESCommon::keyScheduleCore(uint8_t *output, const uint8_t *input, uint8_t iteration)
+
334 {
+
335  // Rcon(i), 2^i in the Rijndael finite field, for i = 0..10.
+
336  // http://en.wikipedia.org/wiki/Rijndael_key_schedule
+
337  static uint8_t const rcon[11] PROGMEM = {
+
338  0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, // 0x00
+
339  0x80, 0x1B, 0x36
+
340  };
+
341  output[0] = pgm_read_byte(sbox + input[1]) ^ pgm_read_byte(rcon + iteration);
+
342  output[1] = pgm_read_byte(sbox + input[2]);
+
343  output[2] = pgm_read_byte(sbox + input[3]);
+
344  output[3] = pgm_read_byte(sbox + input[0]);
+
345 }
+
346 
+
347 void AESCommon::applySbox(uint8_t *output, const uint8_t *input)
+
348 {
+
349  output[0] = pgm_read_byte(sbox + input[0]);
+
350  output[1] = pgm_read_byte(sbox + input[1]);
+
351  output[2] = pgm_read_byte(sbox + input[2]);
+
352  output[3] = pgm_read_byte(sbox + input[3]);
+
353 }
+
354 
+
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
Definition: AESCommon.cpp:295
+
AESCommon()
Constructs an AES block cipher object.
Definition: AESCommon.cpp:125
+
size_t blockSize() const
Size of an AES block in bytes.
Definition: AESCommon.cpp:144
+
virtual ~AESCommon()
Destroys this AES block cipher object after clearing sensitive information.
Definition: AESCommon.cpp:134
+
void clear()
Clears all security-sensitive state from this block cipher.
Definition: AESCommon.cpp:324
+
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
Definition: AESCommon.cpp:266
+
+ + + + diff --git a/html/AES_8h_source.html b/html/AES_8h_source.html new file mode 100644 index 00000000..d068be49 --- /dev/null +++ b/html/AES_8h_source.html @@ -0,0 +1,214 @@ + + + + + + +ArduinoLibs: AES.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
AES.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_AES_h
+
24 #define CRYPTO_AES_h
+
25 
+
26 #include "BlockCipher.h"
+
27 
+
28 class AESCommon : public BlockCipher
+
29 {
+
30 public:
+
31  virtual ~AESCommon();
+
32 
+
33  size_t blockSize() const;
+
34 
+
35  void encryptBlock(uint8_t *output, const uint8_t *input);
+
36  void decryptBlock(uint8_t *output, const uint8_t *input);
+
37 
+
38  void clear();
+
39 
+
40 protected:
+
41  AESCommon();
+
42 
+
44  uint8_t rounds;
+
45  uint8_t *schedule;
+
46 
+
47  void keyScheduleCore(uint8_t *output, const uint8_t *input, uint8_t iteration);
+
48  void applySbox(uint8_t *output, const uint8_t *input);
+
51 private:
+
52  uint8_t state1[16];
+
53  uint8_t state2[16];
+
54 };
+
55 
+
56 class AES128 : public AESCommon
+
57 {
+
58 public:
+
59  AES128();
+
60  virtual ~AES128();
+
61 
+
62  size_t keySize() const;
+
63 
+
64  bool setKey(const uint8_t *key, size_t len);
+
65 
+
66 private:
+
67  uint8_t sched[176];
+
68 };
+
69 
+
70 class AES192 : public AESCommon
+
71 {
+
72 public:
+
73  AES192();
+
74  virtual ~AES192();
+
75 
+
76  size_t keySize() const;
+
77 
+
78  bool setKey(const uint8_t *key, size_t len);
+
79 
+
80 private:
+
81  uint8_t sched[208];
+
82 };
+
83 
+
84 class AES256 : public AESCommon
+
85 {
+
86 public:
+
87  AES256();
+
88  virtual ~AES256();
+
89 
+
90  size_t keySize() const;
+
91 
+
92  bool setKey(const uint8_t *key, size_t len);
+
93 
+
94 private:
+
95  uint8_t sched[240];
+
96 };
+
97 
+
98 #endif
+
void decryptBlock(uint8_t *output, const uint8_t *input)
Decrypts a single block using this cipher.
Definition: AESCommon.cpp:295
+
AES block cipher with 256-bit keys.
Definition: AES.h:84
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
AESCommon()
Constructs an AES block cipher object.
Definition: AESCommon.cpp:125
+
size_t keySize() const
Size of a 128-bit AES key in bytes.
Definition: AES128.cpp:55
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES192.cpp:60
+
size_t blockSize() const
Size of an AES block in bytes.
Definition: AESCommon.cpp:144
+
virtual ~AESCommon()
Destroys this AES block cipher object after clearing sensitive information.
Definition: AESCommon.cpp:134
+
void clear()
Clears all security-sensitive state from this block cipher.
Definition: AESCommon.cpp:324
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES128.cpp:60
+
size_t keySize() const
Size of a 192-bit AES key in bytes.
Definition: AES192.cpp:55
+
void encryptBlock(uint8_t *output, const uint8_t *input)
Encrypts a single block using this cipher.
Definition: AESCommon.cpp:266
+
AES256()
Constructs an AES 256-bit block cipher with no initial key.
Definition: AES256.cpp:40
+
Abstract base class for AES block ciphers.
Definition: AES.h:28
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: AES256.cpp:60
+
AES block cipher with 128-bit keys.
Definition: AES.h:56
+
size_t keySize() const
Size of a 256-bit AES key in bytes.
Definition: AES256.cpp:55
+
AES128()
Constructs an AES 128-bit block cipher with no initial key.
Definition: AES128.cpp:40
+
AES block cipher with 192-bit keys.
Definition: AES.h:70
+
AES192()
Constructs an AES 192-bit block cipher with no initial key.
Definition: AES192.cpp:40
+
+ + + + diff --git a/html/BLAKE2b_8cpp_source.html b/html/BLAKE2b_8cpp_source.html new file mode 100644 index 00000000..68b16d08 --- /dev/null +++ b/html/BLAKE2b_8cpp_source.html @@ -0,0 +1,338 @@ + + + + + + +ArduinoLibs: BLAKE2b.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BLAKE2b.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BLAKE2b.h"
+
24 #include "Crypto.h"
+
25 #include "utility/EndianUtil.h"
+
26 #include "utility/RotateUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+ +
48 {
+
49  reset();
+
50 }
+
51 
+ +
57 {
+
58  clean(state);
+
59 }
+
60 
+
61 size_t BLAKE2b::hashSize() const
+
62 {
+
63  return 64;
+
64 }
+
65 
+
66 size_t BLAKE2b::blockSize() const
+
67 {
+
68  return 128;
+
69 }
+
70 
+
71 // Initialization vectors for BLAKE2b.
+
72 #define BLAKE2b_IV0 0x6a09e667f3bcc908ULL
+
73 #define BLAKE2b_IV1 0xbb67ae8584caa73bULL
+
74 #define BLAKE2b_IV2 0x3c6ef372fe94f82bULL
+
75 #define BLAKE2b_IV3 0xa54ff53a5f1d36f1ULL
+
76 #define BLAKE2b_IV4 0x510e527fade682d1ULL
+
77 #define BLAKE2b_IV5 0x9b05688c2b3e6c1fULL
+
78 #define BLAKE2b_IV6 0x1f83d9abfb41bd6bULL
+
79 #define BLAKE2b_IV7 0x5be0cd19137e2179ULL
+
80 
+ +
82 {
+
83  state.h[0] = BLAKE2b_IV0 ^ 0x01010040; // Default output length of 64.
+
84  state.h[1] = BLAKE2b_IV1;
+
85  state.h[2] = BLAKE2b_IV2;
+
86  state.h[3] = BLAKE2b_IV3;
+
87  state.h[4] = BLAKE2b_IV4;
+
88  state.h[5] = BLAKE2b_IV5;
+
89  state.h[6] = BLAKE2b_IV6;
+
90  state.h[7] = BLAKE2b_IV7;
+
91  state.chunkSize = 0;
+
92  state.lengthLow = 0;
+
93  state.lengthHigh = 0;
+
94 }
+
95 
+
103 void BLAKE2b::reset(uint8_t outputLength)
+
104 {
+
105  state.h[0] = BLAKE2b_IV0 ^ 0x01010000 ^ outputLength;
+
106  state.h[1] = BLAKE2b_IV1;
+
107  state.h[2] = BLAKE2b_IV2;
+
108  state.h[3] = BLAKE2b_IV3;
+
109  state.h[4] = BLAKE2b_IV4;
+
110  state.h[5] = BLAKE2b_IV5;
+
111  state.h[6] = BLAKE2b_IV6;
+
112  state.h[7] = BLAKE2b_IV7;
+
113  state.chunkSize = 0;
+
114  state.lengthLow = 0;
+
115  state.lengthHigh = 0;
+
116 }
+
117 
+
118 void BLAKE2b::update(const void *data, size_t len)
+
119 {
+
120  // Break the input up into 1024-bit chunks and process each in turn.
+
121  const uint8_t *d = (const uint8_t *)data;
+
122  while (len > 0) {
+
123  if (state.chunkSize == 128) {
+
124  // Previous chunk was full and we know that it wasn't the
+
125  // last chunk, so we can process it now with f0 set to zero.
+
126  processChunk(0);
+
127  state.chunkSize = 0;
+
128  }
+
129  uint8_t size = 128 - state.chunkSize;
+
130  if (size > len)
+
131  size = len;
+
132  memcpy(((uint8_t *)state.m) + state.chunkSize, d, size);
+
133  state.chunkSize += size;
+
134  uint64_t temp = state.lengthLow;
+
135  state.lengthLow += size;
+
136  if (state.lengthLow < temp)
+
137  ++state.lengthHigh;
+
138  len -= size;
+
139  d += size;
+
140  }
+
141 }
+
142 
+
143 void BLAKE2b::finalize(void *hash, size_t len)
+
144 {
+
145  // Pad the last chunk and hash it with f0 set to all-ones.
+
146  memset(((uint8_t *)state.m) + state.chunkSize, 0, 128 - state.chunkSize);
+
147  processChunk(0xFFFFFFFFFFFFFFFFULL);
+
148 
+
149  // Convert the hash into little-endian in the message buffer.
+
150  for (uint8_t posn = 0; posn < 8; ++posn)
+
151  state.m[posn] = htole64(state.h[posn]);
+
152 
+
153  // Copy the hash to the caller's return buffer.
+
154  if (len > 64)
+
155  len = 64;
+
156  memcpy(hash, state.m, len);
+
157 }
+
158 
+ +
160 {
+
161  clean(state);
+
162  reset();
+
163 }
+
164 
+
165 void BLAKE2b::resetHMAC(const void *key, size_t keyLen)
+
166 {
+
167  formatHMACKey(state.m, key, keyLen, 0x36);
+
168  state.lengthLow += 128;
+
169  processChunk(0);
+
170 }
+
171 
+
172 void BLAKE2b::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
173 {
+
174  uint8_t temp[64];
+
175  finalize(temp, sizeof(temp));
+
176  formatHMACKey(state.m, key, keyLen, 0x5C);
+
177  state.lengthLow += 128;
+
178  processChunk(0);
+
179  update(temp, sizeof(temp));
+
180  finalize(hash, hashLen);
+
181  clean(temp);
+
182 }
+
183 
+
184 // Permutation on the message input state for BLAKE2b.
+
185 static const uint8_t sigma[12][16] PROGMEM = {
+
186  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+
187  {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3},
+
188  {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4},
+
189  { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8},
+
190  { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13},
+
191  { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9},
+
192  {12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11},
+
193  {13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10},
+
194  { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5},
+
195  {10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0},
+
196  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+
197  {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3},
+
198 };
+
199 
+
200 // Perform a BLAKE2b quarter round operation.
+
201 #define quarterRound(a, b, c, d, i) \
+
202  do { \
+
203  uint64_t _b = (b); \
+
204  uint64_t _a = (a) + _b + state.m[pgm_read_byte(&(sigma[index][2 * (i)]))]; \
+
205  uint64_t _d = rightRotate32_64((d) ^ _a); \
+
206  uint64_t _c = (c) + _d; \
+
207  _b = rightRotate24_64(_b ^ _c); \
+
208  _a += _b + state.m[pgm_read_byte(&(sigma[index][2 * (i) + 1]))]; \
+
209  (d) = _d = rightRotate16_64(_d ^ _a); \
+
210  _c += _d; \
+
211  (a) = _a; \
+
212  (b) = rightRotate63_64(_b ^ _c); \
+
213  (c) = _c; \
+
214  } while (0)
+
215 
+
216 void BLAKE2b::processChunk(uint64_t f0)
+
217 {
+
218  uint8_t index;
+
219 
+
220  // Byte-swap the message buffer into little-endian if necessary.
+
221 #if !defined(CRYPTO_LITTLE_ENDIAN)
+
222  for (index = 0; index < 16; ++index)
+
223  state.m[index] = le64toh(state.m[index]);
+
224 #endif
+
225 
+
226  // Format the block to be hashed.
+
227  memcpy(state.v, state.h, sizeof(state.h));
+
228  state.v[8] = BLAKE2b_IV0;
+
229  state.v[9] = BLAKE2b_IV1;
+
230  state.v[10] = BLAKE2b_IV2;
+
231  state.v[11] = BLAKE2b_IV3;
+
232  state.v[12] = BLAKE2b_IV4 ^ state.lengthLow;
+
233  state.v[13] = BLAKE2b_IV5 ^ state.lengthHigh;
+
234  state.v[14] = BLAKE2b_IV6 ^ f0;
+
235  state.v[15] = BLAKE2b_IV7;
+
236 
+
237  // Perform the 12 BLAKE2b rounds.
+
238  for (index = 0; index < 12; ++index) {
+
239  // Column round.
+
240  quarterRound(state.v[0], state.v[4], state.v[8], state.v[12], 0);
+
241  quarterRound(state.v[1], state.v[5], state.v[9], state.v[13], 1);
+
242  quarterRound(state.v[2], state.v[6], state.v[10], state.v[14], 2);
+
243  quarterRound(state.v[3], state.v[7], state.v[11], state.v[15], 3);
+
244 
+
245  // Diagonal round.
+
246  quarterRound(state.v[0], state.v[5], state.v[10], state.v[15], 4);
+
247  quarterRound(state.v[1], state.v[6], state.v[11], state.v[12], 5);
+
248  quarterRound(state.v[2], state.v[7], state.v[8], state.v[13], 6);
+
249  quarterRound(state.v[3], state.v[4], state.v[9], state.v[14], 7);
+
250  }
+
251 
+
252  // Combine the new and old hash values.
+
253  for (index = 0; index < 8; ++index)
+
254  state.h[index] ^= (state.v[index] ^ state.v[index + 8]);
+
255 }
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: BLAKE2b.cpp:143
+
void reset()
Resets the hash ready for a new hashing process.
Definition: BLAKE2b.cpp:81
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: BLAKE2b.cpp:159
+
BLAKE2b()
Constructs a BLAKE2b hash object.
Definition: BLAKE2b.cpp:47
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: BLAKE2b.cpp:66
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: BLAKE2b.cpp:61
+
virtual ~BLAKE2b()
Destroys this BLAKE2b hash object after clearing sensitive information.
Definition: BLAKE2b.cpp:56
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: BLAKE2b.cpp:118
+
uint8_t * data()
Returns a pointer to the start of the bitmap's data buffer.
Definition: Bitmap.h:53
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: BLAKE2b.cpp:165
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: BLAKE2b.cpp:172
+
+ + + + diff --git a/html/BLAKE2b_8h_source.html b/html/BLAKE2b_8h_source.html new file mode 100644 index 00000000..54426b1e --- /dev/null +++ b/html/BLAKE2b_8h_source.html @@ -0,0 +1,171 @@ + + + + + + +ArduinoLibs: BLAKE2b.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BLAKE2b.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_BLAKE2B_H
+
24 #define CRYPTO_BLAKE2B_H
+
25 
+
26 #include "Hash.h"
+
27 
+
28 class BLAKE2b : public Hash
+
29 {
+
30 public:
+
31  BLAKE2b();
+
32  virtual ~BLAKE2b();
+
33 
+
34  size_t hashSize() const;
+
35  size_t blockSize() const;
+
36 
+
37  void reset();
+
38  void reset(uint8_t outputLength);
+
39  void update(const void *data, size_t len);
+
40  void finalize(void *hash, size_t len);
+
41 
+
42  void clear();
+
43 
+
44  void resetHMAC(const void *key, size_t keyLen);
+
45  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
46 
+
47 private:
+
48  struct {
+
49  uint64_t h[8];
+
50  uint64_t m[16];
+
51  uint64_t v[16];
+
52  uint64_t lengthLow;
+
53  uint64_t lengthHigh;
+
54  uint8_t chunkSize;
+
55  } state;
+
56 
+
57  void processChunk(uint64_t f0);
+
58 };
+
59 
+
60 #endif
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: BLAKE2b.cpp:143
+
void reset()
Resets the hash ready for a new hashing process.
Definition: BLAKE2b.cpp:81
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: BLAKE2b.cpp:159
+
BLAKE2b()
Constructs a BLAKE2b hash object.
Definition: BLAKE2b.cpp:47
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: BLAKE2b.cpp:66
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
BLAKE2b hash algorithm.
Definition: BLAKE2b.h:28
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: BLAKE2b.cpp:61
+
virtual ~BLAKE2b()
Destroys this BLAKE2b hash object after clearing sensitive information.
Definition: BLAKE2b.cpp:56
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: BLAKE2b.cpp:118
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: BLAKE2b.cpp:165
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: BLAKE2b.cpp:172
+
+ + + + diff --git a/html/BLAKE2s_8cpp_source.html b/html/BLAKE2s_8cpp_source.html new file mode 100644 index 00000000..71a3bd1a --- /dev/null +++ b/html/BLAKE2s_8cpp_source.html @@ -0,0 +1,330 @@ + + + + + + +ArduinoLibs: BLAKE2s.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BLAKE2s.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BLAKE2s.h"
+
24 #include "Crypto.h"
+
25 #include "utility/EndianUtil.h"
+
26 #include "utility/RotateUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+ +
48 {
+
49  reset();
+
50 }
+
51 
+ +
57 {
+
58  clean(state);
+
59 }
+
60 
+
61 size_t BLAKE2s::hashSize() const
+
62 {
+
63  return 32;
+
64 }
+
65 
+
66 size_t BLAKE2s::blockSize() const
+
67 {
+
68  return 64;
+
69 }
+
70 
+
71 // Initialization vectors for BLAKE2s.
+
72 #define BLAKE2s_IV0 0x6A09E667
+
73 #define BLAKE2s_IV1 0xBB67AE85
+
74 #define BLAKE2s_IV2 0x3C6EF372
+
75 #define BLAKE2s_IV3 0xA54FF53A
+
76 #define BLAKE2s_IV4 0x510E527F
+
77 #define BLAKE2s_IV5 0x9B05688C
+
78 #define BLAKE2s_IV6 0x1F83D9AB
+
79 #define BLAKE2s_IV7 0x5BE0CD19
+
80 
+ +
82 {
+
83  state.h[0] = BLAKE2s_IV0 ^ 0x01010020; // Default output length of 32.
+
84  state.h[1] = BLAKE2s_IV1;
+
85  state.h[2] = BLAKE2s_IV2;
+
86  state.h[3] = BLAKE2s_IV3;
+
87  state.h[4] = BLAKE2s_IV4;
+
88  state.h[5] = BLAKE2s_IV5;
+
89  state.h[6] = BLAKE2s_IV6;
+
90  state.h[7] = BLAKE2s_IV7;
+
91  state.chunkSize = 0;
+
92  state.length = 0;
+
93 }
+
94 
+
102 void BLAKE2s::reset(uint8_t outputLength)
+
103 {
+
104  state.h[0] = BLAKE2s_IV0 ^ 0x01010000 ^ outputLength;
+
105  state.h[1] = BLAKE2s_IV1;
+
106  state.h[2] = BLAKE2s_IV2;
+
107  state.h[3] = BLAKE2s_IV3;
+
108  state.h[4] = BLAKE2s_IV4;
+
109  state.h[5] = BLAKE2s_IV5;
+
110  state.h[6] = BLAKE2s_IV6;
+
111  state.h[7] = BLAKE2s_IV7;
+
112  state.chunkSize = 0;
+
113  state.length = 0;
+
114 }
+
115 
+
116 void BLAKE2s::update(const void *data, size_t len)
+
117 {
+
118  // Break the input up into 512-bit chunks and process each in turn.
+
119  const uint8_t *d = (const uint8_t *)data;
+
120  while (len > 0) {
+
121  if (state.chunkSize == 64) {
+
122  // Previous chunk was full and we know that it wasn't the
+
123  // last chunk, so we can process it now with f0 set to zero.
+
124  processChunk(0);
+
125  state.chunkSize = 0;
+
126  }
+
127  uint8_t size = 64 - state.chunkSize;
+
128  if (size > len)
+
129  size = len;
+
130  memcpy(((uint8_t *)state.m) + state.chunkSize, d, size);
+
131  state.chunkSize += size;
+
132  state.length += size;
+
133  len -= size;
+
134  d += size;
+
135  }
+
136 }
+
137 
+
138 void BLAKE2s::finalize(void *hash, size_t len)
+
139 {
+
140  // Pad the last chunk and hash it with f0 set to all-ones.
+
141  memset(((uint8_t *)state.m) + state.chunkSize, 0, 64 - state.chunkSize);
+
142  processChunk(0xFFFFFFFF);
+
143 
+
144  // Convert the hash into little-endian in the message buffer.
+
145  for (uint8_t posn = 0; posn < 8; ++posn)
+
146  state.m[posn] = htole32(state.h[posn]);
+
147 
+
148  // Copy the hash to the caller's return buffer.
+
149  if (len > 32)
+
150  len = 32;
+
151  memcpy(hash, state.m, len);
+
152 }
+
153 
+ +
155 {
+
156  clean(state);
+
157  reset();
+
158 }
+
159 
+
160 void BLAKE2s::resetHMAC(const void *key, size_t keyLen)
+
161 {
+
162  formatHMACKey(state.m, key, keyLen, 0x36);
+
163  state.length += 64;
+
164  processChunk(0);
+
165 }
+
166 
+
167 void BLAKE2s::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
168 {
+
169  uint8_t temp[32];
+
170  finalize(temp, sizeof(temp));
+
171  formatHMACKey(state.m, key, keyLen, 0x5C);
+
172  state.length += 64;
+
173  processChunk(0);
+
174  update(temp, sizeof(temp));
+
175  finalize(hash, hashLen);
+
176  clean(temp);
+
177 }
+
178 
+
179 // Permutation on the message input state for BLAKE2s.
+
180 static const uint8_t sigma[10][16] PROGMEM = {
+
181  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+
182  {14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3},
+
183  {11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4},
+
184  { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8},
+
185  { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13},
+
186  { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9},
+
187  {12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11},
+
188  {13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10},
+
189  { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5},
+
190  {10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0}
+
191 };
+
192 
+
193 // Perform a BLAKE2s quarter round operation.
+
194 #define quarterRound(a, b, c, d, i) \
+
195  do { \
+
196  uint32_t _b = (b); \
+
197  uint32_t _a = (a) + _b + state.m[pgm_read_byte(&(sigma[index][2 * (i)]))]; \
+
198  uint32_t _d = rightRotate16((d) ^ _a); \
+
199  uint32_t _c = (c) + _d; \
+
200  _b = rightRotate12(_b ^ _c); \
+
201  _a += _b + state.m[pgm_read_byte(&(sigma[index][2 * (i) + 1]))]; \
+
202  (d) = _d = rightRotate8(_d ^ _a); \
+
203  _c += _d; \
+
204  (a) = _a; \
+
205  (b) = rightRotate7(_b ^ _c); \
+
206  (c) = _c; \
+
207  } while (0)
+
208 
+
209 void BLAKE2s::processChunk(uint32_t f0)
+
210 {
+
211  uint8_t index;
+
212 
+
213  // Byte-swap the message buffer into little-endian if necessary.
+
214 #if !defined(CRYPTO_LITTLE_ENDIAN)
+
215  for (index = 0; index < 16; ++index)
+
216  state.m[index] = le32toh(state.m[index]);
+
217 #endif
+
218 
+
219  // Format the block to be hashed.
+
220  memcpy(state.v, state.h, sizeof(state.h));
+
221  state.v[8] = BLAKE2s_IV0;
+
222  state.v[9] = BLAKE2s_IV1;
+
223  state.v[10] = BLAKE2s_IV2;
+
224  state.v[11] = BLAKE2s_IV3;
+
225  state.v[12] = BLAKE2s_IV4 ^ (uint32_t)(state.length);
+
226  state.v[13] = BLAKE2s_IV5 ^ (uint32_t)(state.length >> 32);
+
227  state.v[14] = BLAKE2s_IV6 ^ f0;
+
228  state.v[15] = BLAKE2s_IV7;
+
229 
+
230  // Perform the 10 BLAKE2s rounds.
+
231  for (index = 0; index < 10; ++index) {
+
232  // Column round.
+
233  quarterRound(state.v[0], state.v[4], state.v[8], state.v[12], 0);
+
234  quarterRound(state.v[1], state.v[5], state.v[9], state.v[13], 1);
+
235  quarterRound(state.v[2], state.v[6], state.v[10], state.v[14], 2);
+
236  quarterRound(state.v[3], state.v[7], state.v[11], state.v[15], 3);
+
237 
+
238  // Diagonal round.
+
239  quarterRound(state.v[0], state.v[5], state.v[10], state.v[15], 4);
+
240  quarterRound(state.v[1], state.v[6], state.v[11], state.v[12], 5);
+
241  quarterRound(state.v[2], state.v[7], state.v[8], state.v[13], 6);
+
242  quarterRound(state.v[3], state.v[4], state.v[9], state.v[14], 7);
+
243  }
+
244 
+
245  // Combine the new and old hash values.
+
246  for (index = 0; index < 8; ++index)
+
247  state.h[index] ^= (state.v[index] ^ state.v[index + 8]);
+
248 }
+
virtual ~BLAKE2s()
Destroys this BLAKE2s hash object after clearing sensitive information.
Definition: BLAKE2s.cpp:56
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: BLAKE2s.cpp:61
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: BLAKE2s.cpp:154
+
void reset()
Resets the hash ready for a new hashing process.
Definition: BLAKE2s.cpp:81
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: BLAKE2s.cpp:66
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: BLAKE2s.cpp:116
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: BLAKE2s.cpp:160
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: BLAKE2s.cpp:138
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: BLAKE2s.cpp:167
+
BLAKE2s()
Constructs a BLAKE2s hash object.
Definition: BLAKE2s.cpp:47
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
+ + + + diff --git a/html/BLAKE2s_8h_source.html b/html/BLAKE2s_8h_source.html new file mode 100644 index 00000000..4a675b57 --- /dev/null +++ b/html/BLAKE2s_8h_source.html @@ -0,0 +1,170 @@ + + + + + + +ArduinoLibs: BLAKE2s.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BLAKE2s.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_BLAKE2S_H
+
24 #define CRYPTO_BLAKE2S_H
+
25 
+
26 #include "Hash.h"
+
27 
+
28 class BLAKE2s : public Hash
+
29 {
+
30 public:
+
31  BLAKE2s();
+
32  virtual ~BLAKE2s();
+
33 
+
34  size_t hashSize() const;
+
35  size_t blockSize() const;
+
36 
+
37  void reset();
+
38  void reset(uint8_t outputLength);
+
39  void update(const void *data, size_t len);
+
40  void finalize(void *hash, size_t len);
+
41 
+
42  void clear();
+
43 
+
44  void resetHMAC(const void *key, size_t keyLen);
+
45  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
46 
+
47 private:
+
48  struct {
+
49  uint32_t h[8];
+
50  uint32_t m[16];
+
51  uint32_t v[16];
+
52  uint64_t length;
+
53  uint8_t chunkSize;
+
54  } state;
+
55 
+
56  void processChunk(uint32_t f0);
+
57 };
+
58 
+
59 #endif
+
virtual ~BLAKE2s()
Destroys this BLAKE2s hash object after clearing sensitive information.
Definition: BLAKE2s.cpp:56
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: BLAKE2s.cpp:61
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: BLAKE2s.cpp:154
+
void reset()
Resets the hash ready for a new hashing process.
Definition: BLAKE2s.cpp:81
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: BLAKE2s.cpp:66
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: BLAKE2s.cpp:116
+
BLAKE2s hash algorithm.
Definition: BLAKE2s.h:28
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: BLAKE2s.cpp:160
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: BLAKE2s.cpp:138
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: BLAKE2s.cpp:167
+
BLAKE2s()
Constructs a BLAKE2s hash object.
Definition: BLAKE2s.cpp:47
+
+ + + + diff --git a/html/Bitmap_8cpp_source.html b/html/Bitmap_8cpp_source.html new file mode 100644 index 00000000..a620e45e --- /dev/null +++ b/html/Bitmap_8cpp_source.html @@ -0,0 +1,702 @@ + + + + + + +ArduinoLibs: Bitmap.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Bitmap.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Bitmap.h"
+
24 #include <WString.h>
+
25 #include <string.h>
+
26 #include <stdlib.h>
+
27 
+
88 Bitmap::Bitmap(int width, int height)
+
89  : _width(width)
+
90  , _height(height)
+
91  , _stride((width + 7) / 8)
+
92  , fb(0)
+
93  , _font(0)
+
94  , _textColor(White)
+
95 {
+
96  // Allocate memory for the framebuffer and clear it (1 = pixel off).
+
97  unsigned int size = _stride * _height;
+
98  fb = (uint8_t *)malloc(size);
+
99  if (fb)
+
100  memset(fb, 0xFF, size);
+
101 }
+
102 
+ +
107 {
+
108  if (fb)
+
109  free(fb);
+
110 }
+
111 
+
174 void Bitmap::clear(Color color)
+
175 {
+
176  unsigned int size = _stride * _height;
+
177  if (color == Black)
+
178  memset(fb, 0xFF, size);
+
179  else
+
180  memset(fb, 0x00, size);
+
181 }
+
182 
+
191 Bitmap::Color Bitmap::pixel(int x, int y) const
+
192 {
+
193  if (((unsigned int)x) >= ((unsigned int)_width) ||
+
194  ((unsigned int)y) >= ((unsigned int)_height))
+
195  return Black;
+
196  uint8_t *ptr = fb + y * _stride + (x >> 3);
+
197  if (*ptr & ((uint8_t)0x80) >> (x & 0x07))
+
198  return Black;
+
199  else
+
200  return White;
+
201 }
+
202 
+
208 void Bitmap::setPixel(int x, int y, Color color)
+
209 {
+
210  if (((unsigned int)x) >= ((unsigned int)_width) ||
+
211  ((unsigned int)y) >= ((unsigned int)_height))
+
212  return; // Pixel is off-screen.
+
213  uint8_t *ptr = fb + y * _stride + (x >> 3);
+
214  if (color)
+
215  *ptr &= ~(((uint8_t)0x80) >> (x & 0x07));
+
216  else
+
217  *ptr |= (((uint8_t)0x80) >> (x & 0x07));
+
218 }
+
219 
+
225 void Bitmap::drawLine(int x1, int y1, int x2, int y2, Color color)
+
226 {
+
227  // Midpoint line scan-conversion algorithm from "Computer Graphics:
+
228  // Principles and Practice", Second Edition, Foley, van Dam, et al.
+
229  int dx = x2 - x1;
+
230  int dy = y2 - y1;
+
231  int xstep, ystep;
+
232  int d, incrE, incrNE;
+
233  if (dx < 0) {
+
234  xstep = -1;
+
235  dx = -dx;
+
236  } else {
+
237  xstep = 1;
+
238  }
+
239  if (dy < 0) {
+
240  ystep = -1;
+
241  dy = -dy;
+
242  } else {
+
243  ystep = 1;
+
244  }
+
245  if (dx >= dy) {
+
246  d = 2 * dy - dx;
+
247  incrE = 2 * dy;
+
248  incrNE = 2 * (dy - dx);
+
249  setPixel(x1, y1, color);
+
250  while (x1 != x2) {
+
251  if (d <= 0) {
+
252  d += incrE;
+
253  } else {
+
254  d += incrNE;
+
255  y1 += ystep;
+
256  }
+
257  x1 += xstep;
+
258  setPixel(x1, y1, color);
+
259  }
+
260  } else {
+
261  d = 2 * dx - dy;
+
262  incrE = 2 * dx;
+
263  incrNE = 2 * (dx - dy);
+
264  setPixel(x1, y1, color);
+
265  while (y1 != y2) {
+
266  if (d <= 0) {
+
267  d += incrE;
+
268  } else {
+
269  d += incrNE;
+
270  x1 += xstep;
+
271  }
+
272  y1 += ystep;
+
273  setPixel(x1, y1, color);
+
274  }
+
275  }
+
276 }
+
277 
+
286 void Bitmap::drawRect(int x1, int y1, int x2, int y2, Color borderColor, Color fillColor)
+
287 {
+
288  int temp;
+
289  if (x1 > x2) {
+
290  temp = x1;
+
291  x1 = x2;
+
292  x2 = temp;
+
293  }
+
294  if (y1 > y2) {
+
295  temp = y1;
+
296  y1 = y2;
+
297  y2 = temp;
+
298  }
+
299  if (fillColor == borderColor) {
+
300  fill(x1, y1, x2 - x1 + 1, y2 - y1 + 1, fillColor);
+
301  } else {
+
302  drawLine(x1, y1, x2, y1, borderColor);
+
303  if (y1 < y2)
+
304  drawLine(x2, y1 + 1, x2, y2, borderColor);
+
305  if (x1 < x2)
+
306  drawLine(x2 - 1, y2, x1, y2, borderColor);
+
307  if (y1 < (y2 - 1))
+
308  drawLine(x1, y2 - 1, x1, y1 + 1, borderColor);
+
309  if (fillColor != NoFill)
+
310  fill(x1 + 1, y1 + 1, x2 - x1 - 1, y2 - y1 - 1, fillColor);
+
311  }
+
312 }
+
313 
+
334 void Bitmap::drawCircle(int centerX, int centerY, int radius, Color borderColor, Color fillColor)
+
335 {
+
336  // Midpoint circle scan-conversion algorithm using second-order
+
337  // differences from "Computer Graphics: Principles and Practice",
+
338  // Second Edition, Foley, van Dam, et al.
+
339  if (radius < 0)
+
340  radius = -radius;
+
341  int x = 0;
+
342  int y = radius;
+
343  int d = 1 - radius;
+
344  int deltaE = 3;
+
345  int deltaSE = 5 - 2 * radius;
+
346  drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
+
347  while (y > x) {
+
348  if (d < 0) {
+
349  d += deltaE;
+
350  deltaE += 2;
+
351  deltaSE += 2;
+
352  } else {
+
353  d += deltaSE;
+
354  deltaE += 2;
+
355  deltaSE += 4;
+
356  --y;
+
357  }
+
358  ++x;
+
359  drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
+
360  }
+
361 }
+
362 
+
388 void Bitmap::drawBitmap(int x, int y, const Bitmap &bitmap, Color color)
+
389 {
+
390  int w = bitmap.width();
+
391  int s = bitmap.stride();
+
392  int h = bitmap.height();
+
393  Color invColor = !color;
+
394  for (uint8_t by = 0; by < h; ++by) {
+
395  const uint8_t *line = bitmap.data() + by * s;
+
396  uint8_t mask = 0x80;
+
397  uint8_t value = *line++;
+
398  for (uint8_t bx = 0; bx < w; ++bx) {
+
399  if (value & mask)
+
400  setPixel(x + bx, y + by, invColor);
+
401  else
+
402  setPixel(x + bx, y + by, color);
+
403  mask >>= 1;
+
404  if (!mask) {
+
405  mask = 0x80;
+
406  value = *line++;
+
407  }
+
408  }
+
409  }
+
410 }
+
411 
+
425 void Bitmap::drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color)
+
426 {
+
427  uint8_t w = pgm_read_byte(bitmap);
+
428  uint8_t s = (w + 7) >> 3;
+
429  uint8_t h = pgm_read_byte(bitmap + 1);
+
430  Color invColor = !color;
+
431  for (uint8_t by = 0; by < h; ++by) {
+
432  const uint8_t *line = ((const uint8_t *)bitmap) + 2 + by * s;
+
433  uint8_t mask = 0x80;
+
434  uint8_t value = pgm_read_byte(line);
+
435  for (uint8_t bx = 0; bx < w; ++bx) {
+
436  if (value & mask)
+
437  setPixel(x + bx, y + by, color);
+
438  else
+
439  setPixel(x + bx, y + by, invColor);
+
440  mask >>= 1;
+
441  if (!mask) {
+
442  mask = 0x80;
+
443  ++line;
+
444  value = pgm_read_byte(line);
+
445  }
+
446  }
+
447  }
+
448 }
+
449 
+
509 #define fontIsFixed(font) (pgm_read_byte((font)) == 0 && \
+
510  pgm_read_byte((font) + 1) == 0)
+
511 #define fontWidth(font) (pgm_read_byte((font) + 2))
+
512 #define fontHeight(font) (pgm_read_byte((font) + 3))
+
513 #define fontFirstChar(font) (pgm_read_byte((font) + 4))
+
514 #define fontCharCount(font) (pgm_read_byte((font) + 5))
+
515 
+
526 void Bitmap::drawText(int x, int y, const char *str, int len)
+
527 {
+
528  if (!_font)
+
529  return;
+
530  uint8_t height = fontHeight(_font);
+
531  if (len < 0)
+
532  len = strlen(str);
+
533  while (len-- > 0) {
+
534  x += drawChar(x, y, *str++);
+
535  if (len > 0) {
+
536  fill(x, y, 1, height, !_textColor);
+
537  ++x;
+
538  }
+
539  if (x >= _width)
+
540  break;
+
541  }
+
542 }
+
543 
+
555 void Bitmap::drawText(int x, int y, const String &str, int start, int len)
+
556 {
+
557  if (!_font)
+
558  return;
+
559  uint8_t height = fontHeight(_font);
+
560  if (len < 0)
+
561  len = str.length() - start;
+
562  while (len-- > 0) {
+
563  x += drawChar(x, y, str[start++]);
+
564  if (len > 0) {
+
565  fill(x, y, 1, height, !_textColor);
+
566  ++x;
+
567  }
+
568  if (x >= _width)
+
569  break;
+
570  }
+
571 }
+
572 
+
585 int Bitmap::drawChar(int x, int y, char ch)
+
586 {
+
587  uint8_t height = fontHeight(_font);
+
588  if (ch == ' ') {
+
589  // Font may not have space, or it is zero-width. Calculate
+
590  // the real size and fill the space.
+
591  int spaceWidth = charWidth('n');
+
592  fill(x, y, spaceWidth, height, !_textColor);
+
593  return spaceWidth;
+
594  }
+
595  uint8_t first = fontFirstChar(_font);
+
596  uint8_t count = fontCharCount(_font);
+
597  uint8_t index = (uint8_t)ch;
+
598  if (index < first || index >= (first + count))
+
599  return 0;
+
600  index -= first;
+
601  uint8_t heightBytes = (height + 7) >> 3;;
+
602  uint8_t width;
+
603  const uint8_t *image;
+
604  if (fontIsFixed(_font)) {
+
605  // Fixed-width font.
+
606  width = fontWidth(_font);
+
607  image = ((const uint8_t *)_font) + 6 + index * heightBytes * width;
+
608  } else {
+
609  // Variable-width font.
+
610  width = pgm_read_byte(_font + 6 + index);
+
611  image = ((const uint8_t *)_font) + 6 + count;
+
612  for (uint8_t temp = 0; temp < index; ++temp) {
+
613  // Scan through all previous characters to find the starting
+
614  // location for this one.
+
615  image += pgm_read_byte(_font + 6 + temp) * heightBytes;
+
616  }
+
617  }
+
618  if ((x + width) <= 0 || (y + height) <= 0)
+
619  return width; // Character is off the top or left of the screen.
+
620  Color invColor = !_textColor;
+
621  for (uint8_t cx = 0; cx < width; ++cx) {
+
622  for (uint8_t cy = 0; cy < heightBytes; ++cy) {
+
623  uint8_t value = pgm_read_byte(image + cy * width + cx);
+
624  int posn;
+
625  if (heightBytes > 1 && cy == (heightBytes - 1))
+
626  posn = height - 8;
+
627  else
+
628  posn = cy * 8;
+
629  for (uint8_t bit = 0; bit < 8; ++bit) {
+
630  if ((posn + bit) >= (cy * 8) && (posn + bit) <= height) {
+
631  if (value & 0x01)
+
632  setPixel(x + cx, y + posn + bit, _textColor);
+
633  else
+
634  setPixel(x + cx, y + posn + bit, invColor);
+
635  }
+
636  value >>= 1;
+
637  }
+
638  }
+
639  }
+
640  return width;
+
641 }
+
642 
+
650 int Bitmap::charWidth(char ch) const
+
651 {
+
652  uint8_t index = (uint8_t)ch;
+
653  if (!_font)
+
654  return 0;
+
655  uint8_t first = fontFirstChar(_font);
+
656  uint8_t count = fontCharCount(_font);
+
657  if (index == ' ')
+
658  index = 'n'; // In case the font does not contain space.
+
659  if (index < first || index >= (first + count))
+
660  return 0;
+
661  if (fontIsFixed(_font))
+
662  return fontWidth(_font);
+
663  else
+
664  return pgm_read_byte(_font + 6 + (index - first));
+
665 }
+
666 
+
675 int Bitmap::textWidth(const char *str, int len) const
+
676 {
+
677  int width = 0;
+
678  if (len < 0)
+
679  len = strlen(str);
+
680  while (len-- > 0) {
+
681  width += charWidth(*str++);
+
682  if (len > 0)
+
683  ++width;
+
684  }
+
685  return width;
+
686 }
+
687 
+
697 int Bitmap::textWidth(const String &str, int start, int len) const
+
698 {
+
699  int width = 0;
+
700  if (len < 0)
+
701  len = str.length() - start;
+
702  while (len-- > 0) {
+
703  width += charWidth(str[start++]);
+
704  if (len > 0)
+
705  ++width;
+
706  }
+
707  return width;
+
708 }
+
709 
+ +
717 {
+
718  if (_font)
+
719  return fontHeight(_font);
+
720  else
+
721  return 0;
+
722 }
+
723 
+
738 void Bitmap::copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
+
739 {
+
740  if (dest == this) {
+
741  // Copying to within the same bitmap, so copy in a direction
+
742  // that will prevent problems with overlap.
+
743  blit(x, y, x + width - 1, y + height - 1, destX, destY);
+
744  } else {
+
745  // Copying to a different bitmap.
+
746  while (height > 0) {
+
747  for (int tempx = 0; tempx < width; ++tempx)
+
748  dest->setPixel(destX + tempx, destY, pixel(x + tempx, y));
+
749  ++y;
+
750  ++destY;
+
751  --height;
+
752  }
+
753  }
+
754 }
+
755 
+
762 void Bitmap::fill(int x, int y, int width, int height, Color color)
+
763 {
+
764  while (height > 0) {
+
765  for (int temp = 0; temp < width; ++temp)
+
766  setPixel(x + temp, y, color);
+
767  ++y;
+
768  --height;
+
769  }
+
770 }
+
771 
+
785 void Bitmap::fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color)
+
786 {
+
787  uint8_t w = pgm_read_byte(pattern);
+
788  uint8_t s = (w + 7) >> 3;
+
789  uint8_t h = pgm_read_byte(pattern + 1);
+
790  if (!w || !h)
+
791  return;
+
792  Color invColor = !color;
+
793  for (int tempy = 0; tempy < height; ++tempy) {
+
794  const uint8_t *startLine = ((const uint8_t *)pattern) + 2 + (tempy % h) * s;
+
795  const uint8_t *line = startLine;
+
796  uint8_t mask = 0x80;
+
797  uint8_t value = pgm_read_byte(line++);
+
798  int bit = 0;
+
799  for (int tempx = 0; tempx < width; ++tempx) {
+
800  if (value & mask)
+
801  setPixel(x + tempx, y + tempy, color);
+
802  else
+
803  setPixel(x + tempx, y + tempy, invColor);
+
804  if (++bit >= w) {
+
805  mask = 0x80;
+
806  line = startLine;
+
807  value = pgm_read_byte(line++);
+
808  bit = 0;
+
809  } else {
+
810  mask >>= 1;
+
811  if (!mask) {
+
812  mask = 0x80;
+
813  value = pgm_read_byte(line++);
+
814  }
+
815  }
+
816  }
+
817  }
+
818 }
+
819 
+
841 void Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor)
+
842 {
+
843  // Bail out if no scrolling at all.
+
844  if (!dx && !dy)
+
845  return;
+
846 
+
847  // Clamp the scroll region to the extents of the bitmap.
+
848  if (x < 0) {
+
849  width += x;
+
850  x = 0;
+
851  }
+
852  if (y < 0) {
+
853  height += y;
+
854  y = 0;
+
855  }
+
856  if ((x + width) > _width)
+
857  width = _width - x;
+
858  if ((y + height) > _height)
+
859  height = _height - y;
+
860  if (width <= 0 || height <= 0)
+
861  return;
+
862 
+
863  // Scroll the region in the specified direction.
+
864  if (dy < 0) {
+
865  if (dx < 0)
+
866  blit(x - dx, y - dy, x + width - 1 + dx, y + height - 1 + dy, x, y);
+
867  else
+
868  blit(x, y - dy, x + width - 1 - dx, y + height - 1 + dy, x + dx, y);
+
869  } else {
+
870  if (dx < 0)
+
871  blit(x - dx, y, x + width - 1 + dx, y + height - 1 - dy, x, y + dy);
+
872  else
+
873  blit(x, y, x + width - 1 - dx, y + height - 1 - dy, x + dx, y + dy);
+
874  }
+
875 
+
876  // Fill the pixels that were uncovered by the scroll.
+
877  if (dy < 0) {
+
878  fill(x, y + height + dy, width, -dy, fillColor);
+
879  if (dx < 0)
+
880  fill(x + width + dx, y, -dx, height + dy, fillColor);
+
881  else if (dx > 0)
+
882  fill(x, y, dx, height + dy, fillColor);
+
883  } else if (dy > 0) {
+
884  fill(x, y, width, -dy, fillColor);
+
885  if (dx < 0)
+
886  fill(x + width + dx, y + dy, -dx, height - dy, fillColor);
+
887  else if (dx > 0)
+
888  fill(x, y + dy, dx, height - dy, fillColor);
+
889  } else if (dx < 0) {
+
890  fill(x + width + dx, y, -dx, height, fillColor);
+
891  } else if (dx > 0) {
+
892  fill(x, y, dx, height, fillColor);
+
893  }
+
894 }
+
895 
+
902 void Bitmap::invert(int x, int y, int width, int height)
+
903 {
+
904  while (height > 0) {
+
905  for (int tempx = x + width - 1; tempx >= x; --tempx)
+
906  setPixel(tempx, y, !pixel(tempx, y));
+
907  --height;
+
908  ++y;
+
909  }
+
910 }
+
911 
+
912 void Bitmap::blit(int x1, int y1, int x2, int y2, int x3, int y3)
+
913 {
+
914  if (y3 < y1 || (y1 == y3 && x3 <= x1)) {
+
915  for (int tempy = y1; tempy <= y2; ++tempy) {
+
916  int y = y1 - tempy + y3;
+
917  int x = x3 - x1;
+
918  for (int tempx = x1; tempx <= x2; ++tempx)
+
919  setPixel(x + tempx, y, pixel(tempx, tempy));
+
920  }
+
921  } else {
+
922  for (int tempy = y2; tempy >= y1; --tempy) {
+
923  int y = y1 - tempy + y3;
+
924  int x = x3 - x1;
+
925  for (int tempx = x2; tempx >= x1; --tempx)
+
926  setPixel(x + tempx, y, pixel(tempx, tempy));
+
927  }
+
928  }
+
929 }
+
930 
+
931 void Bitmap::drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor)
+
932 {
+
933  if (x != y) {
+
934  setPixel(centerX + x, centerY + y, borderColor);
+
935  setPixel(centerX + y, centerY + x, borderColor);
+
936  setPixel(centerX + y, centerY - x, borderColor);
+
937  setPixel(centerX + x, centerY - y, borderColor);
+
938  setPixel(centerX - x, centerY - y, borderColor);
+
939  setPixel(centerX - y, centerY - x, borderColor);
+
940  setPixel(centerX - y, centerY + x, borderColor);
+
941  setPixel(centerX - x, centerY + y, borderColor);
+
942  if (fillColor != NoFill) {
+
943  if (radius > 1) {
+
944  drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
+
945  drawLine(centerX - y + 1, centerY + x, centerX + y - 1, centerY + x, fillColor);
+
946  drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
+
947  drawLine(centerX - y + 1, centerY - x, centerX + y - 1, centerY - x, fillColor);
+
948  } else if (radius == 1) {
+
949  setPixel(centerX, centerY, fillColor);
+
950  }
+
951  }
+
952  } else {
+
953  setPixel(centerX + x, centerY + y, borderColor);
+
954  setPixel(centerX + y, centerY - x, borderColor);
+
955  setPixel(centerX - x, centerY - y, borderColor);
+
956  setPixel(centerX - y, centerY + x, borderColor);
+
957  if (fillColor != NoFill) {
+
958  if (radius > 1) {
+
959  drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
+
960  drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
+
961  } else if (radius == 1) {
+
962  setPixel(centerX, centerY, fillColor);
+
963  }
+
964  }
+
965  }
+
966 }
+
int width() const
Returns the width of the bitmap in pixels.
Definition: Bitmap.h:48
+
void copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap d...
Definition: Bitmap.cpp:738
+
void scroll(int dx, int dy, Color fillColor=Black)
Scrolls the entire contents of the bitmap by dx and dy.
Definition: Bitmap.h:135
+
Represents a monochrome bitmap within main memory.
Definition: Bitmap.h:32
+
void drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled ...
Definition: Bitmap.cpp:286
+
void setPixel(int x, int y, Color color)
Sets the pixel at (x, y) to color.
Definition: Bitmap.cpp:208
+
void drawLine(int x1, int y1, int x2, int y2, Color color=White)
Draws a line from (x1, y1) to (x2, y2) in color.
Definition: Bitmap.cpp:225
+
void drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)
Draws bitmap at (x, y) in color.
Definition: Bitmap.cpp:388
+
void drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor ...
Definition: Bitmap.cpp:334
+
int drawChar(int x, int y, char ch)
Draws a single character ch at (x, y).
Definition: Bitmap.cpp:585
+
PGM_VOID_P ProgMem
Type that represents a bitmap within program memory.
Definition: Bitmap.h:41
+
uint8_t Color
Type that represents the color of a pixel in a bitmap.
Definition: Bitmap.h:40
+
int height() const
Returns the height of the bitmap in pixels.
Definition: Bitmap.h:49
+
static const Color NoFill
Special color value that is used with drawRect() and drawCircle() to indicate that the interior of th...
Definition: Bitmap.h:46
+
int textWidth(const char *str, int len=-1) const
Returns the width in pixels of the len characters of str in the current font(), including inter-chara...
Definition: Bitmap.cpp:675
+
void fill(int x, int y, int width, int height, Color color)
Fills the width x height pixels starting at top-left corner (x, y) with color.
Definition: Bitmap.cpp:762
+
uint8_t * data()
Returns a pointer to the start of the bitmap's data buffer.
Definition: Bitmap.h:53
+
int textHeight() const
Returns the height in pixels of the current text drawing font(); or zero if font() is not set...
Definition: Bitmap.cpp:716
+
int charWidth(char ch) const
Returns the width in pixels of ch in the current font().
Definition: Bitmap.cpp:650
+
Bitmap(int width, int height)
Constructs a new in-memory bitmap that is width x height pixels in size.
Definition: Bitmap.cpp:88
+
static const Color White
Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...
Definition: Bitmap.h:45
+
int stride() const
Returns the number of bytes in each line of the bitmap's data() buffer.
Definition: Bitmap.h:50
+
static const Color Black
Color value corresponding to "black".
Definition: Bitmap.h:44
+
void clear(Color color=Black)
Clears the entire bitmap to the specified color.
Definition: Bitmap.cpp:174
+
void invert(int x, int y, int width, int height)
Inverts the width x height pixels starting at top-left corner (x, y).
Definition: Bitmap.cpp:902
+
void drawText(int x, int y, const char *str, int len=-1)
Draws the len characters of str at (x, y).
Definition: Bitmap.cpp:526
+
~Bitmap()
Destroys this bitmap.
Definition: Bitmap.cpp:106
+
Color pixel(int x, int y) const
Returns the color of the pixel at (x, y); either Black or White.
Definition: Bitmap.cpp:191
+
+ + + + diff --git a/html/Bitmap_8h_source.html b/html/Bitmap_8h_source.html new file mode 100644 index 00000000..bb395881 --- /dev/null +++ b/html/Bitmap_8h_source.html @@ -0,0 +1,279 @@ + + + + + + +ArduinoLibs: Bitmap.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Bitmap.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Bitmap_h
+
24 #define Bitmap_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <avr/pgmspace.h>
+
28 
+
29 class DMD;
+
30 class String;
+
31 
+
32 class Bitmap
+
33 {
+
34 public:
+
35  Bitmap(int width, int height);
+
36  ~Bitmap();
+
37 
+
38  bool isValid() const { return fb != 0; }
+
39 
+
40  typedef uint8_t Color;
+
41  typedef PGM_VOID_P ProgMem;
+
42  typedef PGM_VOID_P Font;
+
43 
+
44  static const Color Black = 0;
+
45  static const Color White = 1;
+
46  static const Color NoFill = 2;
+
47 
+
48  int width() const { return _width; }
+
49  int height() const { return _height; }
+
50  int stride() const { return _stride; }
+
51  int bitsPerPixel() const { return 1; }
+
52 
+
53  uint8_t *data() { return fb; }
+
54  const uint8_t *data() const { return fb; }
+
55 
+
56  void clear(Color color = Black);
+
57 
+
58  Color pixel(int x, int y) const;
+
59  void setPixel(int x, int y, Color color);
+
60 
+
61  void drawLine(int x1, int y1, int x2, int y2, Color color = White);
+
62  void drawRect(int x1, int y1, int x2, int y2, Color borderColor = White, Color fillColor = NoFill);
+
63  void drawFilledRect(int x1, int y1, int x2, int y2, Color color = White);
+
64  void drawCircle(int centerX, int centerY, int radius, Color borderColor = White, Color fillColor = NoFill);
+
65  void drawFilledCircle(int centerX, int centerY, int radius, Color color = White);
+
66 
+
67  void drawBitmap(int x, int y, const Bitmap &bitmap, Color color = White);
+
68  void drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color = White);
+
69  void drawInvertedBitmap(int x, int y, const Bitmap &bitmap);
+
70  void drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap);
+
71 
+
72  Font font() const { return _font; }
+
73  void setFont(Font font) { _font = font; }
+
74 
+
75  Color textColor() const { return _textColor; }
+
76  void setTextColor(Color color) { _textColor = color; }
+
77 
+
78  void drawText(int x, int y, const char *str, int len = -1);
+
79  void drawText(int x, int y, const String &str, int start = 0, int len = -1);
+
80 
+
81  int drawChar(int x, int y, char ch);
+
82 
+
83  int charWidth(char ch) const;
+
84  int textWidth(const char *str, int len = -1) const;
+
85  int textWidth(const String &str, int start = 0, int len = -1) const;
+
86  int textHeight() const;
+
87 
+
88  void copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY);
+
89  void fill(int x, int y, int width, int height, Color color);
+
90  void fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color = White);
+
91 
+
92  void scroll(int dx, int dy, Color fillColor = Black);
+
93  void scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor = Black);
+
94 
+
95  void invert(int x, int y, int width, int height);
+
96 
+
97 private:
+
98  // Disable copy constructor and operator=().
+
99  Bitmap(const Bitmap &) {}
+
100  Bitmap &operator=(const Bitmap &) { return *this; }
+
101 
+
102  int _width;
+
103  int _height;
+
104  int _stride;
+
105  uint8_t *fb;
+
106  Font _font;
+
107  Color _textColor;
+
108 
+
109  friend class DMD;
+
110 
+
111  void blit(int x1, int y1, int x2, int y2, int x3, int y3);
+
112  void drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor);
+
113 };
+
114 
+
115 inline void Bitmap::drawFilledRect(int x1, int y1, int x2, int y2, Color color)
+
116 {
+
117  drawRect(x1, y1, x2, y2, color, color);
+
118 }
+
119 
+
120 inline void Bitmap::drawFilledCircle(int centerX, int centerY, int radius, Color color)
+
121 {
+
122  drawCircle(centerX, centerY, radius, color, color);
+
123 }
+
124 
+
125 inline void Bitmap::drawInvertedBitmap(int x, int y, const Bitmap &bitmap)
+
126 {
+
127  drawBitmap(x, y, bitmap, Black);
+
128 }
+
129 
+
130 inline void Bitmap::drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)
+
131 {
+
132  drawBitmap(x, y, bitmap, Black);
+
133 }
+
134 
+
135 inline void Bitmap::scroll(int dx, int dy, Color fillColor)
+
136 {
+
137  scroll(0, 0, _width, _height, dx, dy, fillColor);
+
138 }
+
139 
+
140 #endif
+
Handle large dot matrix displays composed of LED's.
Definition: DMD.h:28
+
int width() const
Returns the width of the bitmap in pixels.
Definition: Bitmap.h:48
+
void copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap d...
Definition: Bitmap.cpp:738
+
void scroll(int dx, int dy, Color fillColor=Black)
Scrolls the entire contents of the bitmap by dx and dy.
Definition: Bitmap.h:135
+
Represents a monochrome bitmap within main memory.
Definition: Bitmap.h:32
+
void drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled ...
Definition: Bitmap.cpp:286
+
void setPixel(int x, int y, Color color)
Sets the pixel at (x, y) to color.
Definition: Bitmap.cpp:208
+
void drawFilledCircle(int centerX, int centerY, int radius, Color color=White)
Draws a filled circle with a specific center (centerX, centerY) and radius in color.
Definition: Bitmap.h:120
+
void drawLine(int x1, int y1, int x2, int y2, Color color=White)
Draws a line from (x1, y1) to (x2, y2) in color.
Definition: Bitmap.cpp:225
+
void drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)
Draws bitmap at (x, y) in color.
Definition: Bitmap.cpp:388
+
void drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)
Draws a filled rectangle from (x1, y1) to (x2, y2) in color.
Definition: Bitmap.h:115
+
void drawInvertedBitmap(int x, int y, const Bitmap &bitmap)
Draws bitmap at (x, y) in inverted colors.
Definition: Bitmap.h:125
+
int bitsPerPixel() const
Returns the number of bits per pixel for the bitmap; always 1.
Definition: Bitmap.h:51
+
void drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor ...
Definition: Bitmap.cpp:334
+
void setTextColor(Color color)
Sets the color that will be used for drawing text with drawText() and drawChar(). ...
Definition: Bitmap.h:76
+
int drawChar(int x, int y, char ch)
Draws a single character ch at (x, y).
Definition: Bitmap.cpp:585
+
PGM_VOID_P ProgMem
Type that represents a bitmap within program memory.
Definition: Bitmap.h:41
+
uint8_t Color
Type that represents the color of a pixel in a bitmap.
Definition: Bitmap.h:40
+
Color textColor() const
Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.
Definition: Bitmap.h:75
+
int height() const
Returns the height of the bitmap in pixels.
Definition: Bitmap.h:49
+
static const Color NoFill
Special color value that is used with drawRect() and drawCircle() to indicate that the interior of th...
Definition: Bitmap.h:46
+
int textWidth(const char *str, int len=-1) const
Returns the width in pixels of the len characters of str in the current font(), including inter-chara...
Definition: Bitmap.cpp:675
+
void fill(int x, int y, int width, int height, Color color)
Fills the width x height pixels starting at top-left corner (x, y) with color.
Definition: Bitmap.cpp:762
+
const uint8_t * data() const
Returns a constant pointer to the start of the bitmap's data buffer. This is an overloaded member fun...
Definition: Bitmap.h:54
+
uint8_t * data()
Returns a pointer to the start of the bitmap's data buffer.
Definition: Bitmap.h:53
+
int textHeight() const
Returns the height in pixels of the current text drawing font(); or zero if font() is not set...
Definition: Bitmap.cpp:716
+
int charWidth(char ch) const
Returns the width in pixels of ch in the current font().
Definition: Bitmap.cpp:650
+
Bitmap(int width, int height)
Constructs a new in-memory bitmap that is width x height pixels in size.
Definition: Bitmap.cpp:88
+
bool isValid() const
Returns true if the memory for this bitmap is valid; false otherwise.
Definition: Bitmap.h:38
+
static const Color White
Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...
Definition: Bitmap.h:45
+
Font font() const
Returns the currently selected font, or null if none selected.
Definition: Bitmap.h:72
+
int stride() const
Returns the number of bytes in each line of the bitmap's data() buffer.
Definition: Bitmap.h:50
+
static const Color Black
Color value corresponding to "black".
Definition: Bitmap.h:44
+
void clear(Color color=Black)
Clears the entire bitmap to the specified color.
Definition: Bitmap.cpp:174
+
PGM_VOID_P Font
Type that represents a font within program memory.
Definition: Bitmap.h:42
+
void setFont(Font font)
Sets the font for use with drawText() and drawChar().
Definition: Bitmap.h:73
+
void invert(int x, int y, int width, int height)
Inverts the width x height pixels starting at top-left corner (x, y).
Definition: Bitmap.cpp:902
+
void drawText(int x, int y, const char *str, int len=-1)
Draws the len characters of str at (x, y).
Definition: Bitmap.cpp:526
+
~Bitmap()
Destroys this bitmap.
Definition: Bitmap.cpp:106
+
Color pixel(int x, int y) const
Returns the color of the pixel at (x, y); either Black or White.
Definition: Bitmap.cpp:191
+
+ + + + diff --git a/html/BlinkLED_8cpp_source.html b/html/BlinkLED_8cpp_source.html new file mode 100644 index 00000000..db448774 --- /dev/null +++ b/html/BlinkLED_8cpp_source.html @@ -0,0 +1,204 @@ + + + + + + +ArduinoLibs: BlinkLED.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BlinkLED.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BlinkLED.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
64 BlinkLED::BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState)
+
65  : _pin(pin)
+
66  , _state(initialState)
+
67  , _paused(false)
+
68  , _onTime(onTime)
+
69  , _offTime(offTime)
+
70 {
+
71  pinMode(pin, OUTPUT);
+
72  digitalWrite(pin, initialState ? HIGH : LOW);
+
73  _lastChange = millis();
+
74 }
+
75 
+ +
80 {
+
81  if (_paused)
+
82  return;
+
83  unsigned long currentTime = millis();
+
84  if (_state) {
+
85  if ((currentTime - _lastChange) >= _onTime) {
+
86  digitalWrite(_pin, LOW);
+
87  _lastChange += _onTime;
+
88  _state = false;
+
89  }
+
90  } else {
+
91  if ((currentTime - _lastChange) >= _offTime) {
+
92  digitalWrite(_pin, HIGH);
+
93  _lastChange += _offTime;
+
94  _state = true;
+
95  }
+
96  }
+
97 }
+
98 
+
122 void BlinkLED::setBlinkRate(unsigned long onTime, unsigned long offTime)
+
123 {
+
124  _onTime = onTime;
+
125  _offTime = offTime;
+
126 }
+
127 
+
145 void BlinkLED::setState(bool state)
+
146 {
+
147  if (_state != state) {
+
148  digitalWrite(_pin, state ? HIGH : LOW);
+
149  _state = state;
+
150  _lastChange = millis();
+
151  }
+
152 }
+
153 
+ +
171 {
+
172  if (_paused) {
+
173  _paused = false;
+
174  unsigned long currentTime = millis();
+
175  if (_state) {
+
176  if ((currentTime - _lastChange) >= _onTime) {
+
177  digitalWrite(_pin, LOW);
+
178  _lastChange = currentTime;
+
179  _state = false;
+
180  }
+
181  } else {
+
182  if ((currentTime - _lastChange) >= _offTime) {
+
183  digitalWrite(_pin, HIGH);
+
184  _lastChange = currentTime;
+
185  _state = true;
+
186  }
+
187  }
+
188  }
+
189 }
+
190 
+
void resume()
Resumes the LED blink cycle after a pause().
Definition: BlinkLED.cpp:170
+
void loop()
Definition: BlinkLED.cpp:79
+
unsigned long offTime() const
Returns the number of milliseconds the LED will be off.
Definition: BlinkLED.h:36
+
void setState(bool state)
Sets the current state of the LED, where true is on, false is off.
Definition: BlinkLED.cpp:145
+
void setBlinkRate(unsigned long onTime, unsigned long offTime)
Sets the onTime and offTime (in milliseconds).
Definition: BlinkLED.cpp:122
+
bool state() const
Returns the current state of the LED; true is on, false is off.
Definition: BlinkLED.h:39
+
unsigned long onTime() const
Returns the number of milliseconds the LED will be on.
Definition: BlinkLED.h:35
+
BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)
Initialize a blinking LED on the specified pin.
Definition: BlinkLED.cpp:64
+
+ + + + diff --git a/html/BlinkLED_8h_source.html b/html/BlinkLED_8h_source.html new file mode 100644 index 00000000..d8254cd5 --- /dev/null +++ b/html/BlinkLED_8h_source.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: BlinkLED.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BlinkLED.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef BlinkLED_h
+
24 #define BlinkLED_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class BlinkLED
+
29 {
+
30 public:
+
31  BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState = false);
+
32 
+
33  void loop();
+
34 
+
35  unsigned long onTime() const { return _onTime; }
+
36  unsigned long offTime() const { return _offTime; }
+
37  void setBlinkRate(unsigned long onTime, unsigned long offTime);
+
38 
+
39  bool state() const { return _state; }
+
40  void setState(bool state);
+
41 
+
42  void pause() { _paused = true; }
+
43  void resume();
+
44  bool isPaused() const { return _paused; }
+
45 
+
46 private:
+
47  uint8_t _pin;
+
48  bool _state;
+
49  bool _paused;
+
50  unsigned long _onTime;
+
51  unsigned long _offTime;
+
52  unsigned long _lastChange;
+
53 };
+
54 
+
55 #endif
+
void resume()
Resumes the LED blink cycle after a pause().
Definition: BlinkLED.cpp:170
+
void loop()
Definition: BlinkLED.cpp:79
+
unsigned long offTime() const
Returns the number of milliseconds the LED will be off.
Definition: BlinkLED.h:36
+
void pause()
Pauses the LED blink cycle in its current state().
Definition: BlinkLED.h:42
+
void setState(bool state)
Sets the current state of the LED, where true is on, false is off.
Definition: BlinkLED.cpp:145
+
void setBlinkRate(unsigned long onTime, unsigned long offTime)
Sets the onTime and offTime (in milliseconds).
Definition: BlinkLED.cpp:122
+
Blink a LED on a digital output pin.
Definition: BlinkLED.h:28
+
bool state() const
Returns the current state of the LED; true is on, false is off.
Definition: BlinkLED.h:39
+
unsigned long onTime() const
Returns the number of milliseconds the LED will be on.
Definition: BlinkLED.h:35
+
BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)
Initialize a blinking LED on the specified pin.
Definition: BlinkLED.cpp:64
+
bool isPaused() const
Returns true if the LED blink cycle is paused; false otherwise.
Definition: BlinkLED.h:44
+
+ + + + diff --git a/html/BlockCipher_8cpp_source.html b/html/BlockCipher_8cpp_source.html new file mode 100644 index 00000000..b8ab6afe --- /dev/null +++ b/html/BlockCipher_8cpp_source.html @@ -0,0 +1,133 @@ + + + + + + +ArduinoLibs: BlockCipher.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BlockCipher.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BlockCipher.h"
+
24 
+ +
41 {
+
42 }
+
43 
+ +
53 {
+
54 }
+
55 
+
BlockCipher()
Constructs a block cipher.
Definition: BlockCipher.cpp:40
+
virtual ~BlockCipher()
Destroys this block cipher object.
Definition: BlockCipher.cpp:52
+
+ + + + diff --git a/html/BlockCipher_8h_source.html b/html/BlockCipher_8h_source.html new file mode 100644 index 00000000..1e4b0d48 --- /dev/null +++ b/html/BlockCipher_8h_source.html @@ -0,0 +1,154 @@ + + + + + + +ArduinoLibs: BlockCipher.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BlockCipher.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_BLOCKCIPHER_h
+
24 #define CRYPTO_BLOCKCIPHER_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+ +
30 {
+
31 public:
+
32  BlockCipher();
+
33  virtual ~BlockCipher();
+
34 
+
35  virtual size_t blockSize() const = 0;
+
36  virtual size_t keySize() const = 0;
+
37 
+
38  virtual bool setKey(const uint8_t *key, size_t len) = 0;
+
39 
+
40  virtual void encryptBlock(uint8_t *output, const uint8_t *input) = 0;
+
41  virtual void decryptBlock(uint8_t *output, const uint8_t *input) = 0;
+
42 
+
43  virtual void clear() = 0;
+
44 };
+
45 
+
46 #endif
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
BlockCipher()
Constructs a block cipher.
Definition: BlockCipher.cpp:40
+
virtual ~BlockCipher()
Destroys this block cipher object.
Definition: BlockCipher.cpp:52
+
virtual void decryptBlock(uint8_t *output, const uint8_t *input)=0
Decrypts a single block using this cipher.
+
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
+
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
+
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.
+
+ + + + diff --git a/html/BoolField_8cpp_source.html b/html/BoolField_8cpp_source.html new file mode 100644 index 00000000..eff165b5 --- /dev/null +++ b/html/BoolField_8cpp_source.html @@ -0,0 +1,210 @@ + + + + + + +ArduinoLibs: BoolField.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BoolField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BoolField.h"
+
24 
+
77 BoolField::BoolField(const String &label)
+
78  : Field(label)
+
79  , _printLen(0)
+
80  , _value(false)
+
81 {
+
82 }
+
83 
+
94 BoolField::BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
+
95  : Field(form, label)
+
96  , _trueLabel(trueLabel)
+
97  , _falseLabel(falseLabel)
+
98  , _printLen(0)
+
99  , _value(value)
+
100 {
+
101 }
+
102 
+
103 int BoolField::dispatch(int event)
+
104 {
+
105  if (event == LCD_BUTTON_UP || event == LCD_BUTTON_DOWN) {
+
106  setValue(!_value);
+
107  return FORM_CHANGED;
+
108  } else {
+
109  return -1;
+
110  }
+
111 }
+
112 
+
113 void BoolField::enterField(bool reverse)
+
114 {
+
115  Field::enterField(reverse);
+
116  printValue();
+
117 }
+
118 
+
131 void BoolField::setValue(bool value)
+
132 {
+
133  if (value != _value) {
+
134  _value = value;
+
135  if (isCurrent())
+
136  printValue();
+
137  }
+
138 }
+
139 
+
153 void BoolField::setTrueLabel(const String &trueLabel)
+
154 {
+
155  _trueLabel = trueLabel;
+
156  if (isCurrent())
+
157  printValue();
+
158 }
+
159 
+
173 void BoolField::setFalseLabel(const String &falseLabel)
+
174 {
+
175  _falseLabel = falseLabel;
+
176  if (isCurrent())
+
177  printValue();
+
178 }
+
179 
+
180 void BoolField::printValue()
+
181 {
+
182  unsigned int len;
+
183  lcd()->setCursor(0, 1);
+
184  if (_value) {
+
185  lcd()->print(_trueLabel);
+
186  len = _trueLabel.length();
+
187  while (len++ < _printLen)
+
188  lcd()->write(' ');
+
189  _printLen = _trueLabel.length();
+
190  } else {
+
191  lcd()->print(_falseLabel);
+
192  len = _falseLabel.length();
+
193  while (len++ < _printLen)
+
194  lcd()->write(' ');
+
195  _printLen = _falseLabel.length();
+
196  }
+
197 }
+
BoolField(const String &label)
Constructs a new boolean field with a specific label.
Definition: BoolField.cpp:77
+
void setValue(bool value)
Sets the current value of this field to value.
Definition: BoolField.cpp:131
+
const String & trueLabel() const
Returns the string that is displayed when value() is true.
Definition: BoolField.h:40
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
void setTrueLabel(const String &trueLabel)
Sets the string that is displayed when value() is true to trueLabel.
Definition: BoolField.cpp:153
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
void setFalseLabel(const String &falseLabel)
Sets the string that is displayed when value() is false to falseLabel.
Definition: BoolField.cpp:173
+
int dispatch(int event)
Dispatches event via this field.
Definition: BoolField.cpp:103
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: BoolField.cpp:113
+
const String & falseLabel() const
Returns the string that is displayed when value() is false.
Definition: BoolField.h:43
+
bool value() const
Returns the current value of this field, true or false.
Definition: BoolField.h:37
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
+ + + + diff --git a/html/BoolField_8h_source.html b/html/BoolField_8h_source.html new file mode 100644 index 00000000..4c824cf6 --- /dev/null +++ b/html/BoolField_8h_source.html @@ -0,0 +1,168 @@ + + + + + + +ArduinoLibs: BoolField.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BoolField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef BoolField_h
+
24 #define BoolField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class BoolField : public Field {
+
29 public:
+
30  explicit BoolField(const String &label);
+
31  BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value);
+
32 
+
33  int dispatch(int event);
+
34 
+
35  void enterField(bool reverse);
+
36 
+
37  bool value() const { return _value; }
+
38  void setValue(bool value);
+
39 
+
40  const String &trueLabel() const { return _trueLabel; }
+
41  void setTrueLabel(const String &trueLabel);
+
42 
+
43  const String &falseLabel() const { return _falseLabel; }
+
44  void setFalseLabel(const String &falseLabel);
+
45 
+
46 private:
+
47  String _trueLabel;
+
48  String _falseLabel;
+
49  int _printLen;
+
50  bool _value;
+
51 
+
52  void printValue();
+
53 };
+
54 
+
55 #endif
+
BoolField(const String &label)
Constructs a new boolean field with a specific label.
Definition: BoolField.cpp:77
+
void setValue(bool value)
Sets the current value of this field to value.
Definition: BoolField.cpp:131
+
const String & trueLabel() const
Returns the string that is displayed when value() is true.
Definition: BoolField.h:40
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
void setTrueLabel(const String &trueLabel)
Sets the string that is displayed when value() is true to trueLabel.
Definition: BoolField.cpp:153
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
void setFalseLabel(const String &falseLabel)
Sets the string that is displayed when value() is false to falseLabel.
Definition: BoolField.cpp:173
+
int dispatch(int event)
Dispatches event via this field.
Definition: BoolField.cpp:103
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: BoolField.cpp:113
+
const String & falseLabel() const
Returns the string that is displayed when value() is false.
Definition: BoolField.h:43
+
bool value() const
Returns the current value of this field, true or false.
Definition: BoolField.h:37
+
Field that manages the input of a boolean value.
Definition: BoolField.h:28
+
+ + + + diff --git a/html/CBC_8cpp_source.html b/html/CBC_8cpp_source.html new file mode 100644 index 00000000..3fefdb1a --- /dev/null +++ b/html/CBC_8cpp_source.html @@ -0,0 +1,216 @@ + + + + + + +ArduinoLibs: CBC.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CBC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "CBC.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
43  : blockCipher(0)
+
44  , posn(16)
+
45 {
+
46 }
+
47 
+ +
52 {
+
53  clean(iv);
+
54  clean(temp);
+
55 }
+
56 
+
57 size_t CBCCommon::keySize() const
+
58 {
+
59  return blockCipher->keySize();
+
60 }
+
61 
+
62 size_t CBCCommon::ivSize() const
+
63 {
+
64  return 16;
+
65 }
+
66 
+
67 bool CBCCommon::setKey(const uint8_t *key, size_t len)
+
68 {
+
69  // Verify the cipher's block size, just in case.
+
70  if (blockCipher->blockSize() != 16)
+
71  return false;
+
72 
+
73  // Set the key on the underlying block cipher.
+
74  return blockCipher->setKey(key, len);
+
75 }
+
76 
+
77 bool CBCCommon::setIV(const uint8_t *iv, size_t len)
+
78 {
+
79  if (len != 16)
+
80  return false;
+
81  memcpy(this->iv, iv, 16);
+
82  posn = 16;
+
83  return true;
+
84 }
+
85 
+
86 void CBCCommon::encrypt(uint8_t *output, const uint8_t *input, size_t len)
+
87 {
+
88  uint8_t posn;
+
89  while (len >= 16) {
+
90  for (posn = 0; posn < 16; ++posn)
+
91  iv[posn] ^= *input++;
+
92  blockCipher->encryptBlock(iv, iv);
+
93  for (posn = 0; posn < 16; ++posn)
+
94  *output++ = iv[posn];
+
95  len -= 16;
+
96  }
+
97 }
+
98 
+
99 void CBCCommon::decrypt(uint8_t *output, const uint8_t *input, size_t len)
+
100 {
+
101  uint8_t posn;
+
102  while (len >= 16) {
+
103  blockCipher->decryptBlock(temp, input);
+
104  for (posn = 0; posn < 16; ++posn) {
+
105  uint8_t in = *input++;
+
106  *output++ = temp[posn] ^ iv[posn];
+
107  iv[posn] = in;
+
108  }
+
109  len -= 16;
+
110  }
+
111 }
+
112 
+ +
114 {
+
115  blockCipher->clear();
+
116  clean(iv);
+
117  clean(temp);
+
118  posn = 16;
+
119 }
+
120 
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CBC.cpp:86
+
CBCCommon()
Constructs a new cipher in CBC mode.
Definition: CBC.cpp:42
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CBC.cpp:67
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CBC.cpp:57
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CBC.cpp:113
+
virtual void decryptBlock(uint8_t *output, const uint8_t *input)=0
Decrypts a single block using this cipher.
+
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CBC.cpp:99
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: CBC.cpp:77
+
virtual ~CBCCommon()
Destroys this cipher object after clearing sensitive information.
Definition: CBC.cpp:51
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CBC.cpp:62
+
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
+
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
+
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.
+
+ + + + diff --git a/html/CBC_8h_source.html b/html/CBC_8h_source.html new file mode 100644 index 00000000..6b9afb27 --- /dev/null +++ b/html/CBC_8h_source.html @@ -0,0 +1,180 @@ + + + + + + +ArduinoLibs: CBC.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CBC.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CBC_h
+
24 #define CRYPTO_CBC_h
+
25 
+
26 #include "Cipher.h"
+
27 #include "BlockCipher.h"
+
28 
+
29 class CBCCommon : public Cipher
+
30 {
+
31 public:
+
32  virtual ~CBCCommon();
+
33 
+
34  size_t keySize() const;
+
35  size_t ivSize() const;
+
36 
+
37  bool setKey(const uint8_t *key, size_t len);
+
38  bool setIV(const uint8_t *iv, size_t len);
+
39 
+
40  void encrypt(uint8_t *output, const uint8_t *input, size_t len);
+
41  void decrypt(uint8_t *output, const uint8_t *input, size_t len);
+
42 
+
43  void clear();
+
44 
+
45 protected:
+
46  CBCCommon();
+
47  void setBlockCipher(BlockCipher *cipher) { blockCipher = cipher; }
+
48 
+
49 private:
+
50  BlockCipher *blockCipher;
+
51  uint8_t iv[16];
+
52  uint8_t temp[16];
+
53  uint8_t posn;
+
54 };
+
55 
+
56 template <typename T>
+
57 class CBC : public CBCCommon
+
58 {
+
59 public:
+
60  CBC() { setBlockCipher(&cipher); }
+
61 
+
62 private:
+
63  T cipher;
+
64 };
+
65 
+
66 #endif
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CBC.cpp:86
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
CBCCommon()
Constructs a new cipher in CBC mode.
Definition: CBC.cpp:42
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CBC.cpp:67
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CBC.cpp:57
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CBC.cpp:113
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CBC.cpp:99
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: CBC.cpp:77
+
virtual ~CBCCommon()
Destroys this cipher object after clearing sensitive information.
Definition: CBC.cpp:51
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CBC.cpp:62
+
Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. ...
Definition: CBC.h:57
+
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this CBC object.
Definition: CBC.h:47
+
CBC()
Constructs a new CBC object for the block cipher T.
Definition: CBC.h:60
+
Concrete base class to assist with implementing CBC for 128-bit block ciphers.
Definition: CBC.h:29
+
+ + + + diff --git a/html/CFB_8cpp_source.html b/html/CFB_8cpp_source.html new file mode 100644 index 00000000..05c34b7f --- /dev/null +++ b/html/CFB_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + +ArduinoLibs: CFB.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CFB.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "CFB.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
43  : blockCipher(0)
+
44  , posn(16)
+
45 {
+
46 }
+
47 
+ +
52 {
+
53  clean(iv);
+
54 }
+
55 
+
56 size_t CFBCommon::keySize() const
+
57 {
+
58  return blockCipher->keySize();
+
59 }
+
60 
+
61 size_t CFBCommon::ivSize() const
+
62 {
+
63  return 16;
+
64 }
+
65 
+
66 bool CFBCommon::setKey(const uint8_t *key, size_t len)
+
67 {
+
68  // Verify the cipher's block size, just in case.
+
69  if (blockCipher->blockSize() != 16)
+
70  return false;
+
71 
+
72  // Set the key on the underlying block cipher.
+
73  return blockCipher->setKey(key, len);
+
74 }
+
75 
+
76 bool CFBCommon::setIV(const uint8_t *iv, size_t len)
+
77 {
+
78  if (len != 16)
+
79  return false;
+
80  memcpy(this->iv, iv, 16);
+
81  posn = 16;
+
82  return true;
+
83 }
+
84 
+
85 void CFBCommon::encrypt(uint8_t *output, const uint8_t *input, size_t len)
+
86 {
+
87  uint8_t size;
+
88  while (len > 0) {
+
89  // If we have exhausted the current keystream block, then encrypt
+
90  // the IV/ciphertext to get another keystream block.
+
91  if (posn >= 16) {
+
92  blockCipher->encryptBlock(iv, iv);
+
93  posn = 0;
+
94  }
+
95 
+
96  // XOR the plaintext with the encrypted IV to get the new ciphertext.
+
97  // We keep building up the ciphertext byte by byte in the IV buffer
+
98  // until we have a full block's worth, and then the IV is encrypted
+
99  // again by the code above.
+
100  size = 16 - posn;
+
101  if (size > len)
+
102  size = len;
+
103  len -= size;
+
104  while (size > 0) {
+
105  iv[posn] ^= *input++;
+
106  *output++ = iv[posn++];
+
107  --size;
+
108  }
+
109  }
+
110 }
+
111 
+
112 void CFBCommon::decrypt(uint8_t *output, const uint8_t *input, size_t len)
+
113 {
+
114  uint8_t size;
+
115  while (len > 0) {
+
116  // If we have exhausted the current keystream block, then encrypt
+
117  // the IV/ciphertext to get another keystream block.
+
118  if (posn >= 16) {
+
119  blockCipher->encryptBlock(iv, iv);
+
120  posn = 0;
+
121  }
+
122 
+
123  // XOR the ciphertext with the encrypted IV to get the new plaintext.
+
124  // We keep building up the ciphertext byte by byte in the IV buffer
+
125  // until we have a full block's worth, and then the IV is encrypted
+
126  // again by the code above.
+
127  size = 16 - posn;
+
128  if (size > len)
+
129  size = len;
+
130  len -= size;
+
131  while (size > 0) {
+
132  uint8_t in = *input++;
+
133  *output++ = iv[posn] ^ in;
+
134  iv[posn++] = in;
+
135  --size;
+
136  }
+
137  }
+
138 }
+
139 
+ +
141 {
+
142  blockCipher->clear();
+
143  clean(iv);
+
144  posn = 16;
+
145 }
+
146 
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CFB.cpp:66
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CFB.cpp:56
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CFB.cpp:61
+
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
+
virtual ~CFBCommon()
Destroys this cipher object after clearing sensitive information.
Definition: CFB.cpp:51
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: CFB.cpp:76
+
CFBCommon()
Constructs a new cipher in CFB mode.
Definition: CFB.cpp:42
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CFB.cpp:85
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CFB.cpp:140
+
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
+
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CFB.cpp:112
+
+ + + + diff --git a/html/CFB_8h_source.html b/html/CFB_8h_source.html new file mode 100644 index 00000000..23e7b2a4 --- /dev/null +++ b/html/CFB_8h_source.html @@ -0,0 +1,179 @@ + + + + + + +ArduinoLibs: CFB.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CFB.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CFB_h
+
24 #define CRYPTO_CFB_h
+
25 
+
26 #include "Cipher.h"
+
27 #include "BlockCipher.h"
+
28 
+
29 class CFBCommon : public Cipher
+
30 {
+
31 public:
+
32  virtual ~CFBCommon();
+
33 
+
34  size_t keySize() const;
+
35  size_t ivSize() const;
+
36 
+
37  bool setKey(const uint8_t *key, size_t len);
+
38  bool setIV(const uint8_t *iv, size_t len);
+
39 
+
40  void encrypt(uint8_t *output, const uint8_t *input, size_t len);
+
41  void decrypt(uint8_t *output, const uint8_t *input, size_t len);
+
42 
+
43  void clear();
+
44 
+
45 protected:
+
46  CFBCommon();
+
47  void setBlockCipher(BlockCipher *cipher) { blockCipher = cipher; }
+
48 
+
49 private:
+
50  BlockCipher *blockCipher;
+
51  uint8_t iv[16];
+
52  uint8_t posn;
+
53 };
+
54 
+
55 template <typename T>
+
56 class CFB : public CFBCommon
+
57 {
+
58 public:
+
59  CFB() { setBlockCipher(&cipher); }
+
60 
+
61 private:
+
62  T cipher;
+
63 };
+
64 
+
65 #endif
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CFB.cpp:66
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CFB.cpp:56
+
CFB()
Constructs a new CFB object for the block cipher T.
Definition: CFB.h:59
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers.
Definition: CFB.h:56
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CFB.cpp:61
+
virtual ~CFBCommon()
Destroys this cipher object after clearing sensitive information.
Definition: CFB.cpp:51
+
Concrete base class to assist with implementing CFB for 128-bit block ciphers.
Definition: CFB.h:29
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: CFB.cpp:76
+
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this CFB object.
Definition: CFB.h:47
+
CFBCommon()
Constructs a new cipher in CFB mode.
Definition: CFB.cpp:42
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CFB.cpp:85
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CFB.cpp:140
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CFB.cpp:112
+
+ + + + diff --git a/html/CTR_8cpp_source.html b/html/CTR_8cpp_source.html new file mode 100644 index 00000000..e4638bfe --- /dev/null +++ b/html/CTR_8cpp_source.html @@ -0,0 +1,236 @@ + + + + + + +ArduinoLibs: CTR.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CTR.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "CTR.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
43  : blockCipher(0)
+
44  , posn(16)
+
45  , counterStart(0)
+
46 {
+
47 }
+
48 
+
49 CTRCommon::~CTRCommon()
+
50 {
+
51  // It is assumed that the subclass will clear sensitive
+
52  // information in the block cipher.
+
53  clean(counter);
+
54  clean(state);
+
55 }
+
56 
+
57 size_t CTRCommon::keySize() const
+
58 {
+
59  return blockCipher->keySize();
+
60 }
+
61 
+
62 size_t CTRCommon::ivSize() const
+
63 {
+
64  return 16;
+
65 }
+
66 
+
86 bool CTRCommon::setCounterSize(size_t size)
+
87 {
+
88  if (size < 1 || size > 16)
+
89  return false;
+
90  counterStart = 16 - size;
+
91  return true;
+
92 }
+
93 
+
94 bool CTRCommon::setKey(const uint8_t *key, size_t len)
+
95 {
+
96  // Verify the cipher's block size, just in case.
+
97  if (blockCipher->blockSize() != 16)
+
98  return false;
+
99 
+
100  // Set the key on the underlying block cipher.
+
101  return blockCipher->setKey(key, len);
+
102 }
+
103 
+
119 bool CTRCommon::setIV(const uint8_t *iv, size_t len)
+
120 {
+
121  if (len != 16)
+
122  return false;
+
123  memcpy(counter, iv, len);
+
124  posn = 16;
+
125  return true;
+
126 }
+
127 
+
128 void CTRCommon::encrypt(uint8_t *output, const uint8_t *input, size_t len)
+
129 {
+
130  while (len > 0) {
+
131  if (posn >= 16) {
+
132  // Generate a new encrypted counter block.
+
133  blockCipher->encryptBlock(state, counter);
+
134  posn = 0;
+
135 
+
136  // Increment the counter, taking care not to reveal
+
137  // any timing information about the starting value.
+
138  // We iterate through the entire counter region even
+
139  // if we could stop earlier because a byte is non-zero.
+
140  uint16_t temp = 1;
+
141  uint8_t index = 16;
+
142  while (index > counterStart) {
+
143  --index;
+
144  temp += counter[index];
+
145  counter[index] = (uint8_t)temp;
+
146  temp >>= 8;
+
147  }
+
148  }
+
149  uint8_t templen = 16 - posn;
+
150  if (templen > len)
+
151  templen = len;
+
152  len -= templen;
+
153  while (templen > 0) {
+
154  *output++ = *input++ ^ state[posn++];
+
155  --templen;
+
156  }
+
157  }
+
158 }
+
159 
+
160 void CTRCommon::decrypt(uint8_t *output, const uint8_t *input, size_t len)
+
161 {
+
162  encrypt(output, input, len);
+
163 }
+
164 
+ +
166 {
+
167  blockCipher->clear();
+
168  clean(counter);
+
169  clean(state);
+
170  posn = 16;
+
171 }
+
172 
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initial counter value to use for future encryption and decryption operations.
Definition: CTR.cpp:119
+
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
+
bool setCounterSize(size_t size)
Sets the counter size for the IV.
Definition: CTR.cpp:86
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CTR.cpp:128
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CTR.cpp:160
+
CTRCommon()
Constructs a new cipher in CTR mode.
Definition: CTR.cpp:42
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CTR.cpp:57
+
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CTR.cpp:62
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CTR.cpp:94
+
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
+
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CTR.cpp:165
+
+ + + + diff --git a/html/CTR_8h_source.html b/html/CTR_8h_source.html new file mode 100644 index 00000000..b80913ce --- /dev/null +++ b/html/CTR_8h_source.html @@ -0,0 +1,183 @@ + + + + + + +ArduinoLibs: CTR.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
CTR.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CTR_h
+
24 #define CRYPTO_CTR_h
+
25 
+
26 #include "Cipher.h"
+
27 #include "BlockCipher.h"
+
28 
+
29 class CTRCommon : public Cipher
+
30 {
+
31 public:
+
32  virtual ~CTRCommon();
+
33 
+
34  size_t keySize() const;
+
35  size_t ivSize() const;
+
36 
+
37  bool setCounterSize(size_t size);
+
38 
+
39  bool setKey(const uint8_t *key, size_t len);
+
40  bool setIV(const uint8_t *iv, size_t len);
+
41 
+
42  void encrypt(uint8_t *output, const uint8_t *input, size_t len);
+
43  void decrypt(uint8_t *output, const uint8_t *input, size_t len);
+
44 
+
45  void clear();
+
46 
+
47 protected:
+
48  CTRCommon();
+
49  void setBlockCipher(BlockCipher *cipher) { blockCipher = cipher; }
+
50 
+
51 private:
+
52  BlockCipher *blockCipher;
+
53  uint8_t counter[16];
+
54  uint8_t state[16];
+
55  uint8_t posn;
+
56  uint8_t counterStart;
+
57 };
+
58 
+
59 template <typename T>
+
60 class CTR : public CTRCommon
+
61 {
+
62 public:
+
63  CTR() { setBlockCipher(&cipher); }
+
64 
+
65 private:
+
66  T cipher;
+
67 };
+
68 
+
69 #endif
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
CTR()
Constructs a new CTR object for the 128-bit block cipher T.
Definition: CTR.h:63
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this CTR object.
Definition: CTR.h:49
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initial counter value to use for future encryption and decryption operations.
Definition: CTR.cpp:119
+
bool setCounterSize(size_t size)
Sets the counter size for the IV.
Definition: CTR.cpp:86
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: CTR.cpp:128
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: CTR.cpp:160
+
CTRCommon()
Constructs a new cipher in CTR mode.
Definition: CTR.cpp:42
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: CTR.cpp:57
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: CTR.cpp:62
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: CTR.cpp:94
+
Implementation of the Counter (CTR) mode for 128-bit block ciphers.
Definition: CTR.h:60
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: CTR.cpp:165
+
Concrete base class to assist with implementing CTR mode for 128-bit block ciphers.
Definition: CTR.h:29
+
+ + + + diff --git a/html/ChaCha_8cpp_source.html b/html/ChaCha_8cpp_source.html new file mode 100644 index 00000000..89695b7d --- /dev/null +++ b/html/ChaCha_8cpp_source.html @@ -0,0 +1,308 @@ + + + + + + +ArduinoLibs: ChaCha.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ChaCha.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "ChaCha.h"
+
24 #include "Crypto.h"
+
25 #include "utility/RotateUtil.h"
+
26 #include "utility/EndianUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+
47 ChaCha::ChaCha(uint8_t numRounds)
+
48  : rounds(numRounds)
+
49  , posn(64)
+
50 {
+
51 }
+
52 
+
53 ChaCha::~ChaCha()
+
54 {
+
55  clean(block);
+
56  clean(stream);
+
57 }
+
58 
+
59 size_t ChaCha::keySize() const
+
60 {
+
61  // Default key size is 256-bit, but any key size is allowed.
+
62  return 32;
+
63 }
+
64 
+
65 size_t ChaCha::ivSize() const
+
66 {
+
67  // We return 8 but we also support 12-byte nonces in setIV().
+
68  return 8;
+
69 }
+
70 
+
87 bool ChaCha::setKey(const uint8_t *key, size_t len)
+
88 {
+
89  static const char tag128[] PROGMEM = "expand 16-byte k";
+
90  static const char tag256[] PROGMEM = "expand 32-byte k";
+
91  if (len <= 16) {
+
92  memcpy_P(block, tag128, 16);
+
93  memcpy(block + 16, key, len);
+
94  memcpy(block + 32, key, len);
+
95  if (len < 16) {
+
96  memset(block + 16 + len, 0, 16 - len);
+
97  memset(block + 32 + len, 0, 16 - len);
+
98  }
+
99  } else {
+
100  if (len > 32)
+
101  len = 32;
+
102  memcpy_P(block, tag256, 16);
+
103  memcpy(block + 16, key, len);
+
104  if (len < 32)
+
105  memset(block + 16 + len, 0, 32 - len);
+
106  }
+
107  posn = 64;
+
108  return true;
+
109 }
+
110 
+
111 bool ChaCha::setIV(const uint8_t *iv, size_t len)
+
112 {
+
113  // From draft-nir-cfrg-chacha20-poly1305-04.txt, we can use either
+
114  // 64-bit or 96-bit nonces. The 96-bit nonce consists of the high
+
115  // word of the counter prepended to a regular 64-bit nonce for ChaCha.
+
116  if (len == 8) {
+
117  memset(block + 48, 0, 8);
+
118  memcpy(block + 56, iv, len);
+
119  posn = 64;
+
120  return true;
+
121  } else if (len == 12) {
+
122  memset(block + 48, 0, 4);
+
123  memcpy(block + 52, iv, len);
+
124  posn = 64;
+
125  return true;
+
126  } else {
+
127  return false;
+
128  }
+
129 }
+
130 
+
145 bool ChaCha::setCounter(const uint8_t *counter, size_t len)
+
146 {
+
147  // Normally both the IV and the counter are 8 bytes in length.
+
148  // However, if the IV was 12 bytes, then a 4 byte counter can be used.
+
149  if (len == 4 || len == 8) {
+
150  memcpy(block + 48, counter, len);
+
151  posn = 64;
+
152  return true;
+
153  } else {
+
154  return false;
+
155  }
+
156 }
+
157 
+
158 void ChaCha::encrypt(uint8_t *output, const uint8_t *input, size_t len)
+
159 {
+
160  while (len > 0) {
+
161  if (posn >= 64) {
+
162  // Generate a new encrypted counter block.
+
163  hashCore((uint32_t *)stream, (const uint32_t *)block, rounds);
+
164  posn = 0;
+
165 
+
166  // Increment the counter, taking care not to reveal
+
167  // any timing information about the starting value.
+
168  // We iterate through the entire counter region even
+
169  // if we could stop earlier because a byte is non-zero.
+
170  uint16_t temp = 1;
+
171  uint8_t index = 48;
+
172  while (index < 56) {
+
173  temp += block[index];
+
174  block[index] = (uint8_t)temp;
+
175  temp >>= 8;
+
176  ++index;
+
177  }
+
178  }
+
179  uint8_t templen = 64 - posn;
+
180  if (templen > len)
+
181  templen = len;
+
182  len -= templen;
+
183  while (templen > 0) {
+
184  *output++ = *input++ ^ stream[posn++];
+
185  --templen;
+
186  }
+
187  }
+
188 }
+
189 
+
190 void ChaCha::decrypt(uint8_t *output, const uint8_t *input, size_t len)
+
191 {
+
192  encrypt(output, input, len);
+
193 }
+
194 
+ +
196 {
+
197  clean(block);
+
198  clean(stream);
+
199  posn = 64;
+
200 }
+
201 
+
202 // Perform a ChaCha quarter round operation.
+
203 #define quarterRound(a, b, c, d) \
+
204  do { \
+
205  uint32_t _b = (b); \
+
206  uint32_t _a = (a) + _b; \
+
207  uint32_t _d = leftRotate((d) ^ _a, 16); \
+
208  uint32_t _c = (c) + _d; \
+
209  _b = leftRotate12(_b ^ _c); \
+
210  _a += _b; \
+
211  (d) = _d = leftRotate(_d ^ _a, 8); \
+
212  _c += _d; \
+
213  (a) = _a; \
+
214  (b) = leftRotate7(_b ^ _c); \
+
215  (c) = _c; \
+
216  } while (0)
+
217 
+
230 void ChaCha::hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)
+
231 {
+
232  uint8_t posn;
+
233 
+
234  // Copy the input buffer to the output prior to the first round
+
235  // and convert from little-endian to host byte order.
+
236  for (posn = 0; posn < 16; ++posn)
+
237  output[posn] = le32toh(input[posn]);
+
238 
+
239  // Perform the ChaCha rounds in sets of two.
+
240  for (; rounds >= 2; rounds -= 2) {
+
241  // Column round.
+
242  quarterRound(output[0], output[4], output[8], output[12]);
+
243  quarterRound(output[1], output[5], output[9], output[13]);
+
244  quarterRound(output[2], output[6], output[10], output[14]);
+
245  quarterRound(output[3], output[7], output[11], output[15]);
+
246 
+
247  // Diagonal round.
+
248  quarterRound(output[0], output[5], output[10], output[15]);
+
249  quarterRound(output[1], output[6], output[11], output[12]);
+
250  quarterRound(output[2], output[7], output[8], output[13]);
+
251  quarterRound(output[3], output[4], output[9], output[14]);
+
252  }
+
253 
+
254  // Add the original input to the final output, convert back to
+
255  // little-endian, and return the result.
+
256  for (posn = 0; posn < 16; ++posn)
+
257  output[posn] = htole32(output[posn] + le32toh(input[posn]));
+
258 }
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: ChaCha.cpp:65
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: ChaCha.cpp:87
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: ChaCha.cpp:59
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: ChaCha.cpp:111
+
bool setCounter(const uint8_t *counter, size_t len)
Sets the starting counter for encryption.
Definition: ChaCha.cpp:145
+
ChaCha(uint8_t numRounds=20)
Constructs a new ChaCha stream cipher.
Definition: ChaCha.cpp:47
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: ChaCha.cpp:190
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: ChaCha.cpp:158
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: ChaCha.cpp:195
+
static void hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)
Executes the ChaCha hash core on an input memory block.
Definition: ChaCha.cpp:230
+
+ + + + diff --git a/html/ChaCha_8h_source.html b/html/ChaCha_8h_source.html new file mode 100644 index 00000000..816fcb8a --- /dev/null +++ b/html/ChaCha_8h_source.html @@ -0,0 +1,171 @@ + + + + + + +ArduinoLibs: ChaCha.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ChaCha.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CHACHA_h
+
24 #define CRYPTO_CHACHA_h
+
25 
+
26 #include "Cipher.h"
+
27 
+
28 class ChaCha : public Cipher
+
29 {
+
30 public:
+
31  explicit ChaCha(uint8_t numRounds = 20);
+
32  virtual ~ChaCha();
+
33 
+
34  size_t keySize() const;
+
35  size_t ivSize() const;
+
36 
+
37  uint8_t numRounds() const { return rounds; }
+
38  void setNumRounds(uint8_t numRounds) { rounds = numRounds; }
+
39 
+
40  bool setKey(const uint8_t *key, size_t len);
+
41  bool setIV(const uint8_t *iv, size_t len);
+
42  bool setCounter(const uint8_t *counter, size_t len);
+
43 
+
44  void encrypt(uint8_t *output, const uint8_t *input, size_t len);
+
45  void decrypt(uint8_t *output, const uint8_t *input, size_t len);
+
46 
+
47  void clear();
+
48 
+
49  static void hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds);
+
50 
+
51 private:
+
52  uint8_t block[64];
+
53  uint8_t stream[64];
+
54  uint8_t rounds;
+
55  uint8_t posn;
+
56 };
+
57 
+
58 #endif
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: ChaCha.cpp:65
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: ChaCha.cpp:87
+
ChaCha stream cipher.
Definition: ChaCha.h:28
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: ChaCha.cpp:59
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: ChaCha.cpp:111
+
bool setCounter(const uint8_t *counter, size_t len)
Sets the starting counter for encryption.
Definition: ChaCha.cpp:145
+
ChaCha(uint8_t numRounds=20)
Constructs a new ChaCha stream cipher.
Definition: ChaCha.cpp:47
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: ChaCha.cpp:190
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: ChaCha.cpp:158
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: ChaCha.cpp:195
+
uint8_t numRounds() const
Returns the number of encryption rounds; usually 8, 12, or 20.
Definition: ChaCha.h:37
+
void setNumRounds(uint8_t numRounds)
Sets the number of encryption rounds.
Definition: ChaCha.h:38
+
static void hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)
Executes the ChaCha hash core on an input memory block.
Definition: ChaCha.cpp:230
+
+ + + + diff --git a/html/Charlieplex_8cpp_source.html b/html/Charlieplex_8cpp_source.html new file mode 100644 index 00000000..1a194c1d --- /dev/null +++ b/html/Charlieplex_8cpp_source.html @@ -0,0 +1,240 @@ + + + + + + +ArduinoLibs: Charlieplex.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Charlieplex.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Charlieplex.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <stdlib.h>
+
30 #include <string.h>
+
31 
+
121 Charlieplex::Charlieplex(const uint8_t *pins, uint8_t numPins)
+
122  : _count(((int)numPins) * (numPins - 1))
+
123  , _lastTime(micros())
+
124  , _currentIndex(-1)
+
125  , _pwmPhase(0xC0)
+
126 {
+
127  // Determine the best hold time for 50 Hz refresh when all LED's
+
128  // are lit. Divide it again by 4 (to get 200 Hz) to manage the
+
129  // simulated PWM in refresh().
+
130  _holdTime = 20000 / _count / 4;
+
131 
+
132  // Allocate the pin arrays and populate them. Doing this now makes
+
133  // refresh() more efficient later, at the expense of some memory.
+
134  _pins1 = (uint8_t *)malloc(_count);
+
135  _pins2 = (uint8_t *)malloc(_count);
+
136  int n = 0;
+
137  for (uint8_t pass = 1; pass < numPins; ++pass) {
+
138  for (uint8_t pin = 0; pin < (numPins - pass); ++pin) {
+
139  _pins1[n] = _pins2[n + 1] = pins[pin];
+
140  _pins2[n] = _pins1[n + 1] = pins[pin + pass];
+
141  n += 2;
+
142  }
+
143  }
+
144 
+
145  // Allocate space for the LED value array and zero it.
+
146  _values = (uint8_t *)malloc(_count);
+
147  memset(_values, 0, _count);
+
148 
+
149  // Start with all pins configured as floating inputs (all LED's off).
+
150  for (uint8_t pin = 0; pin < numPins; ++pin) {
+
151  digitalWrite(pins[pin], LOW);
+
152  pinMode(pins[pin], INPUT);
+
153  }
+
154 }
+
155 
+ +
160 {
+
161  free(_pins1);
+
162  free(_pins2);
+
163  free(_values);
+
164 }
+
165 
+ +
278 {
+
279  unsigned long us = micros();
+
280  if ((us - _lastTime) >= _holdTime) {
+
281  _lastTime = us;
+
282  refresh();
+
283  }
+
284 }
+
285 
+ +
297 {
+
298  // Find the next LED to be lit.
+
299  int prevIndex = _currentIndex;
+
300  int limit = _count;
+
301  while (limit >= 0) {
+
302  _currentIndex = (_currentIndex + 1) % _count;
+
303  if (_values[_currentIndex] != 0)
+
304  break;
+
305  --limit;
+
306  }
+
307  if (limit < 0) {
+
308  // No LED's are lit. Turn off the previous LED and exit.
+
309  if (prevIndex != -1) {
+
310  digitalWrite(_pins1[prevIndex], LOW);
+
311  digitalWrite(_pins2[prevIndex], LOW);
+
312  pinMode(_pins1[prevIndex], INPUT);
+
313  pinMode(_pins2[prevIndex], INPUT);
+
314  }
+
315  _currentIndex = -1;
+
316  return;
+
317  }
+
318 
+
319  // Light the current LED.
+
320  uint8_t value = _values[_currentIndex];
+
321  uint8_t pin1 = _pins1[_currentIndex];
+
322  uint8_t pin2 = _pins2[_currentIndex];
+
323  _pwmPhase += 0x40;
+
324  if (prevIndex != _currentIndex) {
+
325  // Turn off the previous LED.
+
326  if (prevIndex != -1) {
+
327  digitalWrite(_pins1[prevIndex], LOW);
+
328  digitalWrite(_pins2[prevIndex], LOW);
+
329  pinMode(_pins1[prevIndex], INPUT);
+
330  pinMode(_pins2[prevIndex], INPUT);
+
331  }
+
332 
+
333  // We simulate PWM using a phase counter because analogWrite()
+
334  // combined with holdTime() causes too much flickering if more
+
335  // than one LED is lit. This reduces the PWM resolution to 1 in 4.
+
336  pinMode(pin1, OUTPUT);
+
337  pinMode(pin2, OUTPUT);
+
338  if (value > _pwmPhase)
+
339  digitalWrite(pin1, HIGH);
+
340  else
+
341  digitalWrite(pin1, LOW);
+
342  } else {
+
343  // Same LED as previous. Since there is only a single LED
+
344  // that is lit, we can use analogWrite() to set the PWM state.
+
345  if (value == 255)
+
346  digitalWrite(pin1, HIGH);
+
347  else
+
348  analogWrite(pin1, value);
+
349  }
+
350 }
+
~Charlieplex()
Destroys this charlieplexed array.
+
Charlieplex(const uint8_t *pins, uint8_t numPins)
Constructs a new charliexplexing array where the output pins are specified by the numPins entries in ...
+
void loop()
Runs the multiplexing loop, to display the LED states on the charlieplexed array. ...
+
void refresh()
Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.
+
+ + + + diff --git a/html/Charlieplex_8h_source.html b/html/Charlieplex_8h_source.html new file mode 100644 index 00000000..7bb95ee5 --- /dev/null +++ b/html/Charlieplex_8h_source.html @@ -0,0 +1,170 @@ + + + + + + +ArduinoLibs: Charlieplex.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Charlieplex.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Charlieplex_h
+
24 #define Charlieplex_h
+
25 
+
26 #include <inttypes.h>
+
27 
+ +
29 {
+
30 public:
+
31  Charlieplex(const uint8_t *pins, uint8_t numPins);
+
32  ~Charlieplex();
+
33 
+
34  int count() const { return _count; }
+
35 
+
36  bool led(int index) const { return _values[index] != 0; }
+
37  void setLed(int index, bool value) { _values[index] = (value ? 255 : 0); }
+
38 
+
39  uint8_t pwmLed(int index) const { return _values[index]; }
+
40  void setPwmLed(int index, uint8_t value) { _values[index] = value; }
+
41 
+
42  unsigned long holdTime() const { return _holdTime; }
+
43  void setHoldTime(unsigned long us) { _holdTime = us; }
+
44 
+
45  void loop();
+
46  void refresh();
+
47 
+
48 private:
+
49  int _count;
+
50  uint8_t *_pins1;
+
51  uint8_t *_pins2;
+
52  uint8_t *_values;
+
53  unsigned long _holdTime;
+
54  unsigned long _lastTime;
+
55  int _currentIndex;
+
56  uint8_t _pwmPhase;
+
57 };
+
58 
+
59 #endif
+
void setPwmLed(int index, uint8_t value)
Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.
Definition: Charlieplex.h:40
+
~Charlieplex()
Destroys this charlieplexed array.
+
void setHoldTime(unsigned long us)
Sets the number of microseconds that each LED should be held on for before moving onto the next in lo...
Definition: Charlieplex.h:43
+
Manage an array of LED's in a charlieplexed arrangement.
Definition: Charlieplex.h:28
+
void setLed(int index, bool value)
Sets the value of the LED at index in the charliplexed array.
Definition: Charlieplex.h:37
+
bool led(int index) const
Returns the value of the LED at index in the charplexed array; true if lit; false if not lit...
Definition: Charlieplex.h:36
+
Charlieplex(const uint8_t *pins, uint8_t numPins)
Constructs a new charliexplexing array where the output pins are specified by the numPins entries in ...
+
void loop()
Runs the multiplexing loop, to display the LED states on the charlieplexed array. ...
+
int count() const
Returns the number of LED's in this charlieplexed array based on the number of pins.
Definition: Charlieplex.h:34
+
unsigned long holdTime() const
Returns the number of microseconds that each LED should be held on for before moving onto the next in...
Definition: Charlieplex.h:42
+
void refresh()
Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.
+
uint8_t pwmLed(int index) const
Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.
Definition: Charlieplex.h:39
+
+ + + + diff --git a/html/ChaseLEDs_8cpp_source.html b/html/ChaseLEDs_8cpp_source.html new file mode 100644 index 00000000..741dc1e6 --- /dev/null +++ b/html/ChaseLEDs_8cpp_source.html @@ -0,0 +1,168 @@ + + + + + + +ArduinoLibs: ChaseLEDs.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ChaseLEDs.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "ChaseLEDs.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
71 ChaseLEDs::ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)
+
72  : _pins(pins)
+
73  , _numPins(num)
+
74  , _currentIndex(-1)
+
75  , _advanceTime(advanceTime)
+
76  , _lastChange(millis())
+
77 {
+
78  for (uint8_t index = 0; index < _numPins; ++index) {
+
79  pinMode(_pins[index], OUTPUT);
+
80  digitalWrite(_pins[index], LOW);
+
81  }
+
82 }
+
83 
+ +
88 {
+
89  if (_currentIndex >= 0) {
+
90  if ((millis() - _lastChange) >= _advanceTime) {
+
91  // Advance to the next LED in sequence.
+
92  _currentIndex = (_currentIndex + 1) % _numPins;
+
93  _lastChange += _advanceTime;
+
94  advance(previousPin(1), _pins[_currentIndex]);
+
95  }
+
96  } else {
+
97  // First time - light the first LED.
+
98  _currentIndex = 0;
+
99  _lastChange = millis();
+
100  advance(previousPin(1), _pins[_currentIndex]);
+
101  }
+
102 }
+
103 
+
136 void ChaseLEDs::advance(uint8_t prevPin, uint8_t nextPin)
+
137 {
+
138  digitalWrite(prevPin, LOW);
+
139  digitalWrite(nextPin, HIGH);
+
140 }
+
141 
+
virtual void advance(uint8_t prevPin, uint8_t nextPin)
Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.
Definition: ChaseLEDs.cpp:136
+
uint8_t previousPin(int n) const
Returns the pin that is n steps back in the sequence.
Definition: ChaseLEDs.h:40
+
void loop()
Definition: ChaseLEDs.cpp:87
+
ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)
Initializes the LED chaser.
Definition: ChaseLEDs.cpp:71
+
+ + + + diff --git a/html/ChaseLEDs_8h_source.html b/html/ChaseLEDs_8h_source.html new file mode 100644 index 00000000..47502fd5 --- /dev/null +++ b/html/ChaseLEDs_8h_source.html @@ -0,0 +1,157 @@ + + + + + + +ArduinoLibs: ChaseLEDs.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ChaseLEDs.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef ChaseLEDs_h
+
24 #define ChaseLEDs_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class ChaseLEDs
+
29 {
+
30 public:
+
31  ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime);
+
32 
+
33  void loop();
+
34 
+
35  unsigned long advanceTime() const { return _advanceTime; }
+
36  void setAdvanceTime(unsigned long advanceTime) { _advanceTime = advanceTime; }
+
37 
+
38 protected:
+
39  virtual void advance(uint8_t prevPin, uint8_t nextPin);
+
40  uint8_t previousPin(int n) const
+
41  { return _pins[(_currentIndex + _numPins - n) % _numPins]; }
+
42 
+
43 private:
+
44  const uint8_t *_pins;
+
45  int _numPins;
+
46  int _currentIndex;
+
47  unsigned long _advanceTime;
+
48  unsigned long _lastChange;
+
49 };
+
50 
+
51 #endif
+
unsigned long advanceTime() const
Returns the number of milliseconds that each LED will be lit in the chase sequence.
Definition: ChaseLEDs.h:35
+
virtual void advance(uint8_t prevPin, uint8_t nextPin)
Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.
Definition: ChaseLEDs.cpp:136
+
uint8_t previousPin(int n) const
Returns the pin that is n steps back in the sequence.
Definition: ChaseLEDs.h:40
+
void loop()
Definition: ChaseLEDs.cpp:87
+
Chase LED's on output pins in a defined sequence.
Definition: ChaseLEDs.h:28
+
ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)
Initializes the LED chaser.
Definition: ChaseLEDs.cpp:71
+
void setAdvanceTime(unsigned long advanceTime)
Sets the number of milliseconds to advance between LED's to advanceTime.
Definition: ChaseLEDs.h:36
+
+ + + + diff --git a/html/Cipher_8cpp_source.html b/html/Cipher_8cpp_source.html new file mode 100644 index 00000000..12b88722 --- /dev/null +++ b/html/Cipher_8cpp_source.html @@ -0,0 +1,133 @@ + + + + + + +ArduinoLibs: Cipher.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Cipher.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Cipher.h"
+
24 
+ +
42 {
+
43 }
+
44 
+ +
54 {
+
55 }
+
56 
+
Cipher()
Constructs a new cipher object.
Definition: Cipher.cpp:41
+
virtual ~Cipher()
Destroys this cipher object.
Definition: Cipher.cpp:53
+
+ + + + diff --git a/html/Cipher_8h_source.html b/html/Cipher_8h_source.html new file mode 100644 index 00000000..ca4be790 --- /dev/null +++ b/html/Cipher_8h_source.html @@ -0,0 +1,156 @@ + + + + + + +ArduinoLibs: Cipher.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Cipher.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CIPHER_h
+
24 #define CRYPTO_CIPHER_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 class Cipher
+
30 {
+
31 public:
+
32  Cipher();
+
33  virtual ~Cipher();
+
34 
+
35  virtual size_t keySize() const = 0;
+
36  virtual size_t ivSize() const = 0;
+
37 
+
38  virtual bool setKey(const uint8_t *key, size_t len) = 0;
+
39  virtual bool setIV(const uint8_t *iv, size_t len) = 0;
+
40 
+
41  virtual void encrypt(uint8_t *output, const uint8_t *input, size_t len) = 0;
+
42  virtual void decrypt(uint8_t *output, const uint8_t *input, size_t len) = 0;
+
43 
+
44  virtual void clear() = 0;
+
45 };
+
46 
+
47 #endif
+
virtual size_t ivSize() const =0
Size of the initialization vector for this cipher, in bytes.
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
virtual void encrypt(uint8_t *output, const uint8_t *input, size_t len)=0
Encrypts an input buffer and writes the ciphertext to an output buffer.
+
virtual void decrypt(uint8_t *output, const uint8_t *input, size_t len)=0
Decrypts an input buffer and writes the plaintext to an output buffer.
+
virtual bool setIV(const uint8_t *iv, size_t len)=0
Sets the initialization vector to use for future encryption and decryption operations.
+
Cipher()
Constructs a new cipher object.
Definition: Cipher.cpp:41
+
virtual ~Cipher()
Destroys this cipher object.
Definition: Cipher.cpp:53
+
virtual size_t keySize() const =0
Default size of the key for this cipher, in bytes.
+
virtual void clear()=0
Clears all security-sensitive state from this cipher.
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
+ + + + diff --git a/html/Crypto_8cpp_source.html b/html/Crypto_8cpp_source.html new file mode 100644 index 00000000..04e25b1c --- /dev/null +++ b/html/Crypto_8cpp_source.html @@ -0,0 +1,135 @@ + + + + + + +ArduinoLibs: Crypto.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Crypto.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Crypto.h"
+
24 
+
34 void clean(void *dest, size_t size)
+
35 {
+
36  // Force the use of volatile so that we actually clear the memory.
+
37  // Otherwise the compiler might optimise the entire contents of this
+
38  // function away, which will not be secure.
+
39  volatile uint8_t *d = (volatile uint8_t *)dest;
+
40  while (size > 0) {
+
41  *d++ = 0;
+
42  --size;
+
43  }
+
44 }
+
45 
+
+ + + + diff --git a/html/Crypto_8h_source.html b/html/Crypto_8h_source.html new file mode 100644 index 00000000..65778d76 --- /dev/null +++ b/html/Crypto_8h_source.html @@ -0,0 +1,136 @@ + + + + + + +ArduinoLibs: Crypto.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Crypto.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_h
+
24 #define CRYPTO_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 void clean(void *dest, size_t size);
+
30 
+
31 template <typename T>
+
32 inline void clean(T &var)
+
33 {
+
34  clean(&var, sizeof(T));
+
35 }
+
36 
+
37 #endif
+
+ + + + diff --git a/html/Curve25519_8cpp_source.html b/html/Curve25519_8cpp_source.html new file mode 100644 index 00000000..2f39397a --- /dev/null +++ b/html/Curve25519_8cpp_source.html @@ -0,0 +1,725 @@ + + + + + + +ArduinoLibs: Curve25519.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Curve25519.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Curve25519.h"
+
24 #include "Crypto.h"
+
25 #include "RNG.h"
+
26 #include "utility/ProgMemUtil.h"
+
27 #include <string.h>
+
28 
+
42 // Number of limbs in a value from the field modulo 2^255 - 19.
+
43 // We assume that sizeof(limb_t) is a power of 2: 1, 2, 4, etc.
+
44 #define NUM_LIMBS (32 / sizeof(limb_t))
+
45 
+
46 // Number of bits in limb_t.
+
47 #define LIMB_BITS (8 * sizeof(limb_t))
+
48 
+
68 bool Curve25519::eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32])
+
69 {
+
70  limb_t x_1[NUM_LIMBS];
+
71  limb_t x_2[NUM_LIMBS];
+
72  limb_t x_3[NUM_LIMBS];
+
73  limb_t z_2[NUM_LIMBS];
+
74  limb_t z_3[NUM_LIMBS];
+
75  limb_t A[NUM_LIMBS];
+
76  limb_t B[NUM_LIMBS];
+
77  limb_t C[NUM_LIMBS];
+
78  limb_t D[NUM_LIMBS];
+
79  limb_t E[NUM_LIMBS];
+
80  limb_t AA[NUM_LIMBS];
+
81  limb_t BB[NUM_LIMBS];
+
82  limb_t DA[NUM_LIMBS];
+
83  limb_t CB[NUM_LIMBS];
+
84  uint8_t mask;
+
85  uint8_t sposn;
+
86  uint8_t select;
+
87  uint8_t swap;
+
88  bool retval;
+
89 
+
90  // Unpack the "x" argument into the limb representation
+
91  // which also masks off the high bit. NULL means 9.
+
92  if (x) {
+
93  unpack(x_1, x); // x_1 = x
+
94  } else {
+
95  memset(x_1, 0, sizeof(x_1)); // x_1 = 9
+
96  x_1[0] = 9;
+
97  }
+
98 
+
99  // Check that "x" is within the range of the modulo field.
+
100  // We can do this with a reduction - if there was no borrow
+
101  // then the value of "x" was out of range. Timing is sensitive
+
102  // here so that we don't reveal anything about the value of "x".
+
103  // If there was a reduction, then continue executing the rest
+
104  // of this function with the (now) in-range "x" value and
+
105  // report the failure at the end.
+
106  retval = (bool)(reduceQuick(x_1) & 0x01);
+
107 
+
108  // Initialize the other temporary variables.
+
109  memset(x_2, 0, sizeof(x_2)); // x_2 = 1
+
110  x_2[0] = 1;
+
111  memset(z_2, 0, sizeof(z_2)); // z_2 = 0
+
112  memcpy(x_3, x_1, sizeof(x_1)); // x_3 = x
+
113  memcpy(z_3, x_2, sizeof(x_2)); // z_3 = 1
+
114 
+
115  // Iterate over all 255 bits of "s" from the highest to the lowest.
+
116  // We ignore the high bit of the 256-bit representation of "s".
+
117  mask = 0x40;
+
118  sposn = 31;
+
119  swap = 0;
+
120  for (uint8_t t = 255; t > 0; --t) {
+
121  // Conditional swaps on entry to this bit but only if we
+
122  // didn't swap on the previous bit.
+
123  select = s[sposn] & mask;
+
124  swap ^= select;
+
125  cswap(swap, x_2, x_3);
+
126  cswap(swap, z_2, z_3);
+
127 
+
128  // Evaluate the curve.
+
129  add(A, x_2, z_2); // A = x_2 + z_2
+
130  square(AA, A); // AA = A^2
+
131  sub(B, x_2, z_2); // B = x_2 - z_2
+
132  square(BB, B); // BB = B^2
+
133  sub(E, AA, BB); // E = AA - BB
+
134  add(C, x_3, z_3); // C = x_3 + z_3
+
135  sub(D, x_3, z_3); // D = x_3 - z_3
+
136  mul(DA, D, A); // DA = D * A
+
137  mul(CB, C, B); // CB = C * B
+
138  add(x_3, DA, CB); // x_3 = (DA + CB)^2
+
139  square(x_3, x_3);
+
140  sub(z_3, DA, CB); // z_3 = x_1 * (DA - CB)^2
+
141  square(z_3, z_3);
+
142  mul(z_3, z_3, x_1);
+
143  mul(x_2, AA, BB); // x_2 = AA * BB
+
144  mulA24(z_2, E); // z_2 = E * (AA + a24 * E)
+
145  add(z_2, z_2, AA);
+
146  mul(z_2, z_2, E);
+
147 
+
148  // Move onto the next lower bit of "s".
+
149  mask >>= 1;
+
150  if (!mask) {
+
151  --sposn;
+
152  mask = 0x80;
+
153  swap = select << 7;
+
154  } else {
+
155  swap = select >> 1;
+
156  }
+
157  }
+
158 
+
159  // Final conditional swaps.
+
160  cswap(swap, x_2, x_3);
+
161  cswap(swap, z_2, z_3);
+
162 
+
163  // Compute x_2 * (z_2 ^ (p - 2)) where p = 2^255 - 19.
+
164  recip(z_3, z_2);
+
165  mul(x_2, x_2, z_3);
+
166 
+
167  // Pack the result into the return array.
+
168  pack(result, x_2);
+
169 
+
170  // Clean up and exit.
+
171  clean(x_1);
+
172  clean(x_2);
+
173  clean(x_3);
+
174  clean(z_2);
+
175  clean(z_3);
+
176  clean(A);
+
177  clean(B);
+
178  clean(C);
+
179  clean(D);
+
180  clean(E);
+
181  clean(AA);
+
182  clean(BB);
+
183  clean(DA);
+
184  clean(CB);
+
185  return retval;
+
186 }
+
187 
+
231 void Curve25519::dh1(uint8_t k[32], uint8_t f[32])
+
232 {
+
233  do {
+
234  // Generate a random "f" value and then adjust the value to make
+
235  // it valid as an "s" value for eval(). According to the specification
+
236  // we need to mask off the 3 right-most bits of f[0], mask off the
+
237  // left-most bit of f[31], and set the second to left-most bit of f[31].
+
238  RNG.rand(f, 32);
+
239  f[0] &= 0xF8;
+
240  f[31] = (f[31] & 0x7F) | 0x40;
+
241 
+
242  // Evaluate the curve function: k = Curve25519::eval(f, 9).
+
243  // We pass NULL to eval() to indicate the value 9. There is no
+
244  // need to check the return value from eval() because we know
+
245  // that 9 is a valid field element.
+
246  eval(k, f, 0);
+
247 
+
248  // If "k" is weak for contributory behaviour then reject it,
+
249  // generate another "f" value, and try again. This case is
+
250  // highly unlikely but we still perform the check just in case.
+
251  } while (isWeakPoint(k));
+
252 }
+
253 
+
269 bool Curve25519::dh2(uint8_t k[32], uint8_t f[32])
+
270 {
+
271  uint8_t weak;
+
272 
+
273  // Evaluate the curve function: k = Curve25519::eval(f, k).
+
274  // If "k" is weak for contributory behaviour before or after
+
275  // the curve evaluation, then fail the exchange. For safety
+
276  // we perform every phase of the weak checks even if we could
+
277  // bail out earlier so that the execution takes the same
+
278  // amount of time for weak and non-weak "k" values.
+
279  weak = isWeakPoint(k); // Is "k" weak before?
+
280  weak |= ((eval(k, f, k) ^ 0x01) & 0x01); // Is "k" weak during?
+
281  weak |= isWeakPoint(k); // Is "k" weak after?
+
282  clean(f, 32);
+
283  return (bool)((weak ^ 0x01) & 0x01);
+
284 }
+
285 
+
293 uint8_t Curve25519::isWeakPoint(const uint8_t k[32])
+
294 {
+
295  // List of weak points from http://cr.yp.to/ecdh.html
+
296  // That page lists some others but they are variants on these
+
297  // of the form "point + i * (2^255 - 19)" for i = 0, 1, 2.
+
298  // Here we mask off the high bit and eval() catches the rest.
+
299  static const uint8_t points[5][32] PROGMEM = {
+
300  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
301  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
302  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
303  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+
304  {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
305  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
306  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
307  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+
308  {0xE0, 0xEB, 0x7A, 0x7C, 0x3B, 0x41, 0xB8, 0xAE,
+
309  0x16, 0x56, 0xE3, 0xFA, 0xF1, 0x9F, 0xC4, 0x6A,
+
310  0xDA, 0x09, 0x8D, 0xEB, 0x9C, 0x32, 0xB1, 0xFD,
+
311  0x86, 0x62, 0x05, 0x16, 0x5F, 0x49, 0xB8, 0x00},
+
312  {0x5F, 0x9C, 0x95, 0xBC, 0xA3, 0x50, 0x8C, 0x24,
+
313  0xB1, 0xD0, 0xB1, 0x55, 0x9C, 0x83, 0xEF, 0x5B,
+
314  0x04, 0x44, 0x5C, 0xC4, 0x58, 0x1C, 0x8E, 0x86,
+
315  0xD8, 0x22, 0x4E, 0xDD, 0xD0, 0x9F, 0x11, 0x57},
+
316  {0xEC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+
317  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+
318  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+
319  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}
+
320  };
+
321 
+
322  // Check each of the weak points in turn. We perform the
+
323  // comparisons carefully so as not to reveal the value of "k"
+
324  // in the instruction timing. If "k" is indeed weak then
+
325  // we still check everything so as not to reveal which
+
326  // weak point it is.
+
327  uint8_t result = 0;
+
328  for (uint8_t posn = 0; posn < 5; ++posn) {
+
329  const uint8_t *point = points[posn];
+
330  uint8_t check = (pgm_read_byte(point + 31) ^ k[31]) & 0x7F;
+
331  for (uint8_t index = 31; index > 0; --index)
+
332  check |= (pgm_read_byte(point + index - 1) ^ k[index - 1]);
+
333  result |= (uint8_t)((((uint16_t)0x0100) - check) >> 8);
+
334  }
+
335 
+
336  // The "result" variable will be non-zero if there was a match.
+
337  return result;
+
338 }
+
339 
+
352 void Curve25519::reduce(limb_t *result, limb_t *x, uint8_t size)
+
353 {
+
354  /*
+
355  Note: This explaination is best viewed with a UTF-8 text viewer.
+
356 
+
357  To help explain what this function is doing, the following describes
+
358  how to efficiently compute reductions modulo a base of the form (2ⁿ - b)
+
359  where b is greater than zero and (b + 1)² <= 2ⁿ.
+
360 
+
361  Here we are interested in reducing the result of multiplying two
+
362  numbers that are less than or equal to (2ⁿ - b - 1). That is,
+
363  multiplying numbers that have already been reduced.
+
364 
+
365  Given some x less than or equal to (2ⁿ - b - 1)², we want to find a
+
366  y less than (2ⁿ - b) such that:
+
367 
+
368  y ≡ x mod (2ⁿ - b)
+
369 
+
370  We know that for all integer values of k >= 0:
+
371 
+
372  y ≡ x - k * (2ⁿ - b)
+
373  ≡ x - k * 2ⁿ + k * b
+
374 
+
375  In our case we choose k = ⌊x / 2ⁿ⌋ and then let:
+
376 
+
377  w = (x mod 2ⁿ) + ⌊x / 2ⁿ⌋ * b
+
378 
+
379  The value w will either be the answer y or y can be obtained by
+
380  repeatedly subtracting (2ⁿ - b) from w until it is less than (2ⁿ - b).
+
381  At most b subtractions will be required.
+
382 
+
383  In our case b is 19 which is more subtractions than we would like to do,
+
384  but we can handle that by performing the above reduction twice and then
+
385  performing a single trial subtraction:
+
386 
+
387  w = (x mod 2ⁿ) + ⌊x / 2ⁿ⌋ * b
+
388  y = (w mod 2ⁿ) + ⌊w / 2ⁿ⌋ * b
+
389  if y >= (2ⁿ - b)
+
390  y -= (2ⁿ - b)
+
391 
+
392  The value y is the answer we want for reducing x modulo (2ⁿ - b).
+
393  */
+
394 
+
395  dlimb_t carry;
+
396  uint8_t posn;
+
397 
+
398  // Calculate (x mod 2^255) + ((x / 2^255) * 19) which will
+
399  // either produce the answer we want or it will produce a
+
400  // value of the form "answer + j * (2^255 - 19)".
+
401  carry = ((dlimb_t)(x[NUM_LIMBS - 1] >> (LIMB_BITS - 1))) * 19U;
+
402  x[NUM_LIMBS - 1] &= ((((limb_t)1) << (LIMB_BITS - 1)) - 1);
+
403  for (posn = 0; posn < size; ++posn) {
+
404  carry += ((dlimb_t)(x[posn + NUM_LIMBS])) * 38U;
+
405  carry += x[posn];
+
406  x[posn] = (limb_t)carry;
+
407  carry >>= LIMB_BITS;
+
408  }
+
409  if (size < NUM_LIMBS) {
+
410  // The high order half of the number is short; e.g. for mulA24().
+
411  // Propagate the carry through the rest of the low order part.
+
412  for (posn = size; posn < NUM_LIMBS; ++posn) {
+
413  carry += x[posn];
+
414  x[posn] = (limb_t)carry;
+
415  carry >>= LIMB_BITS;
+
416  }
+
417  }
+
418 
+
419  // The "j" value may still be too large due to the final carry-out.
+
420  // We must repeat the reduction. If we already have the answer,
+
421  // then this won't do any harm but we must still do the calculation
+
422  // to preserve the overall timing.
+
423  carry *= 38U;
+
424  carry += ((dlimb_t)(x[NUM_LIMBS - 1] >> (LIMB_BITS - 1))) * 19U;
+
425  x[NUM_LIMBS - 1] &= ((((limb_t)1) << (LIMB_BITS - 1)) - 1);
+
426  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
427  carry += x[posn];
+
428  x[posn] = (limb_t)carry;
+
429  carry >>= LIMB_BITS;
+
430  }
+
431 
+
432  // At this point "x" will either be the answer or it will be the
+
433  // answer plus (2^255 - 19). Perform a trial subtraction which
+
434  // is equivalent to adding 19 and subtracting 2^255. We put the
+
435  // trial answer into the top-most limbs of the original "x" array.
+
436  // We add 19 here; the subtraction of 2^255 occurs in the next step.
+
437  carry = 19U;
+
438  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
439  carry += x[posn];
+
440  x[posn + NUM_LIMBS] = (limb_t)carry;
+
441  carry >>= LIMB_BITS;
+
442  }
+
443 
+
444  // If there was a borrow, then the bottom-most limbs of "x" are the
+
445  // correct answer. If there was no borrow, then the top-most limbs
+
446  // of "x" are the correct answer. Select the correct answer but do
+
447  // it in a way that instruction timing will not reveal which value
+
448  // was selected. Borrow will occur if the high bit of the previous
+
449  // result is 0: turn the high bit into a selection mask.
+
450  limb_t mask = (limb_t)(((slimb_t)(x[NUM_LIMBS * 2 - 1])) >> (LIMB_BITS - 1));
+
451  limb_t nmask = ~mask;
+
452  x[NUM_LIMBS * 2 - 1] &= ((((limb_t)1) << (LIMB_BITS - 1)) - 1);
+
453  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
454  result[posn] = (x[posn] & nmask) | (x[posn + NUM_LIMBS] & mask);
+
455  }
+
456 }
+
457 
+
471 Curve25519::limb_t Curve25519::reduceQuick(limb_t *x)
+
472 {
+
473  limb_t temp[NUM_LIMBS];
+
474  dlimb_t carry;
+
475  uint8_t posn;
+
476 
+
477  // Perform a trial subtraction of (2^255 - 19) from "x" which is
+
478  // equivalent to adding 19 and subtracting 2^255. We add 19 here;
+
479  // the subtraction of 2^255 occurs in the next step.
+
480  carry = 19U;
+
481  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
482  carry += x[posn];
+
483  temp[posn] = (limb_t)carry;
+
484  carry >>= LIMB_BITS;
+
485  }
+
486 
+
487  // If there was a borrow, then the original "x" is the correct answer.
+
488  // If there was no borrow, then "temp" is the correct answer. Select the
+
489  // correct answer but do it in a way that instruction timing will not
+
490  // reveal which value was selected. Borrow will occur if the high bit
+
491  // of "temp" is 0: turn the high bit into a selection mask.
+
492  limb_t mask = (limb_t)(((slimb_t)(temp[NUM_LIMBS - 1])) >> (LIMB_BITS - 1));
+
493  limb_t nmask = ~mask;
+
494  temp[NUM_LIMBS - 1] &= ((((limb_t)1) << (LIMB_BITS - 1)) - 1);
+
495  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
496  x[posn] = (x[posn] & nmask) | (temp[posn] & mask);
+
497  }
+
498 
+
499  // Clean up "temp".
+
500  clean(temp);
+
501 
+
502  // Return a zero value if we actually subtracted (2^255 - 19) from "x".
+
503  return nmask;
+
504 }
+
505 
+
516 void Curve25519::mul(limb_t *result, const limb_t *x, const limb_t *y)
+
517 {
+
518  limb_t temp[NUM_LIMBS * 2];
+
519  uint8_t i, j;
+
520  dlimb_t carry;
+
521  limb_t word;
+
522 
+
523  // Multiply the lowest word of x by y.
+
524  carry = 0;
+
525  word = x[0];
+
526  for (i = 0; i < NUM_LIMBS; ++i) {
+
527  carry += ((dlimb_t)(y[i])) * word;
+
528  temp[i] = (limb_t)carry;
+
529  carry >>= LIMB_BITS;
+
530  }
+
531  temp[NUM_LIMBS] = (limb_t)carry;
+
532 
+
533  // Multiply and add the remaining words of x by y.
+
534  for (i = 1; i < NUM_LIMBS; ++i) {
+
535  word = x[i];
+
536  carry = 0;
+
537  for (j = 0; j < NUM_LIMBS; ++j) {
+
538  carry += ((dlimb_t)(y[j])) * word;
+
539  carry += temp[i + j];
+
540  temp[i + j] = (limb_t)carry;
+
541  carry >>= LIMB_BITS;
+
542  }
+
543  temp[i + NUM_LIMBS] = (limb_t)carry;
+
544  }
+
545 
+
546  // Reduce the intermediate result modulo 2^255 - 19.
+
547  reduce(result, temp, NUM_LIMBS);
+
548  clean(temp);
+
549 }
+
550 
+
570 void Curve25519::mulA24(limb_t *result, const limb_t *x)
+
571 {
+
572  // The constant a24 = 121665 (0x1DB41) as a limb array.
+
573 #if CURVE25519_LIMB_8BIT
+
574  static limb_t const a24[3] PROGMEM = {0x41, 0xDB, 0x01};
+
575  #define pgm_read_a24(index) (pgm_read_byte(&(a24[(index)])))
+
576 #elif CURVE25519_LIMB_16BIT
+
577  static limb_t const a24[2] PROGMEM = {0xDB41, 0x0001};
+
578  #define pgm_read_a24(index) (pgm_read_word(&(a24[(index)])))
+
579 #elif CURVE25519_LIMB_32BIT
+
580  static limb_t const a24[1] PROGMEM = {0x0001DB41};
+
581  #define pgm_read_a24(index) (pgm_read_dword(&(a24[(index)])))
+
582 #else
+
583  #error "limb_t must be 8, 16, or 32 bits in size"
+
584 #endif
+
585  #define NUM_A24_LIMBS (sizeof(a24) / sizeof(limb_t))
+
586 
+
587  // Multiply the lowest limb of a24 by x and zero-extend into the result.
+
588  limb_t temp[NUM_LIMBS * 2];
+
589  uint8_t i, j;
+
590  dlimb_t carry = 0;
+
591  limb_t word = pgm_read_a24(0);
+
592  for (i = 0; i < NUM_LIMBS; ++i) {
+
593  carry += ((dlimb_t)(x[i])) * word;
+
594  temp[i] = (limb_t)carry;
+
595  carry >>= LIMB_BITS;
+
596  }
+
597  temp[NUM_LIMBS] = (limb_t)carry;
+
598 
+
599  // Multiply and add the remaining limbs of a24.
+
600  for (i = 1; i < NUM_A24_LIMBS; ++i) {
+
601  word = pgm_read_a24(i);
+
602  carry = 0;
+
603  for (j = 0; j < NUM_LIMBS; ++j) {
+
604  carry += ((dlimb_t)(x[j])) * word;
+
605  carry += temp[i + j];
+
606  temp[i + j] = (limb_t)carry;
+
607  carry >>= LIMB_BITS;
+
608  }
+
609  temp[i + NUM_LIMBS] = (limb_t)carry;
+
610  }
+
611 
+
612  // Reduce the intermediate result modulo 2^255 - 19.
+
613  reduce(result, temp, NUM_A24_LIMBS);
+
614  clean(temp);
+
615 }
+
616 
+
627 void Curve25519::add(limb_t *result, const limb_t *x, const limb_t *y)
+
628 {
+
629  dlimb_t carry = 0;
+
630  uint8_t posn;
+
631 
+
632  // Add the two arrays to obtain the intermediate result.
+
633  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
634  carry += x[posn];
+
635  carry += y[posn];
+
636  result[posn] = (limb_t)carry;
+
637  carry >>= LIMB_BITS;
+
638  }
+
639 
+
640  // Reduce the result using the quick trial subtraction method.
+
641  reduceQuick(result);
+
642 }
+
643 
+
654 void Curve25519::sub(limb_t *result, const limb_t *x, const limb_t *y)
+
655 {
+
656  dlimb_t borrow;
+
657  uint8_t posn;
+
658 
+
659  // Subtract y from x to generate the intermediate result.
+
660  borrow = 0;
+
661  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
662  borrow = ((dlimb_t)x[posn]) - y[posn] - ((borrow >> LIMB_BITS) & 0x01);
+
663  result[posn] = (limb_t)borrow;
+
664  }
+
665 
+
666  // If we had a borrow, then the result has gone negative and we
+
667  // have to add 2^255 - 19 to the result to make it positive again.
+
668  // The top bits of "borrow" will be all 1's if there is a borrow
+
669  // or it will be all 0's if there was no borrow. Easiest is to
+
670  // conditionally subtract 19 and then mask off the high bit.
+
671  borrow = (borrow >> LIMB_BITS) & 19U;
+
672  borrow = ((dlimb_t)result[0]) - borrow;
+
673  result[0] = (limb_t)borrow;
+
674  for (posn = 1; posn < NUM_LIMBS; ++posn) {
+
675  borrow = ((dlimb_t)result[posn]) - ((borrow >> LIMB_BITS) & 0x01);
+
676  result[posn] = (limb_t)borrow;
+
677  }
+
678  result[NUM_LIMBS - 1] &= ((((limb_t)1) << (LIMB_BITS - 1)) - 1);
+
679 }
+
680 
+
691 void Curve25519::cswap(uint8_t select, limb_t *x, limb_t *y)
+
692 {
+
693  uint8_t posn;
+
694  limb_t dummy;
+
695  limb_t sel;
+
696 
+
697  // Turn "select" into an all-zeroes or all-ones mask. We don't care
+
698  // which bit or bits is set in the original "select" value.
+
699  sel = (limb_t)(((((dlimb_t)1) << LIMB_BITS) - select) >> LIMB_BITS);
+
700  --sel;
+
701 
+
702  // Swap the two values based on "select". Algorithm from:
+
703  // https://tools.ietf.org/html/draft-irtf-cfrg-curves-02
+
704  for (posn = 0; posn < NUM_LIMBS; ++posn) {
+
705  dummy = sel & (x[posn] ^ y[posn]);
+
706  x[posn] ^= dummy;
+
707  y[posn] ^= dummy;
+
708  }
+
709 }
+
710 
+
718 void Curve25519::recip(limb_t *result, const limb_t *x)
+
719 {
+
720  limb_t t1[NUM_LIMBS];
+
721  uint8_t i, j;
+
722 
+
723  // The reciprocal is the same as x ^ (p - 2) where p = 2^255 - 19.
+
724  // The big-endian hexadecimal expansion of (p - 2) is:
+
725  // 7FFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFEB
+
726  //
+
727  // The naive implementation needs to do 2 multiplications per 1 bit and
+
728  // 1 multiplication per 0 bit. We can improve upon this by creating a
+
729  // pattern 0000000001 ... 0000000001. If we square and multiply the
+
730  // pattern by itself we can turn the pattern into the partial results
+
731  // 0000000011 ... 0000000011, 0000000111 ... 0000000111, etc.
+
732  // This averages out to about 1.1 multiplications per 1 bit instead of 2.
+
733 
+
734  // Build a pattern of 250 bits in length of repeated copies of 0000000001.
+
735  #define RECIP_GROUP_SIZE 10
+
736  #define RECIP_GROUP_BITS 250 // Must be a multiple of RECIP_GROUP_SIZE.
+
737  square(t1, x);
+
738  for (j = 0; j < (RECIP_GROUP_SIZE - 1); ++j)
+
739  square(t1, t1);
+
740  mul(result, t1, x);
+
741  for (i = 0; i < ((RECIP_GROUP_BITS / RECIP_GROUP_SIZE) - 2); ++i) {
+
742  for (j = 0; j < RECIP_GROUP_SIZE; ++j)
+
743  square(t1, t1);
+
744  mul(result, result, t1);
+
745  }
+
746 
+
747  // Multiply bit-shifted versions of the 0000000001 pattern into
+
748  // the result to "fill in" the gaps in the pattern.
+
749  square(t1, result);
+
750  mul(result, result, t1);
+
751  for (j = 0; j < (RECIP_GROUP_SIZE - 2); ++j) {
+
752  square(t1, t1);
+
753  mul(result, result, t1);
+
754  }
+
755 
+
756  // Deal with the 5 lowest bits of (p - 2), 01011, from highest to lowest.
+
757  square(result, result);
+
758  square(result, result);
+
759  mul(result, result, x);
+
760  square(result, result);
+
761  square(result, result);
+
762  mul(result, result, x);
+
763  square(result, result);
+
764  mul(result, result, x);
+
765 
+
766  // Clean up and exit.
+
767  clean(t1);
+
768 }
+
769 
+
782 void Curve25519::unpack(limb_t *result, const uint8_t *x)
+
783 {
+
784 #if CURVE25519_LIMB_8BIT
+
785  memcpy(result, x, 32);
+
786  result[31] &= 0x7F;
+
787 #elif CURVE25519_LIMB_16BIT
+
788  for (uint8_t posn = 0; posn < 16; ++posn) {
+
789  result[posn] = ((limb_t)x[posn * 2]) | (((limb_t)x[posn * 2 + 1]) << 8);
+
790  }
+
791  result[15] &= 0x7FFF;
+
792 #elif CURVE25519_LIMB_32BIT
+
793  for (uint8_t posn = 0; posn < 8; ++posn) {
+
794  result[posn] = ((limb_t)x[posn * 4]) |
+
795  (((limb_t)x[posn * 4 + 1]) << 8) |
+
796  (((limb_t)x[posn * 4 + 2]) << 16) |
+
797  (((limb_t)x[posn * 4 + 3]) << 24);
+
798  }
+
799  result[7] &= 0x7FFFFFFF;
+
800 #endif
+
801 }
+
802 
+
812 void Curve25519::pack(uint8_t *result, const limb_t *x)
+
813 {
+
814 #if CURVE25519_LIMB_8BIT
+
815  memcpy(result, x, 32);
+
816 #elif CURVE25519_LIMB_16BIT
+
817  for (uint8_t posn = 0; posn < 16; ++posn) {
+
818  limb_t value = x[posn];
+
819  result[posn * 2] = (uint8_t)value;
+
820  result[posn * 2 + 1] = (uint8_t)(value >> 8);
+
821  }
+
822 #elif CURVE25519_LIMB_32BIT
+
823  for (uint8_t posn = 0; posn < 8; ++posn) {
+
824  limb_t value = x[posn];
+
825  result[posn * 4] = (uint8_t)value;
+
826  result[posn * 4 + 1] = (uint8_t)(value >> 8);
+
827  result[posn * 4 + 2] = (uint8_t)(value >> 16);
+
828  result[posn * 4 + 3] = (uint8_t)(value >> 24);
+
829  }
+
830 #endif
+
831 }
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:296
+
static bool eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32])
Evaluates the raw Curve25519 function.
Definition: Curve25519.cpp:68
+
static void dh1(uint8_t k[32], uint8_t f[32])
Performs phase 1 of a Diffie-Hellman key exchange using Curve25519.
Definition: Curve25519.cpp:231
+
static bool dh2(uint8_t k[32], uint8_t f[32])
Performs phase 2 of a Diffie-Hellman key exchange using Curve25519.
Definition: Curve25519.cpp:269
+
+ + + + diff --git a/html/Curve25519_8h_source.html b/html/Curve25519_8h_source.html new file mode 100644 index 00000000..666d9963 --- /dev/null +++ b/html/Curve25519_8h_source.html @@ -0,0 +1,196 @@ + + + + + + +ArduinoLibs: Curve25519.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Curve25519.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_CURVE15519_h
+
24 #define CRYPTO_CURVE15519_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 // Define exactly one of these to 1 to set the size of the basic limb type.
+
30 // 16-bit limbs seems to give the best performance on 8-bit AVR micros.
+
31 #define CURVE25519_LIMB_8BIT 0
+
32 #define CURVE25519_LIMB_16BIT 1
+
33 #define CURVE25519_LIMB_32BIT 0
+
34 
+ +
36 {
+
37 public:
+
38  static bool eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32]);
+
39 
+
40  static void dh1(uint8_t k[32], uint8_t f[32]);
+
41  static bool dh2(uint8_t k[32], uint8_t f[32]);
+
42 
+
43 #if defined(TEST_CURVE25519_FIELD_OPS)
+
44 public:
+
45 #else
+
46 private:
+
47 #endif
+
48  // Define the limb types to use on this platform.
+
49  #if CURVE25519_LIMB_8BIT
+
50  typedef uint8_t limb_t;
+
51  typedef int8_t slimb_t;
+
52  typedef uint16_t dlimb_t;
+
53  #elif CURVE25519_LIMB_16BIT
+
54  typedef uint16_t limb_t;
+
55  typedef int16_t slimb_t;
+
56  typedef uint32_t dlimb_t;
+
57  #elif CURVE25519_LIMB_32BIT
+
58  typedef uint32_t limb_t;
+
59  typedef int32_t slimb_t;
+
60  typedef uint64_t dlimb_t;
+
61  #else
+
62  #error "limb_t must be 8, 16, or 32 bits in size"
+
63  #endif
+
64 
+
65  static uint8_t isWeakPoint(const uint8_t k[32]);
+
66 
+
67  static void reduce(limb_t *result, limb_t *x, uint8_t size);
+
68  static limb_t reduceQuick(limb_t *x);
+
69 
+
70  static void mul(limb_t *result, const limb_t *x, const limb_t *y);
+
71  static void square(limb_t *result, const limb_t *x)
+
72  {
+
73  mul(result, x, x);
+
74  }
+
75 
+
76  static void mulA24(limb_t *result, const limb_t *x);
+
77 
+
78  static void add(limb_t *result, const limb_t *x, const limb_t *y);
+
79  static void sub(limb_t *result, const limb_t *x, const limb_t *y);
+
80 
+
81  static void cswap(uint8_t select, limb_t *x, limb_t *y);
+
82 
+
83  static void recip(limb_t *result, const limb_t *x);
+
84 
+
85  static void unpack(limb_t *result, const uint8_t *x);
+
86  static void pack(uint8_t *result, const limb_t *x);
+
87 
+
88  // Constructor and destructor are private - cannot instantiate this class.
+
89  Curve25519() {}
+
90  ~Curve25519() {}
+
91 };
+
92 
+
93 #endif
+
Diffie-Hellman key agreement based on the elliptic curve modulo 2^255 - 19.
Definition: Curve25519.h:35
+
static bool eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32])
Evaluates the raw Curve25519 function.
Definition: Curve25519.cpp:68
+
static void dh1(uint8_t k[32], uint8_t f[32])
Performs phase 1 of a Diffie-Hellman key exchange using Curve25519.
Definition: Curve25519.cpp:231
+
static bool dh2(uint8_t k[32], uint8_t f[32])
Performs phase 2 of a Diffie-Hellman key exchange using Curve25519.
Definition: Curve25519.cpp:269
+
+ + + + diff --git a/html/Cylon.png b/html/Cylon.png new file mode 100644 index 00000000..231ccb78 Binary files /dev/null and b/html/Cylon.png differ diff --git a/html/Cylon4.png b/html/Cylon4.png new file mode 100644 index 00000000..a4212868 Binary files /dev/null and b/html/Cylon4.png differ diff --git a/html/DMD_8cpp_source.html b/html/DMD_8cpp_source.html new file mode 100644 index 00000000..2e162aad --- /dev/null +++ b/html/DMD_8cpp_source.html @@ -0,0 +1,464 @@ + + + + + + +ArduinoLibs: DMD.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DMD.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DMD.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <pins_arduino.h>
+
30 #include <avr/io.h>
+
31 #include <avr/interrupt.h>
+
32 #include <string.h>
+
33 #include <stdlib.h>
+
34 
+
210 // Pins on the DMD connector board.
+
211 #define DMD_PIN_PHASE_LSB 6 // A
+
212 #define DMD_PIN_PHASE_MSB 7 // B
+
213 #define DMD_PIN_LATCH 8 // SCLK
+
214 #define DMD_PIN_OUTPUT_ENABLE 9 // nOE
+
215 #define DMD_PIN_SPI_SS SS // SPI Slave Select
+
216 #define DMD_PIN_SPI_MOSI MOSI // SPI Master Out, Slave In (R)
+
217 #define DMD_PIN_SPI_MISO MISO // SPI Master In, Slave Out
+
218 #define DMD_PIN_SPI_SCK SCK // SPI Serial Clock (CLK)
+
219 
+
220 // Dimension information for the display.
+
221 #define DMD_NUM_COLUMNS 32 // Number of columns in a panel.
+
222 #define DMD_NUM_ROWS 16 // Number of rows in a panel.
+
223 
+
224 // Refresh times.
+
225 #define DMD_REFRESH_MS 5
+
226 #define DMD_REFRESH_US 5000
+
227 
+
237 DMD::DMD(int widthPanels, int heightPanels)
+
238  : Bitmap(widthPanels * DMD_NUM_COLUMNS, heightPanels * DMD_NUM_ROWS)
+
239  , _doubleBuffer(false)
+
240  , phase(0)
+
241  , fb0(0)
+
242  , fb1(0)
+
243  , displayfb(0)
+
244  , lastRefresh(millis())
+
245 {
+
246  // Both rendering and display are to fb0 initially.
+
247  fb0 = displayfb = fb;
+
248 
+
249  // Initialize SPI to MSB-first, mode 0, clock divider = 2.
+
250  pinMode(DMD_PIN_SPI_SCK, OUTPUT);
+
251  pinMode(DMD_PIN_SPI_MOSI, OUTPUT);
+
252  pinMode(DMD_PIN_SPI_SS, OUTPUT);
+
253  digitalWrite(DMD_PIN_SPI_SCK, LOW);
+
254  digitalWrite(DMD_PIN_SPI_MOSI, LOW);
+
255  digitalWrite(DMD_PIN_SPI_SS, HIGH);
+
256  SPCR |= _BV(MSTR);
+
257  SPCR |= _BV(SPE);
+
258  SPCR &= ~(_BV(DORD)); // MSB-first
+
259  SPCR &= ~0x0C; // Mode 0
+
260  SPCR &= ~0x03; // Clock divider rate 2
+
261  SPSR |= 0x01; // MSB of clock divider rate
+
262 
+
263  // Initialize the DMD-specific pins.
+
264  pinMode(DMD_PIN_PHASE_LSB, OUTPUT);
+
265  pinMode(DMD_PIN_PHASE_MSB, OUTPUT);
+
266  pinMode(DMD_PIN_LATCH, OUTPUT);
+
267  pinMode(DMD_PIN_OUTPUT_ENABLE, OUTPUT);
+
268  digitalWrite(DMD_PIN_PHASE_LSB, LOW);
+
269  digitalWrite(DMD_PIN_PHASE_MSB, LOW);
+
270  digitalWrite(DMD_PIN_LATCH, LOW);
+
271  digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
+
272  digitalWrite(DMD_PIN_SPI_MOSI, HIGH);
+
273 }
+
274 
+ +
279 {
+
280  if (fb0)
+
281  free(fb0);
+
282  if (fb1)
+
283  free(fb1);
+
284  fb = 0; // Don't free the buffer again in the base class.
+
285 }
+
286 
+
314 void DMD::setDoubleBuffer(bool doubleBuffer)
+
315 {
+
316  if (doubleBuffer != _doubleBuffer) {
+
317  _doubleBuffer = doubleBuffer;
+
318  if (doubleBuffer) {
+
319  // Allocate a new back buffer.
+
320  unsigned int size = _stride * _height;
+
321  fb1 = (uint8_t *)malloc(size);
+
322 
+
323  // Clear the new back buffer and then switch to it, leaving
+
324  // the current contents of fb0 on the screen.
+
325  if (fb1) {
+
326  memset(fb1, 0xFF, size);
+
327  cli();
+
328  fb = fb1;
+
329  displayfb = fb0;
+
330  sei();
+
331  } else {
+
332  // Failed to allocate the memory, so revert to single-buffered.
+
333  _doubleBuffer = false;
+
334  }
+
335  } else if (fb1) {
+
336  // Disabling double-buffering, so forcibly switch to fb0.
+
337  cli();
+
338  fb = fb0;
+
339  displayfb = fb0;
+
340  sei();
+
341 
+
342  // Free the unnecessary buffer.
+
343  free(fb1);
+
344  fb1 = 0;
+
345  }
+
346  }
+
347 }
+
348 
+ +
364 {
+
365  if (_doubleBuffer) {
+
366  // Turn off interrupts while swapping buffers so that we don't
+
367  // accidentally try to refresh() in the middle of this code.
+
368  cli();
+
369  if (fb == fb0) {
+
370  fb = fb1;
+
371  displayfb = fb0;
+
372  } else {
+
373  fb = fb0;
+
374  displayfb = fb1;
+
375  }
+
376  sei();
+
377  }
+
378 }
+
379 
+ +
397 {
+
398  swapBuffers();
+
399  if (_doubleBuffer)
+
400  memcpy(fb, displayfb, _stride * _height);
+
401 }
+
402 
+
420 void DMD::loop()
+
421 {
+
422  unsigned long currentTime = millis();
+
423  if ((currentTime - lastRefresh) >= DMD_REFRESH_MS) {
+
424  lastRefresh = currentTime;
+
425  refresh();
+
426  }
+
427 }
+
428 
+
429 // Send a single byte via SPI.
+
430 static inline void spiSend(byte value)
+
431 {
+
432  SPDR = value;
+
433  while (!(SPSR & _BV(SPIF)))
+
434  ; // Wait for the transfer to complete.
+
435 }
+
436 
+
437 // Flip the bits in a byte. Table generated by genflip.c
+
438 static const uint8_t flipBits[256] PROGMEM = {
+
439  0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0,
+
440  0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
+
441  0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4,
+
442  0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
+
443  0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC,
+
444  0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
+
445  0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA,
+
446  0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
+
447  0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6,
+
448  0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
+
449  0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1,
+
450  0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
+
451  0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9,
+
452  0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
+
453  0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD,
+
454  0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
+
455  0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3,
+
456  0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
+
457  0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7,
+
458  0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
+
459  0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF,
+
460  0x3F, 0xBF, 0x7F, 0xFF
+
461 };
+
462 
+ +
479 {
+
480  // Bail out if there is a conflict on the SPI bus.
+
481  if (!digitalRead(DMD_PIN_SPI_SS))
+
482  return;
+
483 
+
484  // Transfer the data for the next group of interleaved rows.
+
485  int stride4 = _stride * 4;
+
486  uint8_t *data0;
+
487  uint8_t *data1;
+
488  uint8_t *data2;
+
489  uint8_t *data3;
+
490  bool flipRow = ((_height & 0x10) == 0);
+
491  for (int y = 0; y < _height; y += 16) {
+
492  if (!flipRow) {
+
493  // The panels in this row are the right way up.
+
494  data0 = displayfb + _stride * (y + phase);
+
495  data1 = data0 + stride4;
+
496  data2 = data1 + stride4;
+
497  data3 = data2 + stride4;
+
498  for (int x = _stride; x > 0; --x) {
+
499  spiSend(*data3++);
+
500  spiSend(*data2++);
+
501  spiSend(*data1++);
+
502  spiSend(*data0++);
+
503  }
+
504  flipRow = true;
+
505  } else {
+
506  // The panels in this row are upside-down and reversed.
+
507  data0 = displayfb + _stride * (y + 16 - phase) - 1;
+
508  data1 = data0 - stride4;
+
509  data2 = data1 - stride4;
+
510  data3 = data2 - stride4;
+
511  for (int x = _stride; x > 0; --x) {
+
512  spiSend(pgm_read_byte(&(flipBits[*data3--])));
+
513  spiSend(pgm_read_byte(&(flipBits[*data2--])));
+
514  spiSend(pgm_read_byte(&(flipBits[*data1--])));
+
515  spiSend(pgm_read_byte(&(flipBits[*data0--])));
+
516  }
+
517  flipRow = false;
+
518  }
+
519  }
+
520 
+
521  // Latch the data from the shift registers onto the actual display.
+
522  digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
+
523  digitalWrite(DMD_PIN_LATCH, HIGH);
+
524  digitalWrite(DMD_PIN_LATCH, LOW);
+
525  if (phase & 0x02)
+
526  digitalWrite(DMD_PIN_PHASE_MSB, HIGH);
+
527  else
+
528  digitalWrite(DMD_PIN_PHASE_MSB, LOW);
+
529  if (phase & 0x01)
+
530  digitalWrite(DMD_PIN_PHASE_LSB, HIGH);
+
531  else
+
532  digitalWrite(DMD_PIN_PHASE_LSB, LOW);
+
533  digitalWrite(DMD_PIN_OUTPUT_ENABLE, HIGH);
+
534  phase = (phase + 1) & 0x03;
+
535 }
+
536 
+ +
564 {
+
565  // Number of CPU cycles in the display's refresh period.
+
566  unsigned long numCycles = (F_CPU / 2000000) * DMD_REFRESH_US;
+
567 
+
568  // Determine the prescaler to be used.
+
569  #define TIMER1_RESOLUTION 65536UL
+
570  uint8_t prescaler;
+
571  if (numCycles < TIMER1_RESOLUTION) {
+
572  // No prescaling required.
+
573  prescaler = _BV(CS10);
+
574  } else if (numCycles < TIMER1_RESOLUTION * 8) {
+
575  // Prescaler = 8.
+
576  prescaler = _BV(CS11);
+
577  numCycles >>= 3;
+
578  } else if (numCycles < TIMER1_RESOLUTION * 64) {
+
579  // Prescaler = 64.
+
580  prescaler = _BV(CS11) | _BV(CS10);
+
581  numCycles >>= 6;
+
582  } else if (numCycles < TIMER1_RESOLUTION * 256) {
+
583  // Prescaler = 256.
+
584  prescaler = _BV(CS12);
+
585  numCycles >>= 8;
+
586  } else if (numCycles < TIMER1_RESOLUTION * 1024) {
+
587  // Prescaler = 1024.
+
588  prescaler = _BV(CS12) | _BV(CS10);
+
589  numCycles >>= 10;
+
590  } else {
+
591  // Too long, so set the maximum timeout.
+
592  prescaler = _BV(CS12) | _BV(CS10);
+
593  numCycles = TIMER1_RESOLUTION - 1;
+
594  }
+
595 
+
596  // Configure Timer1 for the period we want.
+
597  TCCR1A = 0;
+
598  TCCR1B = _BV(WGM13);
+
599  uint8_t saveSREG = SREG;
+
600  cli();
+
601  ICR1 = numCycles;
+
602  SREG = saveSREG; // Implicit sei() if interrupts were on previously.
+
603  TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11) | _BV(CS10))) | prescaler;
+
604 
+
605  // Turn on the Timer1 overflow interrupt.
+
606  TIMSK1 |= _BV(TOIE1);
+
607 }
+
608 
+ +
615 {
+
616  // Turn off the Timer1 overflow interrupt.
+
617  TIMSK1 &= ~_BV(TOIE1);
+
618 }
+
619 
+ +
647 {
+
648  // Configure Timer2 for the period we want. With the prescaler set
+
649  // to 128, then 256 increments of Timer2 gives roughly 4 ms between
+
650  // overflows on a system with a 16 MHz clock. We adjust the prescaler
+
651  // accordingly for other clock frequencies.
+
652  TCCR2A = 0;
+
653  if (F_CPU >= 32000000)
+
654  TCCR2B = _BV(CS22) | _BV(CS21); // Prescaler = 256
+
655  else if (F_CPU >= 16000000)
+
656  TCCR2B = _BV(CS22) | _BV(CS20); // Prescaler = 128
+
657  else if (F_CPU >= 8000000)
+
658  TCCR2B = _BV(CS22); // Prescaler = 64
+
659  else
+
660  TCCR2B = _BV(CS21) | _BV(CS20); // Prescaler = 32
+
661 
+
662  // Reset Timer2 to kick off the process.
+
663  TCNT2 = 0;
+
664 
+
665  // Turn on the Timer2 overflow interrupt (also turn off OCIE2A and OCIE2B).
+
666  TIMSK2 = _BV(TOIE2);
+
667 }
+
668 
+ +
675 {
+
676  // Turn off the Timer2 overflow interrupt.
+
677  TIMSK2 &= ~_BV(TOIE2);
+
678 }
+
679 
+
690 DMD::Color DMD::fromRGB(uint8_t r, uint8_t g, uint8_t b)
+
691 {
+
692  if (r || g || b)
+
693  return White;
+
694  else
+
695  return Black;
+
696 }
+
void disableTimer1()
Disables Timer1 overflow interrupts.
Definition: DMD.cpp:614
+
void loop()
Performs regular display refresh activities from the application's main loop.
Definition: DMD.cpp:420
+
void disableTimer2()
Disables Timer2 overflow interrupts.
Definition: DMD.cpp:674
+
Represents a monochrome bitmap within main memory.
Definition: Bitmap.h:32
+
bool doubleBuffer() const
Returns true if the display is double-buffered; false if single-buffered. The default is false...
Definition: DMD.h:34
+
void swapBuffers()
Swaps the buffers that are used for rendering to the display.
Definition: DMD.cpp:363
+
void enableTimer1()
Enables Timer1 overflow interrupts for updating this display.
Definition: DMD.cpp:563
+
~DMD()
Destroys this dot matrix display handler.
Definition: DMD.cpp:278
+
uint8_t Color
Type that represents the color of a pixel in a bitmap.
Definition: Bitmap.h:40
+
void swapBuffersAndCopy()
Swaps the buffers that are used for rendering to the display and copies the former back buffer conten...
Definition: DMD.cpp:396
+
DMD(int widthPanels=1, int heightPanels=1)
Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size...
Definition: DMD.cpp:237
+
void enableTimer2()
Enables Timer2 overflow interrupts for updating this display.
Definition: DMD.cpp:646
+
static Color fromRGB(uint8_t r, uint8_t g, uint8_t b)
Converts an RGB value into a pixel color value.
Definition: DMD.cpp:690
+
static const Color White
Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a d...
Definition: Bitmap.h:45
+
void refresh()
Refresh the display.
Definition: DMD.cpp:478
+
void setDoubleBuffer(bool doubleBuffer)
Enables or disables double-buffering according to doubleBuffer.
Definition: DMD.cpp:314
+
static const Color Black
Color value corresponding to "black".
Definition: Bitmap.h:44
+
+ + + + diff --git a/html/DMD_8h_source.html b/html/DMD_8h_source.html new file mode 100644 index 00000000..69d377a8 --- /dev/null +++ b/html/DMD_8h_source.html @@ -0,0 +1,178 @@ + + + + + + +ArduinoLibs: DMD.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DMD.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DMD_h
+
24 #define DMD_h
+
25 
+
26 #include "Bitmap.h"
+
27 
+
28 class DMD : public Bitmap
+
29 {
+
30 public:
+
31  explicit DMD(int widthPanels = 1, int heightPanels = 1);
+
32  ~DMD();
+
33 
+
34  bool doubleBuffer() const { return _doubleBuffer; }
+
35  void setDoubleBuffer(bool doubleBuffer);
+
36  void swapBuffers();
+
37  void swapBuffersAndCopy();
+
38 
+
39  void loop();
+
40  void refresh();
+
41 
+
42  void enableTimer1();
+
43  void disableTimer1();
+
44 
+
45  void enableTimer2();
+
46  void disableTimer2();
+
47 
+
48  static Color fromRGB(uint8_t r, uint8_t g, uint8_t b);
+
49 
+
50 private:
+
51  // Disable copy constructor and operator=().
+
52  DMD(const DMD &other) : Bitmap(other) {}
+
53  DMD &operator=(const DMD &) { return *this; }
+
54 
+
55  bool _doubleBuffer;
+
56  uint8_t phase;
+
57  uint8_t *fb0;
+
58  uint8_t *fb1;
+
59  uint8_t *displayfb;
+
60  unsigned long lastRefresh;
+
61 };
+
62 
+
63 #endif
+
Handle large dot matrix displays composed of LED's.
Definition: DMD.h:28
+
void disableTimer1()
Disables Timer1 overflow interrupts.
Definition: DMD.cpp:614
+
void loop()
Performs regular display refresh activities from the application's main loop.
Definition: DMD.cpp:420
+
void disableTimer2()
Disables Timer2 overflow interrupts.
Definition: DMD.cpp:674
+
Represents a monochrome bitmap within main memory.
Definition: Bitmap.h:32
+
bool doubleBuffer() const
Returns true if the display is double-buffered; false if single-buffered. The default is false...
Definition: DMD.h:34
+
void swapBuffers()
Swaps the buffers that are used for rendering to the display.
Definition: DMD.cpp:363
+
void enableTimer1()
Enables Timer1 overflow interrupts for updating this display.
Definition: DMD.cpp:563
+
~DMD()
Destroys this dot matrix display handler.
Definition: DMD.cpp:278
+
uint8_t Color
Type that represents the color of a pixel in a bitmap.
Definition: Bitmap.h:40
+
void swapBuffersAndCopy()
Swaps the buffers that are used for rendering to the display and copies the former back buffer conten...
Definition: DMD.cpp:396
+
DMD(int widthPanels=1, int heightPanels=1)
Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size...
Definition: DMD.cpp:237
+
void enableTimer2()
Enables Timer2 overflow interrupts for updating this display.
Definition: DMD.cpp:646
+
static Color fromRGB(uint8_t r, uint8_t g, uint8_t b)
Converts an RGB value into a pixel color value.
Definition: DMD.cpp:690
+
void refresh()
Refresh the display.
Definition: DMD.cpp:478
+
void setDoubleBuffer(bool doubleBuffer)
Enables or disables double-buffering according to doubleBuffer.
Definition: DMD.cpp:314
+
+ + + + diff --git a/html/DS1307RTC_8cpp_source.html b/html/DS1307RTC_8cpp_source.html new file mode 100644 index 00000000..ca0c5dd4 --- /dev/null +++ b/html/DS1307RTC_8cpp_source.html @@ -0,0 +1,423 @@ + + + + + + +ArduinoLibs: DS1307RTC.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS1307RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DS1307RTC.h"
+
24 #include "../I2C/I2CMaster.h"
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
54 // I2C address of the RTC chip (7-bit).
+
55 #define DS1307_I2C_ADDRESS 0x68
+
56 
+
57 // Registers.
+
58 #define DS1307_SECOND 0x00
+
59 #define DS1307_MINUTE 0x01
+
60 #define DS1307_HOUR 0x02
+
61 #define DS1307_DAY_OF_WEEK 0x03
+
62 #define DS1307_DATE 0x04
+
63 #define DS1307_MONTH 0x05
+
64 #define DS1307_YEAR 0x06
+
65 #define DS1307_CONTROL 0x07
+
66 #define DS1307_NVRAM 0x08
+
67 
+
68 // Alarm storage at the end of the RTC's NVRAM.
+
69 #define DS1307_ALARM_SIZE 3
+
70 #define DS1307_ALARMS (64 - RTC::ALARM_COUNT * DS1307_ALARM_SIZE - 1)
+
71 #define DS1307_ALARM_MAGIC 63
+
72 
+
83 DS1307RTC::DS1307RTC(I2CMaster &bus, uint8_t oneHzPin)
+
84  : _bus(&bus)
+
85  , _oneHzPin(oneHzPin)
+
86  , prevOneHz(false)
+
87  , _isRealTime(true)
+
88 {
+
89  // Make sure the CH bit in register 0 is off or the clock won't update.
+
90  _bus->startWrite(DS1307_I2C_ADDRESS);
+
91  _bus->write(DS1307_SECOND);
+
92  if (_bus->startRead(DS1307_I2C_ADDRESS, 1)) {
+
93  uint8_t value = _bus->read();
+
94  if ((value & 0x80) != 0)
+
95  writeRegister(DS1307_SECOND, value & 0x7F);
+
96  } else {
+
97  // Did not get an acknowledgement from the RTC chip.
+
98  _isRealTime = false;
+
99  }
+
100 
+
101  // Turn on the 1 Hz square wave signal if required.
+
102  if (oneHzPin != 255 && _isRealTime) {
+
103  pinMode(oneHzPin, INPUT);
+
104  digitalWrite(oneHzPin, HIGH);
+
105  writeRegister(DS1307_CONTROL, 0x10);
+
106  }
+
107 
+
108  // Initialize the alarms in the RTC chip's NVRAM.
+
109  if (_isRealTime)
+
110  initAlarms();
+
111 }
+
112 
+ +
119 {
+
120  // If not using a 1 Hz pin or there is no RTC chip available,
+
121  // then assume that there is an update available.
+
122  if (_oneHzPin == 255 || !_isRealTime)
+
123  return true;
+
124 
+
125  // The DS1307 updates the internal registers on the falling edge of the
+
126  // 1 Hz clock. The values should be ready to read on the rising edge.
+
127  bool value = digitalRead(_oneHzPin);
+
128  if (value && !prevOneHz) {
+
129  prevOneHz = value;
+
130  return true;
+
131  } else {
+
132  prevOneHz = value;
+
133  return false;
+
134  }
+
135 }
+
136 
+
137 inline uint8_t fromBCD(uint8_t value)
+
138 {
+
139  return (value >> 4) * 10 + (value & 0x0F);
+
140 }
+
141 
+
142 inline uint8_t fromHourBCD(uint8_t value)
+
143 {
+
144  if ((value & 0x40) != 0) {
+
145  // 12-hour mode.
+
146  uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
+
147  if ((value & 0x20) != 0)
+
148  return (result == 12) ? 12 : (result + 12); // PM
+
149  else
+
150  return (result == 12) ? 0 : result; // AM
+
151  } else {
+
152  // 24-hour mode.
+
153  return fromBCD(value);
+
154  }
+
155 }
+
156 
+ +
158 {
+
159  if (_isRealTime) {
+
160  _bus->startWrite(DS1307_I2C_ADDRESS);
+
161  _bus->write(DS1307_SECOND);
+
162  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
163  value->second = fromBCD(_bus->read() & 0x7F);
+
164  value->minute = fromBCD(_bus->read());
+
165  value->hour = fromHourBCD(_bus->read());
+
166  } else {
+
167  // RTC chip is not responding.
+
168  value->second = 0;
+
169  value->minute = 0;
+
170  value->hour = 0;
+
171  }
+
172  } else {
+
173  RTC::readTime(value);
+
174  }
+
175 }
+
176 
+ +
178 {
+
179  if (!_isRealTime) {
+
180  RTC::readDate(value);
+
181  return;
+
182  }
+
183  _bus->startWrite(DS1307_I2C_ADDRESS);
+
184  _bus->write(DS1307_DATE);
+
185  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
186  value->day = fromBCD(_bus->read());
+
187  value->month = fromBCD(_bus->read());
+
188  value->year = fromBCD(_bus->read()) + 2000;
+
189  } else {
+
190  // RTC chip is not responding.
+
191  value->day = 1;
+
192  value->month = 1;
+
193  value->year = 2000;
+
194  }
+
195 }
+
196 
+
197 inline uint8_t toBCD(uint8_t value)
+
198 {
+
199  return ((value / 10) << 4) + (value % 10);
+
200 }
+
201 
+
202 void DS1307RTC::writeTime(const RTCTime *value)
+
203 {
+
204  if (_isRealTime) {
+
205  _bus->startWrite(DS1307_I2C_ADDRESS);
+
206  _bus->write(DS1307_SECOND);
+
207  _bus->write(toBCD(value->second));
+
208  _bus->write(toBCD(value->minute));
+
209  _bus->write(toBCD(value->hour)); // Changes mode to 24-hour clock.
+
210  _bus->endWrite();
+
211  } else {
+
212  RTC::writeTime(value);
+
213  }
+
214 }
+
215 
+
216 void DS1307RTC::writeDate(const RTCDate *value)
+
217 {
+
218  if (_isRealTime) {
+
219  _bus->startWrite(DS1307_I2C_ADDRESS);
+
220  _bus->write(DS1307_DATE);
+
221  _bus->write(toBCD(value->day));
+
222  _bus->write(toBCD(value->month));
+
223  _bus->write(toBCD(value->year % 100));
+
224  _bus->endWrite();
+
225  } else {
+
226  RTC::writeDate(value);
+
227  }
+
228 }
+
229 
+
230 void DS1307RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
231 {
+
232  if (_isRealTime) {
+
233  _bus->startWrite(DS1307_I2C_ADDRESS);
+
234  _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
+
235  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
236  value->hour = fromBCD(_bus->read());
+
237  value->minute = fromBCD(_bus->read());
+
238  value->flags = _bus->read();
+
239  } else {
+
240  // RTC chip is not responding.
+
241  value->hour = 0;
+
242  value->minute = 0;
+
243  value->flags = 0;
+
244  }
+
245  } else {
+
246  RTC::readAlarm(alarmNum, value);
+
247  }
+
248 }
+
249 
+
250 void DS1307RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
251 {
+
252  if (_isRealTime) {
+
253  _bus->startWrite(DS1307_I2C_ADDRESS);
+
254  _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
+
255  _bus->write(toBCD(value->hour));
+
256  _bus->write(toBCD(value->minute));
+
257  _bus->write(value->flags);
+
258  _bus->endWrite();
+
259  } else {
+
260  RTC::writeAlarm(alarmNum, value);
+
261  }
+
262 }
+
263 
+ +
265 {
+
266  return DS1307_ALARMS - DS1307_NVRAM;
+
267 }
+
268 
+
269 uint8_t DS1307RTC::readByte(uint8_t offset)
+
270 {
+
271  if (_isRealTime)
+
272  return readRegister(DS1307_NVRAM + offset);
+
273  else
+
274  return RTC::readByte(offset);
+
275 }
+
276 
+
277 void DS1307RTC::writeByte(uint8_t offset, uint8_t value)
+
278 {
+
279  if (_isRealTime)
+
280  writeRegister(DS1307_NVRAM + offset, value);
+
281  else
+
282  RTC::writeByte(offset, value);
+
283 }
+
284 
+
285 void DS1307RTC::initAlarms()
+
286 {
+
287  uint8_t value = readRegister(DS1307_ALARM_MAGIC);
+
288  if (value != (0xB0 + ALARM_COUNT)) {
+
289  // This is the first time we have used this clock chip,
+
290  // so initialize all alarms to their default state.
+
291  RTCAlarm alarm;
+
292  alarm.hour = 6; // Default to 6am for alarms.
+
293  alarm.minute = 0;
+
294  alarm.flags = 0;
+
295  for (uint8_t index = 0; index < ALARM_COUNT; ++index)
+
296  writeAlarm(index, &alarm);
+
297  writeRegister(DS1307_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
+
298 
+
299  // Also clear the rest of NVRAM so that it is in a known state.
+
300  // Otherwise we'll have whatever garbage was present at power-on.
+
301  _bus->startWrite(DS1307_I2C_ADDRESS);
+
302  _bus->write(DS1307_NVRAM);
+
303  for (uint8_t index = DS1307_NVRAM; index < DS1307_ALARMS; ++index)
+
304  _bus->write(0);
+
305  _bus->endWrite();
+
306  }
+
307 }
+
308 
+
309 uint8_t DS1307RTC::readRegister(uint8_t reg)
+
310 {
+
311  _bus->startWrite(DS1307_I2C_ADDRESS);
+
312  _bus->write(reg);
+
313  if (!_bus->startRead(DS1307_I2C_ADDRESS, 1))
+
314  return 0; // RTC chip is not responding.
+
315  return _bus->read();
+
316 }
+
317 
+
318 bool DS1307RTC::writeRegister(uint8_t reg, uint8_t value)
+
319 {
+
320  _bus->startWrite(DS1307_I2C_ADDRESS);
+
321  _bus->write(reg);
+
322  _bus->write(value);
+
323  return _bus->endWrite();
+
324 }
+
uint8_t month
Month of the year (1-12)
Definition: RTC.h:38
+
virtual void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: RTC.cpp:179
+
uint8_t minute
Minute within the hour (0-59)
Definition: RTC.h:31
+
virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: RTC.cpp:209
+
virtual void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: RTC.cpp:169
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS1307RTC.cpp:157
+
bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: DS1307RTC.cpp:118
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS1307RTC.cpp:250
+
virtual void write(uint8_t value)=0
Writes a single byte value on the I2C bus.
+
virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: RTC.cpp:224
+
static const uint8_t ALARM_COUNT
Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
Definition: RTC.h:77
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS1307RTC.cpp:202
+
virtual void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: RTC.cpp:194
+
virtual bool startRead(unsigned int address, unsigned int count)=0
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
+
uint8_t hour
Hour of the day for the alarm (0-23).
Definition: RTC.h:46
+
uint8_t flags
Additional flags for the alarm.
Definition: RTC.h:49
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS1307RTC.cpp:177
+
virtual void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
+
virtual bool endWrite()=0
Ends the current write operation.
+
unsigned int year
Year (4-digit)
Definition: RTC.h:37
+
virtual void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:262
+
uint8_t minute
Minute of the hour for the alarm (0-59).
Definition: RTC.h:47
+
virtual uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:247
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS1307RTC.cpp:216
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS1307RTC.cpp:230
+
DS1307RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS1307RTC.cpp:83
+
int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: DS1307RTC.cpp:264
+
virtual uint8_t read()=0
Reads a single byte from the I2C bus.
+
uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: DS1307RTC.cpp:269
+
uint8_t hour
Hour of the day (0-23)
Definition: RTC.h:30
+
uint8_t day
Day of the month (1-31)
Definition: RTC.h:39
+
uint8_t second
Second within the minute (0-59)
Definition: RTC.h:32
+
virtual void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: RTC.cpp:144
+
void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: DS1307RTC.cpp:277
+
+ + + + diff --git a/html/DS1307RTC_8h_source.html b/html/DS1307RTC_8h_source.html new file mode 100644 index 00000000..9f11a390 --- /dev/null +++ b/html/DS1307RTC_8h_source.html @@ -0,0 +1,180 @@ + + + + + + +ArduinoLibs: DS1307RTC.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS1307RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DS1307RTC_h
+
24 #define DS1307RTC_h
+
25 
+
26 #include "RTC.h"
+
27 
+
28 class I2CMaster;
+
29 
+
30 class DS1307RTC : public RTC {
+
31 public:
+
32  DS1307RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
+
33 
+
34  bool isRealTime() const { return _isRealTime; }
+
35 
+
36  bool hasUpdates();
+
37 
+
38  void readTime(RTCTime *value);
+
39  void readDate(RTCDate *value);
+
40 
+
41  void writeTime(const RTCTime *value);
+
42  void writeDate(const RTCDate *value);
+
43 
+
44  void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
45  void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
46 
+
47  int byteCount() const;
+
48  uint8_t readByte(uint8_t offset);
+
49  void writeByte(uint8_t offset, uint8_t value);
+
50 
+
51 private:
+
52  I2CMaster *_bus;
+
53  uint8_t _oneHzPin;
+
54  bool prevOneHz;
+
55  bool _isRealTime;
+
56 
+
57  void initAlarms();
+
58 
+
59  uint8_t readRegister(uint8_t reg);
+
60  bool writeRegister(uint8_t reg, uint8_t value);
+
61 };
+
62 
+
63 #endif
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS1307RTC.cpp:157
+
bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: DS1307RTC.cpp:118
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS1307RTC.cpp:250
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS1307RTC.cpp:202
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
Communicates with a DS1307 realtime clock chip via I2C.
Definition: DS1307RTC.h:30
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS1307RTC.cpp:177
+
bool isRealTime() const
Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated...
Definition: DS1307RTC.h:34
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS1307RTC.cpp:216
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS1307RTC.cpp:230
+
DS1307RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS1307RTC.cpp:83
+
int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: DS1307RTC.cpp:264
+
uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: DS1307RTC.cpp:269
+
Base class for realtime clock handlers.
Definition: RTC.h:52
+
void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: DS1307RTC.cpp:277
+
+ + + + diff --git a/html/DS3231RTC_8cpp_source.html b/html/DS3231RTC_8cpp_source.html new file mode 100644 index 00000000..6338b3b1 --- /dev/null +++ b/html/DS3231RTC_8cpp_source.html @@ -0,0 +1,665 @@ + + + + + + +ArduinoLibs: DS3231RTC.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS3231RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 /*
+
24  * Adapted from DS3232RTC library for DS3231 RTC chip by Thijs Oppermann
+
25  * 2014-12-07
+
26  */
+
27 
+
28 #include "DS3231RTC.h"
+
29 #include "../I2C/I2CMaster.h"
+
30 #if defined(ARDUINO) && ARDUINO >= 100
+
31 #include <Arduino.h>
+
32 #else
+
33 #include <WProgram.h>
+
34 #endif
+
35 
+
65 // I2C address of the RTC chip (7-bit).
+
66 #define DS3231_I2C_ADDRESS 0x68
+
67 
+
68 // Registers.
+
69 #define DS3231_SECOND 0x00
+
70 #define DS3231_MINUTE 0x01
+
71 #define DS3231_HOUR 0x02
+
72 #define DS3231_DAY_OF_WEEK 0x03
+
73 #define DS3231_DATE 0x04
+
74 #define DS3231_MONTH 0x05
+
75 #define DS3231_YEAR 0x06
+
76 #define DS3231_ALARM1_SEC 0x07
+
77 #define DS3231_ALARM1_MIN 0x08
+
78 #define DS3231_ALARM1_HOUR 0x09
+
79 #define DS3231_ALARM1_DAY 0x0A
+
80 #define DS3231_ALARM2_MIN 0x0B
+
81 #define DS3231_ALARM2_HOUR 0x0C
+
82 #define DS3231_ALARM2_DAY 0x0D
+
83 #define DS3231_CONTROL 0x0E
+
84 #define DS3231_STATUS 0x0F
+
85 #define DS3231_AGING_OFFSET 0x10
+
86 #define DS3231_TEMP_MSB 0x11
+
87 #define DS3231_TEMP_LSB 0x12
+
88 
+
89 // Bits in the DS3231_CONTROL register.
+
90 #define DS3231_EOSC 0x80
+
91 #define DS3231_BBSQW 0x40
+
92 #define DS3231_CONV 0x20
+
93 #define DS3231_RS_1HZ 0x00
+
94 #define DS3231_RS_1024HZ 0x08
+
95 #define DS3231_RS_4096HZ 0x10
+
96 #define DS3231_RS_8192HZ 0x18
+
97 #define DS3231_INTCN 0x04
+
98 #define DS3231_A2IE 0x02
+
99 #define DS3231_A1IE 0x01
+
100 
+
101 // Bits in the DS3231_STATUS register.
+
102 #define DS3231_OSF 0x80
+
103 #define DS3231_BB32KHZ 0x40
+
104 #define DS3231_EN32KHZ 0x08
+
105 #define DS3231_BSY 0x04
+
106 #define DS3231_A2F 0x02
+
107 #define DS3231_A1F 0x01
+
108 
+
109 // Alarms 0 and 1
+
110 #define DS3231_ALARM_0 0x07
+
111 #define DS3231_ALARM_1 0x0B
+
112 
+
125 DS3231RTC::DS3231RTC(I2CMaster &bus, uint8_t oneHzPin)
+
126  : _bus(&bus)
+
127  , _oneHzPin(oneHzPin)
+
128  , prevOneHz(false)
+
129  , _isRealTime(true)
+
130  , alarmInterrupts(false) {
+
131  // Probe the device and configure it for our use.
+
132  _bus->startWrite(DS3231_I2C_ADDRESS);
+
133  _bus->write(DS3231_CONTROL);
+
134  if ( _bus->startRead(DS3231_I2C_ADDRESS, 1) ) {
+
135  uint8_t value = _bus->read() & DS3231_CONV;
+
136  if ( oneHzPin != 255 ) {
+
137  value |= DS3231_BBSQW | DS3231_RS_1HZ;
+
138  }
+
139  _bus->startWrite(DS3231_I2C_ADDRESS);
+
140  _bus->write(DS3231_CONTROL);
+
141  _bus->write(value);
+
142  _bus->endWrite();
+
143  }
+
144  else {
+
145  // Did not get an acknowledgement from the RTC chip.
+
146  _isRealTime = false;
+
147  }
+
148 
+
149  // Configure the 1 Hz square wave pin if required.
+
150  if ( ( oneHzPin != 255) && _isRealTime ) {
+
151  pinMode(oneHzPin, INPUT);
+
152  digitalWrite(oneHzPin, HIGH);
+
153  }
+
154 }
+
155 
+ +
167  // If not using a 1 Hz pin or there is no RTC chip available,
+
168  // then assume that there is an update available.
+
169  if ( ( _oneHzPin == 255) || !_isRealTime ) {
+
170  return true;
+
171  }
+
172 
+
173  // The DS3231 updates the internal registers on the falling edge of the
+
174  // 1 Hz clock. The values should be ready to read on the rising edge.
+
175  bool value = digitalRead(_oneHzPin);
+
176  if ( value && !prevOneHz ) {
+
177  prevOneHz = value;
+
178  return true;
+
179  }
+
180  else {
+
181  prevOneHz = value;
+
182  return false;
+
183  }
+
184 }
+
185 
+
186 inline uint8_t fromBCD(uint8_t value) {
+
187  return (value >> 4) * 10 + (value & 0x0F);
+
188 }
+
189 
+
190 inline uint8_t fromHourBCD(uint8_t value) {
+
191  if ( (value & 0x40) != 0 ) {
+
192  // 12-hour mode.
+
193  uint8_t result = ( (value >> 4) & 0x01 ) * 10 + (value & 0x0F);
+
194  if ( (value & 0x20) != 0 ) {
+
195  return (result == 12) ? 12 : (result + 12); // PM
+
196  }
+
197  else {
+
198  return (result == 12) ? 0 : result; // AM
+
199  }
+
200  }
+
201  else {
+
202  // 24-hour mode.
+
203  return fromBCD(value);
+
204  }
+
205 }
+
206 
+ +
208  if ( _isRealTime ) {
+
209  _bus->startWrite(DS3231_I2C_ADDRESS);
+
210  _bus->write(DS3231_SECOND);
+
211  if ( _bus->startRead(DS3231_I2C_ADDRESS, 3) ) {
+
212  value->second = fromBCD( _bus->read() );
+
213  value->minute = fromBCD( _bus->read() );
+
214  value->hour = fromHourBCD( _bus->read() );
+
215  }
+
216  else {
+
217  // RTC chip is not responding.
+
218  value->second = 0;
+
219  value->minute = 0;
+
220  value->hour = 0;
+
221  }
+
222  }
+
223  else {
+
224  RTC::readTime(value);
+
225  }
+
226 }
+
227 
+ +
229  if ( !_isRealTime ) {
+
230  RTC::readDate(value);
+
231  return;
+
232  }
+
233  _bus->startWrite(DS3231_I2C_ADDRESS);
+
234  _bus->write(DS3231_DATE);
+
235  if ( _bus->startRead(DS3231_I2C_ADDRESS, 3) ) {
+
236  value->day = fromBCD( _bus->read() );
+
237  value->month = fromBCD(_bus->read() & 0x7F); // Strip century bit.
+
238  value->year = fromBCD( _bus->read() ) + 2000;
+
239  }
+
240  else {
+
241  // RTC chip is not responding.
+
242  value->day = 1;
+
243  value->month = 1;
+
244  value->year = 2000;
+
245  }
+
246 }
+
247 
+
248 inline uint8_t toBCD(uint8_t value) {
+
249  return ( (value / 10) << 4 ) + (value % 10);
+
250 }
+
251 
+
252 void DS3231RTC::writeTime(const RTCTime* value) {
+
253  if ( _isRealTime ) {
+
254  _bus->startWrite(DS3231_I2C_ADDRESS);
+
255  _bus->write(DS3231_SECOND);
+
256  _bus->write( toBCD(value->second) );
+
257  _bus->write( toBCD(value->minute) );
+
258  _bus->write( toBCD(value->hour) ); // Changes mode to 24-hour clock.
+
259  _bus->endWrite();
+
260  }
+
261  else {
+
262  RTC::writeTime(value);
+
263  }
+
264 }
+
265 
+
266 void DS3231RTC::writeDate(const RTCDate* value) {
+
267  if ( _isRealTime ) {
+
268  _bus->startWrite(DS3231_I2C_ADDRESS);
+
269  _bus->write(DS3231_DATE);
+
270  _bus->write( toBCD(value->day) );
+
271  _bus->write( toBCD(value->month) );
+
272  _bus->write( toBCD(value->year % 100) );
+
273  _bus->endWrite();
+
274  }
+
275  else {
+
276  RTC::writeDate(value);
+
277  }
+
278 }
+
279 
+
280 void DS3231RTC::readAlarm(uint8_t alarmNum, RTCAlarm* value) {
+
281  if ( _isRealTime ) {
+
282  uint8_t reg_value = readRegister(DS3231_CONTROL);
+
283  _bus->startWrite(DS3231_I2C_ADDRESS);
+
284  if ( 0 == alarmNum ) {
+
285  _bus->write(DS3231_ALARM_0);
+
286  if ( _bus->startRead(DS3231_I2C_ADDRESS, 4) ) {
+
287  alarmSecondValues(_bus->read(), value);
+
288  alarmMinuteValues(_bus->read(), value);
+
289  alarmHourValues(_bus->read(), value);
+
290  alarmDayValues(_bus->read(), value);
+
291  value->flags &= ~0x80;
+
292  value->flags |= (reg_value & 0x01) << 6;
+
293  }
+
294  else {
+
295  // RTC chip is not responding.
+
296  value->day = 0;
+
297  value->hour = 0;
+
298  value->minute = 0;
+
299  value->second = 0;
+
300  }
+
301  }
+
302  else if ( 1 == alarmNum ) {
+
303  _bus->write(DS3231_ALARM_1);
+
304  if ( _bus->startRead(DS3231_I2C_ADDRESS, 3) ) {
+
305  value->second = 0;
+
306  alarmMinuteValues(_bus->read(), value);
+
307  alarmHourValues(_bus->read(), value);
+
308  alarmDayValues(_bus->read(), value);
+
309  value->flags |= 0x80;
+
310  value->flags |= (reg_value & 0x02) << 5;
+
311  }
+
312  else {
+
313  // RTC chip is not responding.
+
314  value->day = 0;
+
315  value->hour = 0;
+
316  value->minute = 0;
+
317  value->second = 0;
+
318  }
+
319  }
+
320  }
+
321  else {
+
322  RTC::readAlarm(alarmNum, value);
+
323  }
+
324 }
+
325 
+
326 void DS3231RTC::alarmSecondValues(uint8_t read_value, RTCAlarm* value) {
+
327  uint8_t mask_bit = (read_value & 0x80) ? 0x01 : 0x00;
+
328 
+
329  value->second = fromBCD(read_value & 0x7F);
+
330  value->flags |= mask_bit;
+
331 }
+
332 
+
333 void DS3231RTC::alarmMinuteValues(uint8_t read_value, RTCAlarm* value) {
+
334  uint8_t mask_bit = (read_value & 0x80) ? 0x02 : 0x00;
+
335 
+
336  value->minute = fromBCD(read_value & 0x7F);
+
337  value->flags |= mask_bit;
+
338 }
+
339 
+
340 void DS3231RTC::alarmHourValues(uint8_t read_value, RTCAlarm* value) {
+
341  uint8_t mask_bit = (read_value & 0x80) ? 0x04 : 0x00;
+
342  uint8_t is_ampm = read_value & 0x40;
+
343 
+
344  if ( is_ampm ) {
+
345  uint8_t hour = fromBCD(read_value & ~0xE0);
+
346  if ( read_value & 0x20 ) {
+
347  hour += 12;
+
348  }
+
349  value->hour = hour;
+
350  }
+
351  else {
+
352  value->hour = fromBCD(read_value & ~0xC0);
+
353  }
+
354  value->flags |= mask_bit;
+
355 }
+
356 
+
357 void DS3231RTC::alarmDayValues(uint8_t read_value, RTCAlarm* value) {
+
358  uint8_t mask_bit = (read_value & 0x80) ? 0x08 : 0x00;
+
359  uint8_t is_dow = read_value & 0x40;
+
360 
+
361  if ( is_dow ) {
+
362  value->day = 0;
+
363  value->dow = fromBCD(read_value & 0x0F);
+
364  value->flags |= 0x20;
+
365  }
+
366  else {
+
367  value->dow = 0;
+
368  value->day = fromBCD(read_value & 0x3F);
+
369  value->flags &= ~0x20;
+
370  }
+
371  value->flags |= mask_bit;
+
372 }
+
373 
+
374 void DS3231RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm* value) {
+
375  setAlarm(alarmNum, value);
+
376  return;
+
377 }
+
378 
+
379 void DS3231RTC::clearAlarm(uint8_t alarmNum) {
+
380  if ( 0 == alarmNum ) {
+
381  _bus->startWrite(DS3231_I2C_ADDRESS);
+
382  _bus->write(DS3231_ALARM_0);
+
383  _bus->write(0);
+
384  _bus->write(0);
+
385  _bus->write(0);
+
386  _bus->write(0x41);
+
387  _bus->endWrite();
+
388  }
+
389  else if ( 1 == alarmNum ) {
+
390  _bus->startWrite(DS3231_I2C_ADDRESS);
+
391  _bus->write(DS3231_ALARM_1);
+
392  _bus->write(0);
+
393  _bus->write(0);
+
394  _bus->write(0x41);
+
395  _bus->endWrite();
+
396  }
+
397 }
+
398 
+
408 bool DS3231RTC::setAlarm(uint8_t alarmNum, const RTCAlarm* value) {
+
409  if ( _isRealTime ) {
+
410  uint8_t alarm_mask_bits = value->flags;
+
411 
+
412  if ( 0 == alarmNum ) {
+
413  if ( alarm_mask_bits & 0x80 ) {
+
414  return false;
+
415  }
+
416 
+
417  _bus->startWrite(DS3231_I2C_ADDRESS);
+
418  _bus->write(DS3231_ALARM_0);
+
419  _bus->write( toBCD(value->second) | ( ( alarm_mask_bits & 0x01 ) << 7 ) );
+
420  _bus->write( toBCD(value->minute) | ( ( alarm_mask_bits & 0x02 ) << 6 ) );
+
421  // only support writing 24h
+
422  _bus->write( toBCD(value->hour) | ( ( alarm_mask_bits & 0x04 ) << 5 ) );
+
423  _bus->write( getAlarmDayValue(value) );
+
424  _bus->endWrite();
+
425  if ( value->flags & 0x40 ) {
+
426  enableAlarm(alarmNum);
+
427  }
+
428  }
+
429  else if ( 1 == alarmNum ) {
+
430  if ( !(alarm_mask_bits & 0x80) ) {
+
431  return false;
+
432  }
+
433 
+
434  _bus->startWrite(DS3231_I2C_ADDRESS);
+
435  _bus->write(DS3231_ALARM_1);
+
436  _bus->write( toBCD(value->minute) | ( ( alarm_mask_bits & 0x02 ) << 6 ) );
+
437  // only support writing 24h
+
438  _bus->write( toBCD(value->hour) | ( ( alarm_mask_bits & 0x04 ) << 5 ) );
+
439  _bus->write( getAlarmDayValue(value) );
+
440  _bus->endWrite();
+
441  if ( value->flags & 0x40 ) {
+
442  enableAlarm(alarmNum);
+
443  }
+
444  }
+
445  }
+
446  else {
+
447  RTC::writeAlarm(alarmNum, value);
+
448  return false;
+
449  }
+
450 
+
451  return true;
+
452 }
+
453 
+
454 uint8_t DS3231RTC::getAlarmDayValue(const RTCAlarm* value) {
+
455  uint8_t alarm_mask_bits = value->flags;
+
456  uint8_t day_value_mask = ( alarm_mask_bits & 0x08 ) << 4;
+
457 
+
458  if ( alarm_mask_bits & 0x20 ) {
+
459  // day of week
+
460  day_value_mask |= 0x40;
+
461  return (toBCD(value->dow) | day_value_mask);
+
462  }
+
463  else {
+
464  // date
+
465  day_value_mask &= ~0x40;
+
466  return (toBCD(value->day) | day_value_mask);
+
467  }
+
468 }
+
469 
+ +
471  if ( _isRealTime ) {
+
472  return ( ( (int)(signed char)readRegister(DS3231_TEMP_MSB) ) << 2 ) |
+
473  (readRegister(DS3231_TEMP_LSB) >> 6);
+
474  }
+
475  else {
+
476  return NO_TEMPERATURE;
+
477  }
+
478 }
+
479 
+ +
495  if ( ( _oneHzPin == 255) && _isRealTime ) {
+
496  uint8_t value = readRegister(DS3231_CONTROL);
+
497  value |= DS3231_INTCN;
+
498  writeRegister(DS3231_CONTROL, value);
+
499  alarmInterrupts = true;
+
500  }
+
501 }
+
502 
+ +
509  if ( alarmInterrupts ) {
+
510  uint8_t value = readRegister(DS3231_CONTROL);
+
511  value &= ~(DS3231_INTCN | DS3231_A2IE | DS3231_A1IE);
+
512  writeRegister(DS3231_CONTROL, value);
+
513  alarmInterrupts = false;
+
514  }
+
515 }
+
516 
+ +
531  if ( !_isRealTime ) {
+
532  return -1;
+
533  }
+
534  uint8_t value = readRegister(DS3231_STATUS);
+
535  int alarm;
+
536  if ( value & DS3231_A1F ) {
+
537  if ( value & DS3231_A2F ) {
+
538  alarm = 2;
+
539  }
+
540  else {
+
541  alarm = 0;
+
542  }
+
543  }
+
544  else if ( value & DS3231_A2F ) {
+
545  alarm = 1;
+
546  }
+
547  else {
+
548  alarm = -1;
+
549  }
+
550  if ( alarm != -1 ) {
+
551  value &= ~(DS3231_A1F | DS3231_A2F);
+
552  writeRegister(DS3231_STATUS, value);
+
553  }
+
554  return alarm;
+
555 }
+
556 
+ +
563  if ( _isRealTime ) {
+
564  uint8_t value = readRegister(DS3231_STATUS);
+
565  value |= DS3231_BB32KHZ | DS3231_EN32KHZ;
+
566  writeRegister(DS3231_STATUS, value);
+
567  }
+
568 }
+
569 
+ +
576  if ( _isRealTime ) {
+
577  uint8_t value = readRegister(DS3231_STATUS);
+
578  value &= ~(DS3231_BB32KHZ | DS3231_EN32KHZ);
+
579  writeRegister(DS3231_STATUS, value);
+
580  }
+
581 }
+
582 
+
583 uint8_t DS3231RTC::readRegister(uint8_t reg) {
+
584  _bus->startWrite(DS3231_I2C_ADDRESS);
+
585  _bus->write(reg);
+
586  if ( !_bus->startRead(DS3231_I2C_ADDRESS, 1) ) {
+
587  return 0; // RTC chip is not responding.
+
588  }
+
589  return _bus->read();
+
590 }
+
591 
+
592 bool DS3231RTC::writeRegister(uint8_t reg, uint8_t value) {
+
593  _bus->startWrite(DS3231_I2C_ADDRESS);
+
594  _bus->write(reg);
+
595  _bus->write(value);
+
596  return _bus->endWrite();
+
597 }
+
598 
+
606 void DS3231RTC::enableAlarm(uint8_t alarmNum) {
+
607  uint8_t value = readRegister(DS3231_CONTROL);
+
608 
+
609  if ( 0 == alarmNum ) {
+
610  value |= DS3231_A1IE;
+
611  }
+
612  else if ( 1 == alarmNum ) {
+
613  value |= DS3231_A2IE;
+
614  }
+
615  writeRegister(DS3231_CONTROL, value);
+
616 }
+
617 
+
625 void DS3231RTC::disableAlarm(uint8_t alarmNum) {
+
626  uint8_t value = readRegister(DS3231_CONTROL);
+
627 
+
628  clearAlarm(alarmNum);
+
629 
+
630  if ( 0 == alarmNum ) {
+
631  value &= ~DS3231_A1IE;
+
632  }
+
633  else if ( 1 == alarmNum ) {
+
634  value &= ~DS3231_A2IE;
+
635  }
+
636  writeRegister(DS3231_CONTROL, value);
+
637 }
+
uint8_t month
Month of the year (1-12)
Definition: RTC.h:38
+
virtual void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: RTC.cpp:179
+
void enable32kHzOutput()
Enables the 32 kHz output on the DS3231 chip.
Definition: DS3231RTC.cpp:562
+
void disableAlarmInterrupts()
Disables the generation of interrupts for alarms 0 and 1.
Definition: DS3231RTC.cpp:508
+
uint8_t minute
Minute within the hour (0-59)
Definition: RTC.h:31
+
virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: RTC.cpp:209
+
virtual void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: RTC.cpp:169
+
uint8_t day
Day of the month for the alarm if not zero.
Definition: RTC.h:44
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS3231RTC.cpp:228
+
int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: DS3231RTC.cpp:470
+
virtual void write(uint8_t value)=0
Writes a single byte value on the I2C bus.
+
virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: RTC.cpp:224
+
void enableAlarmInterrupts()
Enables the generation of interrupts for alarms 0 and 1.
Definition: DS3231RTC.cpp:494
+
virtual void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: RTC.cpp:194
+
virtual bool startRead(unsigned int address, unsigned int count)=0
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
+
uint8_t hour
Hour of the day for the alarm (0-23).
Definition: RTC.h:46
+
static const int NO_TEMPERATURE
Value that is returned from readTemperature() if the realtime clock chip cannot determine the tempera...
Definition: RTC.h:86
+
uint8_t flags
Additional flags for the alarm.
Definition: RTC.h:49
+
void enableAlarm(uint8_t alarmNum)
Enables a specific alarm.
Definition: DS3231RTC.cpp:606
+
uint8_t dow
Day of the week for the alarm if not zero.
Definition: RTC.h:45
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS3231RTC.cpp:280
+
DS3231RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS3231RTC.cpp:125
+
virtual void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
+
void disableAlarm(uint8_t alarmNum)
Disables a specific alarm.
Definition: DS3231RTC.cpp:625
+
bool setAlarm(uint8_t alarmNum, const RTCAlarm *value)
Sets the alarm with index alarmNum from value.
Definition: DS3231RTC.cpp:408
+
virtual bool endWrite()=0
Ends the current write operation.
+
unsigned int year
Year (4-digit)
Definition: RTC.h:37
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS3231RTC.cpp:266
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS3231RTC.cpp:374
+
uint8_t minute
Minute of the hour for the alarm (0-59).
Definition: RTC.h:47
+
void disable32kHzOutput()
Disables the 32 kHz output on the DS3231 chip.
Definition: DS3231RTC.cpp:575
+
uint8_t second
Second of the minute for the alarm (0-59).
Definition: RTC.h:48
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS3231RTC.cpp:252
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
bool hasUpdates()
Returns true if there are updates.
Definition: DS3231RTC.cpp:166
+
virtual uint8_t read()=0
Reads a single byte from the I2C bus.
+
uint8_t hour
Hour of the day (0-23)
Definition: RTC.h:30
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS3231RTC.cpp:207
+
uint8_t day
Day of the month (1-31)
Definition: RTC.h:39
+
uint8_t second
Second within the minute (0-59)
Definition: RTC.h:32
+
int firedAlarm()
Determines which of alarms 0 or 1 have fired since the last call.
Definition: DS3231RTC.cpp:530
+
virtual void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: RTC.cpp:144
+
+ + + + diff --git a/html/DS3231RTC_8h_source.html b/html/DS3231RTC_8h_source.html new file mode 100644 index 00000000..7fd6f5c6 --- /dev/null +++ b/html/DS3231RTC_8h_source.html @@ -0,0 +1,210 @@ + + + + + + +ArduinoLibs: DS3231RTC.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS3231RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 /*
+
24  * Adapted from DS3232RTC library for DS3231 RTC chip by Thijs Oppermann
+
25  * 2014-12-07
+
26  */
+
27 
+
28 #ifndef DS3231RTC_h
+
29 #define DS3231RTC_h
+
30 
+
31 #include "RTC.h"
+
32 
+
33 class I2CMaster;
+
34 
+
35 class DS3231RTC : public RTC {
+
36  public:
+
37  DS3231RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
+
38 
+
39  bool isRealTime() const {
+
40  return _isRealTime;
+
41  }
+
42 
+
43  bool hasUpdates();
+
44 
+
45  void readTime(RTCTime* value);
+
46  void readDate(RTCDate* value);
+
47 
+
48  void writeTime(const RTCTime* value);
+
49  void writeDate(const RTCDate* value);
+
50 
+
51  void readAlarm(uint8_t alarmNum, RTCAlarm* value);
+
52  void writeAlarm(uint8_t alarmNum, const RTCAlarm* value);
+
53  bool setAlarm(uint8_t alarmNum, const RTCAlarm* value);
+
54 
+
55  int readTemperature();
+
56 
+
57  void enableAlarmInterrupts();
+ +
59  int firedAlarm();
+
60 
+
61  void enable32kHzOutput();
+
62  void disable32kHzOutput();
+
63 
+
64  void enableAlarm(uint8_t alarmNum);
+
65  void disableAlarm(uint8_t alarmNum);
+
66 
+
67  private:
+
68  I2CMaster* _bus;
+
69  uint8_t _oneHzPin;
+
70  bool prevOneHz;
+
71  bool _isRealTime;
+
72  bool alarmInterrupts;
+
73 
+
74  void alarmSecondValues(uint8_t read_value, RTCAlarm* value);
+
75  void alarmMinuteValues(uint8_t read_value, RTCAlarm* value);
+
76  void alarmHourValues(uint8_t read_value, RTCAlarm* value);
+
77  void alarmDayValues(uint8_t read_value, RTCAlarm* value);
+
78 
+
79  uint8_t getAlarmDayValue(const RTCAlarm* value);
+
80 
+
81  void clearAlarm(uint8_t alarmNum);
+
82 
+
83  uint8_t readRegister(uint8_t reg);
+
84  bool writeRegister(uint8_t reg, uint8_t value);
+
85 };
+
86 
+
87 #endif
+
void enable32kHzOutput()
Enables the 32 kHz output on the DS3231 chip.
Definition: DS3231RTC.cpp:562
+
void disableAlarmInterrupts()
Disables the generation of interrupts for alarms 0 and 1.
Definition: DS3231RTC.cpp:508
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS3231RTC.cpp:228
+
int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: DS3231RTC.cpp:470
+
void enableAlarmInterrupts()
Enables the generation of interrupts for alarms 0 and 1.
Definition: DS3231RTC.cpp:494
+
Communicates with a DS3231 realtime clock chip via I2C.
Definition: DS3231RTC.h:35
+
bool isRealTime() const
Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated...
Definition: DS3231RTC.h:39
+
void enableAlarm(uint8_t alarmNum)
Enables a specific alarm.
Definition: DS3231RTC.cpp:606
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS3231RTC.cpp:280
+
DS3231RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS3231RTC.cpp:125
+
void disableAlarm(uint8_t alarmNum)
Disables a specific alarm.
Definition: DS3231RTC.cpp:625
+
bool setAlarm(uint8_t alarmNum, const RTCAlarm *value)
Sets the alarm with index alarmNum from value.
Definition: DS3231RTC.cpp:408
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS3231RTC.cpp:266
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS3231RTC.cpp:374
+
void disable32kHzOutput()
Disables the 32 kHz output on the DS3231 chip.
Definition: DS3231RTC.cpp:575
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS3231RTC.cpp:252
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
bool hasUpdates()
Returns true if there are updates.
Definition: DS3231RTC.cpp:166
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS3231RTC.cpp:207
+
int firedAlarm()
Determines which of alarms 0 or 1 have fired since the last call.
Definition: DS3231RTC.cpp:530
+
Base class for realtime clock handlers.
Definition: RTC.h:52
+
+ + + + diff --git a/html/DS3232RTC_8cpp_source.html b/html/DS3232RTC_8cpp_source.html new file mode 100644 index 00000000..3bc62781 --- /dev/null +++ b/html/DS3232RTC_8cpp_source.html @@ -0,0 +1,583 @@ + + + + + + +ArduinoLibs: DS3232RTC.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS3232RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DS3232RTC.h"
+
24 #include "../I2C/I2CMaster.h"
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
59 // I2C address of the RTC chip (7-bit).
+
60 #define DS3232_I2C_ADDRESS 0x68
+
61 
+
62 // Registers.
+
63 #define DS3232_SECOND 0x00
+
64 #define DS3232_MINUTE 0x01
+
65 #define DS3232_HOUR 0x02
+
66 #define DS3232_DAY_OF_WEEK 0x03
+
67 #define DS3232_DATE 0x04
+
68 #define DS3232_MONTH 0x05
+
69 #define DS3232_YEAR 0x06
+
70 #define DS3232_ALARM1_SEC 0x07
+
71 #define DS3232_ALARM1_MIN 0x08
+
72 #define DS3232_ALARM1_HOUR 0x09
+
73 #define DS3232_ALARM1_DAY 0x0A
+
74 #define DS3232_ALARM2_MIN 0x0B
+
75 #define DS3232_ALARM2_HOUR 0x0C
+
76 #define DS3232_ALARM2_DAY 0x0D
+
77 #define DS3232_CONTROL 0x0E
+
78 #define DS3232_STATUS 0x0F
+
79 #define DS3232_AGING_OFFSET 0x10
+
80 #define DS3232_TEMP_MSB 0x11
+
81 #define DS3232_TEMP_LSB 0x12
+
82 #define DS3232_RESERVED 0x13
+
83 #define DS3232_NVRAM 0x14
+
84 
+
85 // Bits in the DS3232_CONTROL register.
+
86 #define DS3232_EOSC 0x80
+
87 #define DS3232_BBSQW 0x40
+
88 #define DS3232_CONV 0x20
+
89 #define DS3232_RS_1HZ 0x00
+
90 #define DS3232_RS_1024HZ 0x08
+
91 #define DS3232_RS_4096HZ 0x10
+
92 #define DS3232_RS_8192HZ 0x18
+
93 #define DS3232_INTCN 0x04
+
94 #define DS3232_A2IE 0x02
+
95 #define DS3232_A1IE 0x01
+
96 
+
97 // Bits in the DS3232_STATUS register.
+
98 #define DS3232_OSF 0x80
+
99 #define DS3232_BB32KHZ 0x40
+
100 #define DS3232_CRATE_64 0x00
+
101 #define DS3232_CRATE_128 0x10
+
102 #define DS3232_CRATE_256 0x20
+
103 #define DS3232_CRATE_512 0x30
+
104 #define DS3232_EN32KHZ 0x08
+
105 #define DS3232_BSY 0x04
+
106 #define DS3232_A2F 0x02
+
107 #define DS3232_A1F 0x01
+
108 
+
109 // Alarm storage at the end of the RTC's NVRAM.
+
110 #define DS3232_ALARM_SIZE 3
+
111 #define DS3232_ALARMS (256 - RTC::ALARM_COUNT * DS3232_ALARM_SIZE - 1)
+
112 #define DS3232_ALARM_MAGIC 255
+
113 
+
126 DS3232RTC::DS3232RTC(I2CMaster &bus, uint8_t oneHzPin)
+
127  : _bus(&bus)
+
128  , _oneHzPin(oneHzPin)
+
129  , prevOneHz(false)
+
130  , _isRealTime(true)
+
131  , alarmInterrupts(false)
+
132 {
+
133  // Probe the device and configure it for our use.
+
134  _bus->startWrite(DS3232_I2C_ADDRESS);
+
135  _bus->write(DS3232_CONTROL);
+
136  if (_bus->startRead(DS3232_I2C_ADDRESS, 1)) {
+
137  uint8_t value = _bus->read() & DS3232_CONV;
+
138  if (oneHzPin != 255)
+
139  value |= DS3232_BBSQW | DS3232_RS_1HZ;
+
140  _bus->startWrite(DS3232_I2C_ADDRESS);
+
141  _bus->write(DS3232_CONTROL);
+
142  _bus->write(value);
+
143  _bus->write(DS3232_CRATE_64);
+
144  _bus->endWrite();
+
145  } else {
+
146  // Did not get an acknowledgement from the RTC chip.
+
147  _isRealTime = false;
+
148  }
+
149 
+
150  // Configure the 1 Hz square wave pin if required.
+
151  if (oneHzPin != 255 && _isRealTime) {
+
152  pinMode(oneHzPin, INPUT);
+
153  digitalWrite(oneHzPin, HIGH);
+
154  }
+
155 
+
156  // Initialize the alarms in the RTC chip's NVRAM.
+
157  if (_isRealTime)
+
158  initAlarms();
+
159 }
+
160 
+ +
167 {
+
168  // If not using a 1 Hz pin or there is no RTC chip available,
+
169  // then assume that there is an update available.
+
170  if (_oneHzPin == 255 || !_isRealTime)
+
171  return true;
+
172 
+
173  // The DS3232 updates the internal registers on the falling edge of the
+
174  // 1 Hz clock. The values should be ready to read on the rising edge.
+
175  bool value = digitalRead(_oneHzPin);
+
176  if (value && !prevOneHz) {
+
177  prevOneHz = value;
+
178  return true;
+
179  } else {
+
180  prevOneHz = value;
+
181  return false;
+
182  }
+
183 }
+
184 
+
185 inline uint8_t fromBCD(uint8_t value)
+
186 {
+
187  return (value >> 4) * 10 + (value & 0x0F);
+
188 }
+
189 
+
190 inline uint8_t fromHourBCD(uint8_t value)
+
191 {
+
192  if ((value & 0x40) != 0) {
+
193  // 12-hour mode.
+
194  uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
+
195  if ((value & 0x20) != 0)
+
196  return (result == 12) ? 12 : (result + 12); // PM
+
197  else
+
198  return (result == 12) ? 0 : result; // AM
+
199  } else {
+
200  // 24-hour mode.
+
201  return fromBCD(value);
+
202  }
+
203 }
+
204 
+ +
206 {
+
207  if (_isRealTime) {
+
208  _bus->startWrite(DS3232_I2C_ADDRESS);
+
209  _bus->write(DS3232_SECOND);
+
210  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
211  value->second = fromBCD(_bus->read());
+
212  value->minute = fromBCD(_bus->read());
+
213  value->hour = fromHourBCD(_bus->read());
+
214  } else {
+
215  // RTC chip is not responding.
+
216  value->second = 0;
+
217  value->minute = 0;
+
218  value->hour = 0;
+
219  }
+
220  } else {
+
221  RTC::readTime(value);
+
222  }
+
223 }
+
224 
+ +
226 {
+
227  if (!_isRealTime) {
+
228  RTC::readDate(value);
+
229  return;
+
230  }
+
231  _bus->startWrite(DS3232_I2C_ADDRESS);
+
232  _bus->write(DS3232_DATE);
+
233  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
234  value->day = fromBCD(_bus->read());
+
235  value->month = fromBCD(_bus->read() & 0x7F); // Strip century bit.
+
236  value->year = fromBCD(_bus->read()) + 2000;
+
237  } else {
+
238  // RTC chip is not responding.
+
239  value->day = 1;
+
240  value->month = 1;
+
241  value->year = 2000;
+
242  }
+
243 }
+
244 
+
245 inline uint8_t toBCD(uint8_t value)
+
246 {
+
247  return ((value / 10) << 4) + (value % 10);
+
248 }
+
249 
+
250 void DS3232RTC::writeTime(const RTCTime *value)
+
251 {
+
252  if (_isRealTime) {
+
253  _bus->startWrite(DS3232_I2C_ADDRESS);
+
254  _bus->write(DS3232_SECOND);
+
255  _bus->write(toBCD(value->second));
+
256  _bus->write(toBCD(value->minute));
+
257  _bus->write(toBCD(value->hour)); // Changes mode to 24-hour clock.
+
258  _bus->endWrite();
+
259  } else {
+
260  RTC::writeTime(value);
+
261  }
+
262 }
+
263 
+
264 void DS3232RTC::writeDate(const RTCDate *value)
+
265 {
+
266  if (_isRealTime) {
+
267  _bus->startWrite(DS3232_I2C_ADDRESS);
+
268  _bus->write(DS3232_DATE);
+
269  _bus->write(toBCD(value->day));
+
270  _bus->write(toBCD(value->month));
+
271  _bus->write(toBCD(value->year % 100));
+
272  _bus->endWrite();
+
273  } else {
+
274  RTC::writeDate(value);
+
275  }
+
276 }
+
277 
+
278 void DS3232RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
279 {
+
280  if (_isRealTime) {
+
281  _bus->startWrite(DS3232_I2C_ADDRESS);
+
282  _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
+
283  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
284  value->hour = fromBCD(_bus->read());
+
285  value->minute = fromBCD(_bus->read());
+
286  value->flags = _bus->read();
+
287  } else {
+
288  // RTC chip is not responding.
+
289  value->hour = 0;
+
290  value->minute = 0;
+
291  value->flags = 0;
+
292  }
+
293  } else {
+
294  RTC::readAlarm(alarmNum, value);
+
295  }
+
296 }
+
297 
+
298 void DS3232RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
299 {
+
300  if (_isRealTime) {
+
301  // Write the alarm details to NVRAM.
+
302  _bus->startWrite(DS3232_I2C_ADDRESS);
+
303  _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
+
304  _bus->write(toBCD(value->hour));
+
305  _bus->write(toBCD(value->minute));
+
306  _bus->write(value->flags);
+
307  _bus->endWrite();
+
308 
+
309  // Keep the DS3232's built-in alarms in sync with the first two alarms.
+
310  if (alarmNum == 0) {
+
311  _bus->startWrite(DS3232_I2C_ADDRESS);
+
312  _bus->write(DS3232_ALARM1_SEC);
+
313  _bus->write(0);
+
314  _bus->write(toBCD(value->minute));
+
315  _bus->write(toBCD(value->hour));
+
316  _bus->write(0x81); // Match hours, mins, secs; day = 1
+
317  _bus->endWrite();
+
318  if (alarmInterrupts)
+
319  updateAlarmInterrupts();
+
320  } else if (alarmNum == 1) {
+
321  _bus->startWrite(DS3232_I2C_ADDRESS);
+
322  _bus->write(DS3232_ALARM2_MIN);
+
323  _bus->write(toBCD(value->minute));
+
324  _bus->write(toBCD(value->hour));
+
325  _bus->write(0x81); // Match hours, mins; day = 1
+
326  _bus->endWrite();
+
327  if (alarmInterrupts)
+
328  updateAlarmInterrupts();
+
329  }
+
330  } else {
+
331  RTC::writeAlarm(alarmNum, value);
+
332  }
+
333 }
+
334 
+ +
336 {
+
337  return DS3232_ALARMS - DS3232_NVRAM;
+
338 }
+
339 
+
340 uint8_t DS3232RTC::readByte(uint8_t offset)
+
341 {
+
342  if (_isRealTime)
+
343  return readRegister(DS3232_NVRAM + offset);
+
344  else
+
345  return RTC::readByte(offset);
+
346 }
+
347 
+
348 void DS3232RTC::writeByte(uint8_t offset, uint8_t value)
+
349 {
+
350  if (_isRealTime)
+
351  writeRegister(DS3232_NVRAM + offset, value);
+
352  else
+
353  RTC::writeByte(offset, value);
+
354 }
+
355 
+ +
357 {
+
358  if (_isRealTime) {
+
359  return (((int)(signed char)readRegister(DS3232_TEMP_MSB)) << 2) |
+
360  (readRegister(DS3232_TEMP_LSB) >> 6);
+
361  } else {
+
362  return NO_TEMPERATURE;
+
363  }
+
364 }
+
365 
+ +
381 {
+
382  if (_oneHzPin == 255 && _isRealTime) {
+
383  updateAlarmInterrupts();
+
384  alarmInterrupts = true;
+
385  }
+
386 }
+
387 
+ +
394 {
+
395  if (alarmInterrupts) {
+
396  uint8_t value = readRegister(DS3232_CONTROL);
+
397  value &= ~(DS3232_INTCN | DS3232_A2IE | DS3232_A1IE);
+
398  writeRegister(DS3232_CONTROL, value);
+
399  alarmInterrupts = false;
+
400  }
+
401 }
+
402 
+ +
417 {
+
418  if (!_isRealTime)
+
419  return -1;
+
420  uint8_t value = readRegister(DS3232_STATUS);
+
421  int alarm;
+
422  if (value & DS3232_A1F) {
+
423  if (value & DS3232_A2F)
+
424  alarm = 2;
+
425  else
+
426  alarm = 0;
+
427  } else if (value & DS3232_A2F) {
+
428  alarm = 1;
+
429  } else {
+
430  alarm = -1;
+
431  }
+
432  if (alarm != -1) {
+
433  value &= ~(DS3232_A1F | DS3232_A2F);
+
434  writeRegister(DS3232_STATUS, value);
+
435  }
+
436  return alarm;
+
437 }
+
438 
+ +
445 {
+
446  if (_isRealTime) {
+
447  uint8_t value = readRegister(DS3232_STATUS);
+
448  value |= DS3232_BB32KHZ | DS3232_EN32KHZ;
+
449  writeRegister(DS3232_STATUS, value);
+
450  }
+
451 }
+
452 
+ +
459 {
+
460  if (_isRealTime) {
+
461  uint8_t value = readRegister(DS3232_STATUS);
+
462  value &= ~(DS3232_BB32KHZ | DS3232_EN32KHZ);
+
463  writeRegister(DS3232_STATUS, value);
+
464  }
+
465 }
+
466 
+
467 void DS3232RTC::initAlarms()
+
468 {
+
469  uint8_t value = readRegister(DS3232_ALARM_MAGIC);
+
470  if (value != (0xB0 + ALARM_COUNT)) {
+
471  // This is the first time we have used this clock chip,
+
472  // so initialize all alarms to their default state.
+
473  RTCAlarm alarm;
+
474  alarm.hour = 6; // Default to 6am for alarms.
+
475  alarm.minute = 0;
+
476  alarm.flags = 0;
+
477  for (uint8_t index = 0; index < ALARM_COUNT; ++index)
+
478  writeAlarm(index, &alarm);
+
479  writeRegister(DS3232_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
+
480 
+
481  // Also clear the rest of NVRAM so that it is in a known state.
+
482  // Otherwise we'll have whatever garbage was present at power-on.
+
483  _bus->startWrite(DS3232_I2C_ADDRESS);
+
484  _bus->write(DS3232_NVRAM);
+
485  for (uint8_t index = DS3232_NVRAM; index < DS3232_ALARMS; ++index)
+
486  _bus->write(0);
+
487  _bus->endWrite();
+
488  }
+
489 }
+
490 
+
491 uint8_t DS3232RTC::readRegister(uint8_t reg)
+
492 {
+
493  _bus->startWrite(DS3232_I2C_ADDRESS);
+
494  _bus->write(reg);
+
495  if (!_bus->startRead(DS3232_I2C_ADDRESS, 1))
+
496  return 0; // RTC chip is not responding.
+
497  return _bus->read();
+
498 }
+
499 
+
500 bool DS3232RTC::writeRegister(uint8_t reg, uint8_t value)
+
501 {
+
502  _bus->startWrite(DS3232_I2C_ADDRESS);
+
503  _bus->write(reg);
+
504  _bus->write(value);
+
505  return _bus->endWrite();
+
506 }
+
507 
+
508 #define DS3232_ALARM1_FLAGS (DS3232_ALARMS + 2)
+
509 #define DS3232_ALARM2_FLAGS (DS3232_ALARMS + DS3232_ALARM_SIZE + 2)
+
510 
+
511 void DS3232RTC::updateAlarmInterrupts()
+
512 {
+
513  bool alarm1Enabled = ((readRegister(DS3232_ALARM1_FLAGS) & 0x01) != 0);
+
514  bool alarm2Enabled = ((readRegister(DS3232_ALARM2_FLAGS) & 0x01) != 0);
+
515  uint8_t value = readRegister(DS3232_CONTROL);
+
516  value |= DS3232_INTCN;
+
517  if (alarm1Enabled)
+
518  value |= DS3232_A1IE;
+
519  else
+
520  value &= ~DS3232_A1IE;
+
521  if (alarm2Enabled)
+
522  value |= DS3232_A2IE;
+
523  else
+
524  value &= ~DS3232_A2IE;
+
525  writeRegister(DS3232_CONTROL, value);
+
526 }
+
uint8_t month
Month of the year (1-12)
Definition: RTC.h:38
+
virtual void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: RTC.cpp:179
+
void enableAlarmInterrupts()
Enables the generation of interrupts for alarms 0 and 1.
Definition: DS3232RTC.cpp:380
+
void disable32kHzOutput()
Disables the 32 kHz output on the DS3232 chip.
Definition: DS3232RTC.cpp:458
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS3232RTC.cpp:205
+
int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: DS3232RTC.cpp:356
+
uint8_t minute
Minute within the hour (0-59)
Definition: RTC.h:31
+
virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: RTC.cpp:209
+
virtual void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: RTC.cpp:169
+
int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: DS3232RTC.cpp:335
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS3232RTC.cpp:225
+
void enable32kHzOutput()
Enables the 32 kHz output on the DS3232 chip.
Definition: DS3232RTC.cpp:444
+
virtual void write(uint8_t value)=0
Writes a single byte value on the I2C bus.
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS3232RTC.cpp:298
+
virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: RTC.cpp:224
+
static const uint8_t ALARM_COUNT
Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
Definition: RTC.h:77
+
virtual void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: RTC.cpp:194
+
void disableAlarmInterrupts()
Disables the generation of interrupts for alarms 0 and 1.
Definition: DS3232RTC.cpp:393
+
virtual bool startRead(unsigned int address, unsigned int count)=0
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
+
uint8_t hour
Hour of the day for the alarm (0-23).
Definition: RTC.h:46
+
static const int NO_TEMPERATURE
Value that is returned from readTemperature() if the realtime clock chip cannot determine the tempera...
Definition: RTC.h:86
+
uint8_t flags
Additional flags for the alarm.
Definition: RTC.h:49
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS3232RTC.cpp:250
+
uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: DS3232RTC.cpp:340
+
int firedAlarm()
Determines which of alarms 0 or 1 have fired since the last call.
Definition: DS3232RTC.cpp:416
+
DS3232RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS3232RTC.cpp:126
+
virtual void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
+
virtual bool endWrite()=0
Ends the current write operation.
+
unsigned int year
Year (4-digit)
Definition: RTC.h:37
+
virtual void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:262
+
uint8_t minute
Minute of the hour for the alarm (0-59).
Definition: RTC.h:47
+
bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: DS3232RTC.cpp:166
+
virtual uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:247
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS3232RTC.cpp:264
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
virtual uint8_t read()=0
Reads a single byte from the I2C bus.
+
uint8_t hour
Hour of the day (0-23)
Definition: RTC.h:30
+
uint8_t day
Day of the month (1-31)
Definition: RTC.h:39
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS3232RTC.cpp:278
+
uint8_t second
Second within the minute (0-59)
Definition: RTC.h:32
+
void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: DS3232RTC.cpp:348
+
virtual void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: RTC.cpp:144
+
+ + + + diff --git a/html/DS3232RTC_8h_source.html b/html/DS3232RTC_8h_source.html new file mode 100644 index 00000000..7395d5ac --- /dev/null +++ b/html/DS3232RTC_8h_source.html @@ -0,0 +1,198 @@ + + + + + + +ArduinoLibs: DS3232RTC.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DS3232RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DS3232RTC_h
+
24 #define DS3232RTC_h
+
25 
+
26 #include "RTC.h"
+
27 
+
28 class I2CMaster;
+
29 
+
30 class DS3232RTC : public RTC {
+
31 public:
+
32  DS3232RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
+
33 
+
34  bool isRealTime() const { return _isRealTime; }
+
35 
+
36  bool hasUpdates();
+
37 
+
38  void readTime(RTCTime *value);
+
39  void readDate(RTCDate *value);
+
40 
+
41  void writeTime(const RTCTime *value);
+
42  void writeDate(const RTCDate *value);
+
43 
+
44  void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
45  void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
46 
+
47  int byteCount() const;
+
48  uint8_t readByte(uint8_t offset);
+
49  void writeByte(uint8_t offset, uint8_t value);
+
50 
+
51  int readTemperature();
+
52 
+
53  void enableAlarmInterrupts();
+ +
55  int firedAlarm();
+
56 
+
57  void enable32kHzOutput();
+
58  void disable32kHzOutput();
+
59 
+
60 private:
+
61  I2CMaster *_bus;
+
62  uint8_t _oneHzPin;
+
63  bool prevOneHz;
+
64  bool _isRealTime;
+
65  bool alarmInterrupts;
+
66 
+
67  void initAlarms();
+
68 
+
69  uint8_t readRegister(uint8_t reg);
+
70  bool writeRegister(uint8_t reg, uint8_t value);
+
71 
+
72  void updateAlarmInterrupts();
+
73 };
+
74 
+
75 #endif
+
void enableAlarmInterrupts()
Enables the generation of interrupts for alarms 0 and 1.
Definition: DS3232RTC.cpp:380
+
void disable32kHzOutput()
Disables the 32 kHz output on the DS3232 chip.
Definition: DS3232RTC.cpp:458
+
void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: DS3232RTC.cpp:205
+
int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: DS3232RTC.cpp:356
+
int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: DS3232RTC.cpp:335
+
void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: DS3232RTC.cpp:225
+
void enable32kHzOutput()
Enables the 32 kHz output on the DS3232 chip.
Definition: DS3232RTC.cpp:444
+
void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: DS3232RTC.cpp:298
+
Communicates with a DS3232 realtime clock chip via I2C.
Definition: DS3232RTC.h:30
+
void disableAlarmInterrupts()
Disables the generation of interrupts for alarms 0 and 1.
Definition: DS3232RTC.cpp:393
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: DS3232RTC.cpp:250
+
uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: DS3232RTC.cpp:340
+
int firedAlarm()
Determines which of alarms 0 or 1 have fired since the last call.
Definition: DS3232RTC.cpp:416
+
DS3232RTC(I2CMaster &bus, uint8_t oneHzPin=255)
Attaches to a realtime clock slave device on bus.
Definition: DS3232RTC.cpp:126
+
bool isRealTime() const
Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated...
Definition: DS3232RTC.h:34
+
bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: DS3232RTC.cpp:166
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: DS3232RTC.cpp:264
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: DS3232RTC.cpp:278
+
void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: DS3232RTC.cpp:348
+
Base class for realtime clock handlers.
Definition: RTC.h:52
+
+ + + + diff --git a/html/DejaVuSans9_8h_source.html b/html/DejaVuSans9_8h_source.html new file mode 100644 index 00000000..07aebb04 --- /dev/null +++ b/html/DejaVuSans9_8h_source.html @@ -0,0 +1,265 @@ + + + + + + +ArduinoLibs: DejaVuSans9.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DejaVuSans9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSans9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSans9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 3962
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANS9_H
+
43 #define DEJAVUSANS9_H
+
44 
+
45 #define DEJAVUSANS9_WIDTH 10
+
46 #define DEJAVUSANS9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSans9[] PROGMEM = {
+
49  0x0F, 0x7A, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x01, 0x03, 0x06, 0x05, 0x08, 0x06, 0x01, 0x02, 0x02,
+
57  0x05, 0x05, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x04,
+
58  0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x01, 0x01, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x05,
+
60  0x05, 0x01, 0x02, 0x05, 0x04, 0x06, 0x05, 0x05, 0x04, 0x05,
+
61  0x05, 0x05, 0x05, 0x05, 0x06, 0x07, 0x06, 0x05, 0x05, 0x02,
+
62  0x03, 0x02, 0x04, 0x05, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04,
+
63  0x03, 0x04, 0x04, 0x01, 0x02, 0x04, 0x01, 0x07, 0x04, 0x04,
+
64  0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x05, 0x07, 0x05, 0x05,
+
65  0x04, 0x03, 0x01, 0x03, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0xBE, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x28, 0xE8, 0x3E, 0xE8, 0x3E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0x94, 0xFE, 0xA4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x1E, 0x12, 0xDE, 0x30, 0x18, 0xF6, 0x90, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0x9C, 0x92, 0x62, 0xC4, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0x7E, 0x81, 0x00, 0x00, // 40
+
76  0xC3, 0x3C, 0x00, 0x00, // 41
+
77  0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0x80, 0x40, // 44
+
80  0x20, 0x20, 0x00, 0x00, // 45
+
81  0x80, 0x00, // 46
+
82  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
+
83  0x7C, 0x82, 0x82, 0x7C, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x82, 0xFE, 0x80, 0x00, 0x00, 0x00, // 49
+
85  0xC4, 0xA2, 0x92, 0x8C, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x84, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x60, 0x58, 0x44, 0xFE, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x9E, 0x92, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x7C, 0x96, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x02, 0xC2, 0x3A, 0x06, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x6C, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x9C, 0x92, 0xD2, 0x7C, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0x88, 0x00, // 58
+
94  0x88, 0x40, // 59
+
95  0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x02, 0xB2, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
+
100  0xC0, 0x38, 0x26, 0x26, 0x38, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x7C, 0xC6, 0x82, 0x82, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xFE, 0x82, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x7C, 0xC6, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xFE, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xFE, 0x00, // 73
+
109  0x00, 0xFE, 0x80, 0x40, // 74
+
110  0xFE, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xFE, 0x0C, 0x30, 0x30, 0x0C, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xFE, 0x0C, 0x10, 0x60, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xFE, 0x12, 0x12, 0x0C, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
+
117  0xFE, 0x12, 0x32, 0x4E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0x4C, 0x92, 0x92, 0x92, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x7E, 0x80, 0x80, 0x80, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x06, 0x38, 0xC0, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0x06, 0x38, 0xE0, 0x1E, 0xE0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x82, 0x46, 0x38, 0x38, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x02, 0x0C, 0xF0, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xFE, 0x02, 0x40, 0x40, // 91
+
127  0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
+
128  0x02, 0xFE, 0x40, 0x40, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xE0, 0xA8, 0xA8, 0xF8, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xFF, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0x70, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0x70, 0x88, 0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xA8, 0xA8, 0xB0, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0x08, 0xFF, 0x09, 0x00, 0x00, 0x00, // 102
+
138  0x70, 0x88, 0x88, 0xF8, 0x00, 0x80, 0x80, 0x40, // 103
+
139  0xFF, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xFA, 0x00, // 105
+
141  0x00, 0xFA, 0x80, 0xC0, // 106
+
142  0xFF, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xFF, 0x00, // 108
+
144  0xF8, 0x08, 0x08, 0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xF8, 0x88, 0x88, 0x70, 0xC0, 0x00, 0x00, 0x00, // 112
+
148  0x70, 0x88, 0x88, 0xF8, 0x00, 0x00, 0x00, 0xC0, // 113
+
149  0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, // 114
+
150  0x98, 0xA8, 0xE8, 0x00, 0x00, 0x00, // 115
+
151  0x08, 0xFC, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 116
+
152  0xF8, 0x80, 0x80, 0xF8, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x18, 0x60, 0x80, 0x60, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0x38, 0xC0, 0x30, 0x08, 0x30, 0xC0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x18, 0x60, 0x80, 0x60, 0x18, 0x80, 0x80, 0x40, 0x00, 0x00, // 121
+
157  0x88, 0xC8, 0xA8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x10, 0xEE, 0x02, 0x00, 0x40, 0x40, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x02, 0xEE, 0x10, 0x40, 0x40, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + + + diff --git a/html/DejaVuSansBold9_8h_source.html b/html/DejaVuSansBold9_8h_source.html new file mode 100644 index 00000000..58d86e1e --- /dev/null +++ b/html/DejaVuSansBold9_8h_source.html @@ -0,0 +1,265 @@ + + + + + + +ArduinoLibs: DejaVuSansBold9.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DejaVuSansBold9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSansBold9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSansBold9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 4662
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANSBOLD9_H
+
43 #define DEJAVUSANSBOLD9_H
+
44 
+
45 #define DEJAVUSANSBOLD9_WIDTH 10
+
46 #define DEJAVUSANSBOLD9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSansBold9[] PROGMEM = {
+
49  0x12, 0x36, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x02, 0x03, 0x06, 0x05, 0x08, 0x07, 0x01, 0x03, 0x03,
+
57  0x05, 0x05, 0x02, 0x03, 0x02, 0x03, 0x05, 0x05, 0x05, 0x05,
+
58  0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x07, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06,
+
60  0x07, 0x02, 0x03, 0x06, 0x05, 0x07, 0x06, 0x06, 0x05, 0x06,
+
61  0x06, 0x05, 0x06, 0x06, 0x07, 0x09, 0x07, 0x06, 0x06, 0x03,
+
62  0x03, 0x03, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x05, 0x05,
+
63  0x04, 0x05, 0x05, 0x02, 0x03, 0x05, 0x02, 0x08, 0x05, 0x05,
+
64  0x05, 0x05, 0x03, 0x04, 0x03, 0x05, 0x06, 0x08, 0x06, 0x06,
+
65  0x04, 0x04, 0x01, 0x04, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0xDE, 0xDE, 0x00, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x28, 0xF8, 0x2E, 0xF8, 0x2E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0xB4, 0xFE, 0xB4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x0C, 0x12, 0xD2, 0x7C, 0x78, 0x96, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0xFC, 0x9E, 0xB2, 0x62, 0xE0, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0x3C, 0xFF, 0x81, 0x00, 0x00, 0x00, // 40
+
76  0x81, 0xFF, 0x3C, 0x00, 0x00, 0x00, // 41
+
77  0x14, 0x18, 0x3E, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0xC0, 0xC0, 0x40, 0x00, // 44
+
80  0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
+
81  0xC0, 0xC0, 0x00, 0x00, // 46
+
82  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
+
83  0x7C, 0xFE, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x82, 0x82, 0xFE, 0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 49
+
85  0xC2, 0xE2, 0xB2, 0x9E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x82, 0x92, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x60, 0x58, 0x44, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x9E, 0x9E, 0x92, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x7C, 0xFE, 0x96, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x82, 0xE2, 0x7A, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x6C, 0xEE, 0x92, 0xEE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x8C, 0x9E, 0xD2, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0xD8, 0xD8, 0x00, 0x00, // 58
+
94  0xD8, 0xD8, 0x40, 0x00, // 59
+
95  0x20, 0x50, 0x50, 0x50, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0xD8, 0x50, 0x50, 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x02, 0xDA, 0xDE, 0x0E, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
+
100  0x80, 0xF0, 0x7E, 0x4E, 0x7E, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xFE, 0xFE, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x38, 0x7C, 0xC6, 0x82, 0x82, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xFE, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xFE, 0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xFE, 0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x78, 0xFC, 0x86, 0x92, 0xF2, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xFE, 0xFE, 0x10, 0x10, 0x10, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xFE, 0xFE, 0x00, 0x00, // 73
+
109  0x00, 0xFE, 0xFE, 0x80, 0xC0, 0x40, // 74
+
110  0xFE, 0xFE, 0x38, 0x6C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xFE, 0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xFE, 0xFE, 0x0C, 0x30, 0x0C, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xFE, 0xFE, 0x0C, 0x30, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xFE, 0xFE, 0x12, 0x1E, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
+
117  0xFE, 0xFE, 0x12, 0x7E, 0xEC, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0xCC, 0x9E, 0x92, 0xF2, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0x02, 0xFE, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x7E, 0xFE, 0x80, 0x80, 0xFE, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x02, 0x1E, 0xF8, 0xC0, 0xF8, 0x1E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0x0E, 0xFE, 0xE0, 0x3C, 0x06, 0x3C, 0xE0, 0xFE, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x82, 0xC6, 0x7C, 0x10, 0x7C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x06, 0x0E, 0xF8, 0xF8, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0xC2, 0xE2, 0xB2, 0x9A, 0x8E, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, // 91
+
127  0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
+
128  0x81, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xE8, 0xE8, 0xA8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xFF, 0xFF, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0x70, 0xF8, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0x70, 0xF8, 0x88, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xF8, 0xA8, 0xB8, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0x08, 0xFE, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, // 102
+
138  0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x80, 0x80, 0xC0, 0x40, // 103
+
139  0xFF, 0xFF, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xFB, 0xFB, 0x00, 0x00, // 105
+
141  0x00, 0xFB, 0xFB, 0x80, 0xC0, 0x40, // 106
+
142  0xFF, 0xFF, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xFF, 0xFF, 0x00, 0x00, // 108
+
144  0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0xF8, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xF8, 0xF8, 0x88, 0xF8, 0x70, 0xC0, 0xC0, 0x00, 0x00, 0x00, // 112
+
148  0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0xC0, 0xC0, // 113
+
149  0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, // 114
+
150  0xB0, 0xB8, 0xE8, 0x68, 0x00, 0x00, 0x00, 0x00, // 115
+
151  0xFC, 0xFC, 0x88, 0x00, 0x00, 0x00, // 116
+
152  0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x18, 0x78, 0xC0, 0xC0, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0x18, 0xF8, 0xE0, 0x38, 0x38, 0xE0, 0xF8, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x88, 0xD8, 0x70, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x08, 0x38, 0xE0, 0xE0, 0x38, 0x08, 0x00, 0x80, 0xC0, 0x00, 0x00, 0x00, // 121
+
157  0xC8, 0xE8, 0xB8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x08, 0xFF, 0xF7, 0x81, 0x00, 0x00, 0x00, 0x00, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x81, 0xF7, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + + + diff --git a/html/DejaVuSansItalic9_8h_source.html b/html/DejaVuSansItalic9_8h_source.html new file mode 100644 index 00000000..86e48a07 --- /dev/null +++ b/html/DejaVuSansItalic9_8h_source.html @@ -0,0 +1,265 @@ + + + + + + +ArduinoLibs: DejaVuSansItalic9.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DejaVuSansItalic9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSansItalic9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSansItalic9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 4572
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANSITALIC9_H
+
43 #define DEJAVUSANSITALIC9_H
+
44 
+
45 #define DEJAVUSANSITALIC9_WIDTH 10
+
46 #define DEJAVUSANSITALIC9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSansItalic9[] PROGMEM = {
+
49  0x11, 0xDC, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x03, 0x03, 0x06, 0x04, 0x07, 0x06, 0x01, 0x03, 0x03,
+
57  0x05, 0x05, 0x01, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x05,
+
58  0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x06, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06,
+
60  0x07, 0x03, 0x03, 0x06, 0x04, 0x08, 0x07, 0x06, 0x05, 0x06,
+
61  0x05, 0x06, 0x05, 0x06, 0x05, 0x08, 0x06, 0x05, 0x06, 0x04,
+
62  0x02, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x06, 0x05,
+
63  0x03, 0x05, 0x05, 0x03, 0x03, 0x05, 0x03, 0x08, 0x05, 0x05,
+
64  0x05, 0x05, 0x04, 0x04, 0x03, 0x05, 0x05, 0x07, 0x05, 0x05,
+
65  0x05, 0x04, 0x01, 0x05, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0x80, 0x38, 0x06, 0x00, 0x00, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x20, 0xF8, 0x2E, 0xF8, 0x2E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0xDC, 0xA6, 0x64, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x1C, 0xD2, 0x2E, 0x10, 0xEC, 0x92, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0x9C, 0x92, 0xA2, 0x64, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0xF8, 0x06, 0x01, 0x00, 0x00, 0x00, // 40
+
76  0x80, 0x61, 0x1E, 0x00, 0x00, 0x00, // 41
+
77  0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0x80, 0x00, // 44
+
80  0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
+
81  0x80, 0x00, // 46
+
82  0x60, 0x30, 0x0C, 0x00, 0x00, 0x00, // 47
+
83  0x78, 0x84, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x80, 0x82, 0xF2, 0x8E, 0x00, 0x00, 0x00, 0x00, // 49
+
85  0x80, 0xC4, 0xA2, 0x92, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x40, 0x84, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x40, 0x70, 0xC8, 0x7C, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x80, 0x9C, 0x92, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x78, 0x94, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x82, 0x42, 0x32, 0x0E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x60, 0xAC, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x80, 0x9C, 0x92, 0x72, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0x80, 0x08, 0x00, 0x00, // 58
+
94  0x80, 0x08, 0x00, 0x00, // 59
+
95  0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x82, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0xE0, 0x18, 0xE8, 0x94, 0x94, 0xF4, 0xCC, 0x78, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, // 64
+
100  0x80, 0x60, 0x38, 0x24, 0x3E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xC0, 0xB8, 0x96, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x78, 0x84, 0x82, 0x82, 0x82, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xC0, 0xB8, 0x86, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xC0, 0xB8, 0x96, 0x92, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xC0, 0x38, 0x16, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x78, 0x84, 0x82, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xC0, 0x38, 0x16, 0x10, 0xD0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 73
+
109  0x00, 0xF0, 0x0E, 0xC0, 0x00, 0x00, // 74
+
110  0xC0, 0x38, 0x16, 0x68, 0x84, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xC0, 0xB8, 0x86, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xC0, 0x38, 0x06, 0x38, 0x10, 0xC8, 0x3C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xC0, 0x38, 0x06, 0x38, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xC0, 0x38, 0x16, 0x12, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // 81
+
117  0xC0, 0x38, 0x16, 0x72, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0x40, 0x8C, 0x92, 0x92, 0x62, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0xC2, 0x3A, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x78, 0x86, 0x80, 0x80, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x0E, 0xF0, 0x40, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0xFE, 0x60, 0x1C, 0x02, 0xFE, 0x60, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x80, 0x42, 0x2C, 0x10, 0x6C, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x02, 0xCC, 0x30, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0x80, 0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xC0, 0xBC, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, // 91
+
127  0x1E, 0xE0, 0x00, 0x00, // 92
+
128  0x80, 0xC0, 0x3D, 0x03, 0x00, 0x00, 0x00, 0x00, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xC0, 0xA8, 0xA8, 0xE8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xC0, 0x7C, 0x93, 0x88, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0xF0, 0x98, 0x88, 0x08, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0xF0, 0x98, 0x88, 0xC8, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xB8, 0xA8, 0xA8, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0xC8, 0x3E, 0x09, 0x00, 0x00, 0x00, // 102
+
138  0xF0, 0x98, 0x88, 0xC8, 0x38, 0x80, 0x80, 0x80, 0x40, 0x00, // 103
+
139  0xC0, 0x3C, 0x13, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xE0, 0x38, 0x01, 0x00, 0x00, 0x00, // 105
+
141  0xC0, 0x38, 0x01, 0xC0, 0x00, 0x00, // 106
+
142  0xC0, 0x3C, 0x23, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xC0, 0x3C, 0x03, 0x00, 0x00, 0x00, // 108
+
144  0xE0, 0x18, 0x08, 0xC8, 0x78, 0x10, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xE0, 0x38, 0x08, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0x98, 0x88, 0xC8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xE0, 0x98, 0x88, 0xC8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 112
+
148  0xF0, 0x88, 0x88, 0xF0, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x00, // 113
+
149  0xE0, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, // 114
+
150  0x80, 0xB8, 0xA8, 0xE8, 0x00, 0x00, 0x00, 0x00, // 115
+
151  0xF8, 0x8C, 0x08, 0x00, 0x00, 0x00, // 116
+
152  0xE0, 0x98, 0x80, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x38, 0xC0, 0x60, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0xF8, 0x60, 0x10, 0xF8, 0x40, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x80, 0x48, 0x30, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x00, 0xF8, 0x60, 0x10, 0x08, 0x80, 0x40, 0x00, 0x00, 0x00, // 121
+
157  0x80, 0xC8, 0xA8, 0x98, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x08, 0xF8, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x80, 0x80, 0x71, 0x0F, 0x08, 0x00, 0x00, 0x40, 0x00, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + + + diff --git a/html/EEPROM24_8cpp_source.html b/html/EEPROM24_8cpp_source.html new file mode 100644 index 00000000..55769a06 --- /dev/null +++ b/html/EEPROM24_8cpp_source.html @@ -0,0 +1,290 @@ + + + + + + +ArduinoLibs: EEPROM24.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
EEPROM24.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "EEPROM24.h"
+
24 #include "I2CMaster.h"
+
25 
+
95 EEPROM24::EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank)
+
96  : _bus(&bus)
+
97  , _size((type & 0xFFFF) * ((type >> 16) & 0x0FFF))
+
98  , _pageSize((type >> 16) & 0x0FFF)
+
99  , _mode((uint8_t)((type >> 28) & 0x0F))
+
100  , i2cAddress(0x50)
+
101 {
+
102  // Adjust the I2C address for the memory bank of the chip.
+
103  switch (_mode) {
+
104  case EE_BSEL_NONE:
+
105  i2cAddress += (bank & 0x07);
+
106  break;
+
107  case EE_BSEL_8BIT_ADDR: {
+
108  uint8_t addrBits = 8;
+
109  unsigned long size = 0x0100;
+
110  while (size < _size) {
+
111  ++addrBits;
+
112  size <<= 1;
+
113  }
+
114  if (addrBits < 11)
+
115  i2cAddress += ((bank << (addrBits - 8)) & 0x07);
+
116  break; }
+
117  case EE_BSEL_17BIT_ADDR:
+
118  i2cAddress += ((bank << 1) & 0x06);
+
119  break;
+
120  case EE_BSEL_17BIT_ADDR_ALT:
+
121  i2cAddress += bank & 0x03;
+
122  break;
+
123  }
+
124 }
+
125 
+ +
153 {
+
154  // Perform a "Current Address Read" on the EEPROM. We don't care about
+
155  // the returned byte. We only care if the read request was ACK'ed or not.
+
156  if (!_bus->startRead(i2cAddress, 1))
+
157  return false;
+
158  _bus->read();
+
159  return true;
+
160 }
+
161 
+
167 uint8_t EEPROM24::read(unsigned long address)
+
168 {
+
169  if (address >= _size)
+
170  return 0;
+
171  writeAddress(address);
+
172  if (!_bus->startRead(i2cAddress, 1))
+
173  return 0;
+
174  return _bus->read();
+
175 }
+
176 
+
187 size_t EEPROM24::read(unsigned long address, void *data, size_t length)
+
188 {
+
189  if (address >= _size || !length)
+
190  return 0;
+
191  if ((address + length) > _size)
+
192  length = (size_t)(_size - address);
+
193  writeAddress(address);
+
194  if (!_bus->startRead(i2cAddress, length))
+
195  return 0;
+
196  uint8_t *d = (uint8_t *)data;
+
197  unsigned int count = 0;
+
198  while (_bus->available()) {
+
199  *d++ = _bus->read();
+
200  ++count;
+
201  }
+
202  return count;
+
203 }
+
204 
+
213 bool EEPROM24::write(unsigned long address, uint8_t value)
+
214 {
+
215  if (address >= _size)
+
216  return false;
+
217  writeAddress(address);
+
218  _bus->write(value);
+
219  return waitForWrite();
+
220 }
+
221 
+
235 size_t EEPROM24::write(unsigned long address, const void *data, size_t length)
+
236 {
+
237  if (address >= _size)
+
238  return 0;
+
239  if ((address + length) > _size)
+
240  length = (size_t)(_size - address);
+
241  bool needAddress = true;
+
242  size_t result = 0;
+
243  size_t page = 0;
+
244  const uint8_t *d = (const uint8_t *)data;
+
245  while (length > 0) {
+
246  if (needAddress) {
+
247  writeAddress(address);
+
248  needAddress = false;
+
249  }
+
250  _bus->write(*d++);
+
251  ++address;
+
252  ++page;
+
253  if ((address & (_pageSize - 1)) == 0) {
+
254  // At the end of a page, so perform a flush.
+
255  if (!waitForWrite())
+
256  return result; // Could not write this page.
+
257  needAddress = true;
+
258  result += page;
+
259  page = 0;
+
260  }
+
261  --length;
+
262  }
+
263  if (!needAddress) {
+
264  if (!waitForWrite())
+
265  return result; // Could not write the final page.
+
266  }
+
267  return result + page;
+
268 }
+
269 
+
270 void EEPROM24::writeAddress(unsigned long address)
+
271 {
+
272  switch (_mode) {
+
273  case EE_BSEL_NONE:
+
274  _bus->startWrite(i2cAddress);
+
275  _bus->write((uint8_t)(address >> 8));
+
276  _bus->write((uint8_t)address);
+
277  break;
+
278  case EE_BSEL_8BIT_ADDR:
+
279  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 8)) & 0x07));
+
280  _bus->write((uint8_t)address);
+
281  break;
+
282  case EE_BSEL_17BIT_ADDR:
+
283  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 16)) & 0x01));
+
284  _bus->write((uint8_t)(address >> 8));
+
285  _bus->write((uint8_t)address);
+
286  break;
+
287  case EE_BSEL_17BIT_ADDR_ALT:
+
288  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 14)) & 0x04));
+
289  _bus->write((uint8_t)(address >> 8));
+
290  _bus->write((uint8_t)address);
+
291  break;
+
292  }
+
293 }
+
294 
+
295 bool EEPROM24::waitForWrite()
+
296 {
+
297  // 1000 iterations is going to be approximately 100ms when the I2C
+
298  // clock is 100 kHz. If there has been no response in that time
+
299  // then we assume that the write has failed and timeout.
+
300  if (!_bus->endWrite())
+
301  return false;
+
302  unsigned count = 1000;
+
303  while (count > 0) {
+
304  _bus->startWrite(i2cAddress);
+
305  if (_bus->endWrite())
+
306  return true;
+
307  --count;
+
308  }
+
309  return false;
+
310 }
+
unsigned long size() const
Returns the size of the EEPROM in bytes.
Definition: EEPROM24.h:65
+
uint8_t read(unsigned long address)
Reads a single byte from the EEPROM at address.
Definition: EEPROM24.cpp:167
+
virtual void write(uint8_t value)=0
Writes a single byte value on the I2C bus.
+
virtual bool startRead(unsigned int address, unsigned int count)=0
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
+
EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank=0)
Constructs a new EEPROM access object on bus for an EEPROM of the specified type. ...
Definition: EEPROM24.cpp:95
+
bool write(unsigned long address, uint8_t value)
Writes a byte value to address in the EEPROM.
Definition: EEPROM24.cpp:213
+
virtual unsigned int available()=0
Returns the number of bytes that are still available for reading.
+
virtual void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
+
virtual bool endWrite()=0
Ends the current write operation.
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
bool available()
Returns true if the EEPROM is available on the I2C bus; false otherwise.
Definition: EEPROM24.cpp:152
+
virtual uint8_t read()=0
Reads a single byte from the I2C bus.
+
+ + + + diff --git a/html/EEPROM24_8h_source.html b/html/EEPROM24_8h_source.html new file mode 100644 index 00000000..b392e559 --- /dev/null +++ b/html/EEPROM24_8h_source.html @@ -0,0 +1,194 @@ + + + + + + +ArduinoLibs: EEPROM24.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
EEPROM24.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef EEPROM24_h
+
24 #define EEPROM24_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 class I2CMaster;
+
30 
+
31 // Block select modes.
+
32 #define EE_BSEL_NONE 0
+
33 #define EE_BSEL_8BIT_ADDR 1
+
34 #define EE_BSEL_17BIT_ADDR 2
+
35 #define EE_BSEL_17BIT_ADDR_ALT 3
+
36 
+
37 // Create an EEPROM descriptor from byte size, page size, and block select mode.
+
38 #define _EE24(byteSize, pageSize, mode) \
+
39  (((byteSize) / (pageSize)) | (((unsigned long)(pageSize)) << 16) | \
+
40  (((unsigned long)(mode)) << 28))
+
41 
+
42 // Type descriptors for the 24LCXX range of EEPROM's.
+
43 #define EEPROM_24LC00 _EE24(16UL, 1, EE_BSEL_8BIT_ADDR)
+
44 #define EEPROM_24LC01 _EE24(128UL, 8, EE_BSEL_8BIT_ADDR)
+
45 #define EEPROM_24LC014 _EE24(128UL, 16, EE_BSEL_8BIT_ADDR)
+
46 #define EEPROM_24LC02 _EE24(256UL, 8, EE_BSEL_8BIT_ADDR)
+
47 #define EEPROM_24LC024 _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
+
48 #define EEPROM_24LC025 _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
+
49 #define EEPROM_24LC04 _EE24(512UL, 16, EE_BSEL_8BIT_ADDR)
+
50 #define EEPROM_24LC08 _EE24(1024UL, 16, EE_BSEL_8BIT_ADDR)
+
51 #define EEPROM_24LC16 _EE24(2048UL, 16, EE_BSEL_8BIT_ADDR)
+
52 #define EEPROM_24LC32 _EE24(4096UL, 32, EE_BSEL_NONE)
+
53 #define EEPROM_24LC64 _EE24(8192UL, 32, EE_BSEL_NONE)
+
54 #define EEPROM_24LC128 _EE24(16384UL, 32, EE_BSEL_NONE)
+
55 #define EEPROM_24LC256 _EE24(32768UL, 64, EE_BSEL_NONE)
+
56 #define EEPROM_24LC512 _EE24(65536UL, 128, EE_BSEL_NONE)
+
57 #define EEPROM_24LC1025 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR_ALT)
+
58 #define EEPROM_24LC1026 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR)
+
59 
+
60 class EEPROM24
+
61 {
+
62 public:
+
63  EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank = 0);
+
64 
+
65  unsigned long size() const { return _size; }
+
66  unsigned long pageSize() const { return _pageSize; }
+
67 
+
68  bool available();
+
69 
+
70  uint8_t read(unsigned long address);
+
71  size_t read(unsigned long address, void *data, size_t length);
+
72 
+
73  bool write(unsigned long address, uint8_t value);
+
74  size_t write(unsigned long address, const void *data, size_t length);
+
75 
+
76 private:
+
77  I2CMaster *_bus;
+
78  unsigned long _size;
+
79  unsigned long _pageSize;
+
80  uint8_t _mode;
+
81  uint8_t i2cAddress;
+
82 
+
83  void writeAddress(unsigned long address);
+
84  bool waitForWrite();
+
85 };
+
86 
+
87 #endif
+
unsigned long size() const
Returns the size of the EEPROM in bytes.
Definition: EEPROM24.h:65
+
uint8_t read(unsigned long address)
Reads a single byte from the EEPROM at address.
Definition: EEPROM24.cpp:167
+
Reading and writing EEPROM's from the 24LCXX family.
Definition: EEPROM24.h:60
+
EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank=0)
Constructs a new EEPROM access object on bus for an EEPROM of the specified type. ...
Definition: EEPROM24.cpp:95
+
bool write(unsigned long address, uint8_t value)
Writes a byte value to address in the EEPROM.
Definition: EEPROM24.cpp:213
+
unsigned long pageSize() const
Returns the size of a single EEPROM page in bytes.
Definition: EEPROM24.h:66
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
bool available()
Returns true if the EEPROM is available on the I2C bus; false otherwise.
Definition: EEPROM24.cpp:152
+
+ + + + diff --git a/html/Field_8cpp_source.html b/html/Field_8cpp_source.html new file mode 100644 index 00000000..5e4c2163 --- /dev/null +++ b/html/Field_8cpp_source.html @@ -0,0 +1,204 @@ + + + + + + +ArduinoLibs: Field.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Field.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Field.h"
+
24 
+
40 Field::Field(const String &label)
+
41  : _label(label)
+
42  , _form(0)
+
43  , next(0)
+
44  , prev(0)
+
45 {
+
46 }
+
47 
+
52 Field::Field(Form &form, const String &label)
+
53  : _label(label)
+
54  , _form(0)
+
55  , next(0)
+
56  , prev(0)
+
57 {
+
58  form.addField(this);
+
59 }
+
60 
+ +
67 {
+
68  if (_form)
+
69  _form->removeField(this);
+
70 }
+
71 
+
96 int Field::dispatch(int event)
+
97 {
+
98  // Nothing to do here.
+
99  return -1;
+
100 }
+
101 
+
116 void Field::enterField(bool reverse)
+
117 {
+
118  lcd()->print(_label);
+
119 }
+
120 
+ +
130 {
+
131  // Nothing to do here.
+
132 }
+
133 
+
146 void Field::setLabel(const String &label)
+
147 {
+
148  if (isCurrent()) {
+
149  unsigned int prevLen = _label.length();
+
150  unsigned int newLen = label.length();
+
151  _label = label;
+
152  lcd()->setCursor(0, 0);
+
153  lcd()->print(label);
+
154  while (newLen++ < prevLen)
+
155  lcd()->write(' ');
+
156  updateCursor();
+
157  } else {
+
158  _label = label;
+
159  }
+
160 }
+
161 
+
169 bool Field::isCurrent() const
+
170 {
+
171  if (!_form->isVisible())
+
172  return false;
+
173  return _form->currentField() == this;
+
174 }
+
175 
+ +
192 {
+
193  // Nothing to do here.
+
194 }
+
bool isVisible() const
Returns true if the form is shown; false if the form is hidden.
Definition: Form.h:53
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
virtual int dispatch(int event)
Dispatches event via this field.
Definition: Field.cpp:96
+
void addField(Field *field)
Adds field to this form.
Definition: Form.cpp:165
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
Field(const String &label)
Constructs a new field with a specific label.
Definition: Field.cpp:40
+
virtual void exitField()
Exits the field due to form navigation.
Definition: Field.cpp:129
+
virtual void updateCursor()
Updates the cursor position after the label has been drawn by setLabel().
Definition: Field.cpp:191
+
void removeField(Field *field)
Removes field from this form.
Definition: Form.cpp:187
+
void setLabel(const String &label)
Sets the label to display in the first line of this field.
Definition: Field.cpp:146
+
~Field()
Destroys this field and removes it from its owning Form.
Definition: Field.cpp:66
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
Field * currentField() const
Returns the current field that is displayed on-screen.
Definition: Form.h:46
+
+ + + + diff --git a/html/Field_8h_source.html b/html/Field_8h_source.html new file mode 100644 index 00000000..d4371255 --- /dev/null +++ b/html/Field_8h_source.html @@ -0,0 +1,172 @@ + + + + + + +ArduinoLibs: Field.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Field.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Field_h
+
24 #define Field_h
+
25 
+
26 #include "Form.h"
+
27 
+
28 class Field {
+
29 public:
+
30  explicit Field(const String &label);
+
31  Field(Form &form, const String &label);
+
32  ~Field();
+
33 
+
34  Form *form() const { return _form; }
+
35 
+
36  virtual int dispatch(int event);
+
37 
+
38  virtual void enterField(bool reverse);
+
39  virtual void exitField();
+
40 
+
41  const String &label() const { return _label; }
+
42  void setLabel(const String &label);
+
43 
+
44  bool isCurrent() const;
+
45 
+
46 protected:
+
47  LiquidCrystal *lcd() const { return _form->_lcd; }
+
48 
+
49  virtual void updateCursor();
+
50 
+
51 private:
+
52  String _label;
+
53  Form *_form;
+
54  Field *next;
+
55  Field *prev;
+
56 
+
57  friend class Form;
+
58 };
+
59 
+
60 #endif
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
virtual int dispatch(int event)
Dispatches event via this field.
Definition: Field.cpp:96
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
Field(const String &label)
Constructs a new field with a specific label.
Definition: Field.cpp:40
+
virtual void exitField()
Exits the field due to form navigation.
Definition: Field.cpp:129
+
virtual void updateCursor()
Updates the cursor position after the label has been drawn by setLabel().
Definition: Field.cpp:191
+
void setLabel(const String &label)
Sets the label to display in the first line of this field.
Definition: Field.cpp:146
+
~Field()
Destroys this field and removes it from its owning Form.
Definition: Field.cpp:66
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
+ + + + diff --git a/html/FormBool.png b/html/FormBool.png new file mode 100644 index 00000000..7449a3cb Binary files /dev/null and b/html/FormBool.png differ diff --git a/html/FormInt.png b/html/FormInt.png new file mode 100644 index 00000000..2fc9b6b1 Binary files /dev/null and b/html/FormInt.png differ diff --git a/html/FormText.png b/html/FormText.png new file mode 100644 index 00000000..cb018bcf Binary files /dev/null and b/html/FormText.png differ diff --git a/html/FormTimeRO.png b/html/FormTimeRO.png new file mode 100644 index 00000000..e99c7b9a Binary files /dev/null and b/html/FormTimeRO.png differ diff --git a/html/FormTimeRW.png b/html/FormTimeRW.png new file mode 100644 index 00000000..679c01ce Binary files /dev/null and b/html/FormTimeRW.png differ diff --git a/html/Form_8cpp_source.html b/html/Form_8cpp_source.html new file mode 100644 index 00000000..277e056f --- /dev/null +++ b/html/Form_8cpp_source.html @@ -0,0 +1,286 @@ + + + + + + +ArduinoLibs: Form.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Form.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Form.h"
+
24 #include "Field.h"
+
25 
+
47 Form::Form(LiquidCrystal &lcd)
+
48  : _lcd(&lcd)
+
49  , first(0)
+
50  , last(0)
+
51  , current(0)
+
52 {
+
53 }
+
54 
+ +
59 {
+
60  Field *field = first;
+
61  Field *next;
+
62  while (field != 0) {
+
63  next = field->next;
+
64  field->_form = 0;
+
65  field->next = 0;
+
66  field->prev = 0;
+
67  field = next;
+
68  }
+
69 }
+
70 
+
99 int Form::dispatch(int event)
+
100 {
+
101  if (current) {
+
102  int exitval = current->dispatch(event);
+
103  if (exitval >= 0)
+
104  return exitval;
+
105  }
+
106  if (event == LCD_BUTTON_LEFT)
+
107  prevField();
+
108  else if (event == LCD_BUTTON_RIGHT)
+
109  nextField();
+
110  return 0;
+
111 }
+
112 
+ +
119 {
+
120  Field *field = current;
+
121  if (!field)
+
122  field = first;
+
123  if (field && field->next)
+
124  field = field->next;
+
125  else
+
126  field = first;
+
127  setCurrentField(field);
+
128 }
+
129 
+ +
136 {
+
137  Field *field = current;
+
138  if (!field)
+
139  field = last;
+
140  if (field && field->prev)
+
141  field = field->prev;
+
142  else
+
143  field = last;
+
144  setCurrentField(field);
+
145 }
+
146 
+ +
153 {
+
154  setCurrentField(first);
+
155 }
+
156 
+
165 void Form::addField(Field *field)
+
166 {
+
167  if (field->_form)
+
168  return; // Already added to a form.
+
169  field->_form = this;
+
170  field->next = 0;
+
171  field->prev = last;
+
172  if (last)
+
173  last->next = field;
+
174  else
+
175  first = field;
+
176  last = field;
+
177 }
+
178 
+ +
188 {
+
189  if (field->_form != this)
+
190  return; // Not a member of this form.
+
191  if (current == field) {
+
192  if (field->next)
+
193  setCurrentField(field->next);
+
194  else if (field->prev)
+
195  setCurrentField(field->prev);
+
196  else
+
197  setCurrentField(0);
+
198  }
+
199  if (field->next)
+
200  field->next->prev = field->prev;
+
201  else
+
202  last = field->prev;
+
203  if (field->prev)
+
204  field->prev->next = field->next;
+
205  else
+
206  first = field->next;
+
207  field->_form = 0;
+
208  field->next = 0;
+
209  field->prev = 0;
+
210 }
+
211 
+ +
231 {
+
232  if (field && field->_form != this)
+
233  return; // Wrong form.
+
234  if (visible) {
+
235  bool reverse = false;
+
236  if (current) {
+
237  current->exitField();
+
238  if (field->next == current)
+
239  reverse = true;
+
240  else if (!field->next && current == first)
+
241  reverse = true;
+
242  }
+
243  current = field;
+
244  _lcd->clear();
+
245  if (current)
+
246  current->enterField(reverse);
+
247  } else {
+
248  current = field;
+
249  }
+
250 }
+
251 
+ +
275 {
+
276  if (!visible) {
+
277  if (!current)
+
278  current = first;
+
279  visible = true;
+
280  _lcd->clear();
+
281  if (current)
+
282  current->enterField(false);
+
283  }
+
284 }
+
285 
+ +
294 {
+
295  if (visible) {
+
296  if (current)
+
297  current->exitField();
+
298  visible = false;
+
299  _lcd->clear();
+
300  }
+
301 }
+
302 
+
Form(LiquidCrystal &lcd)
Constructs a new form and associates it with lcd.
Definition: Form.cpp:47
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
int dispatch(int event)
Dispatches event to the currently active field using Field::dispatch().
Definition: Form.cpp:99
+
void nextField()
Changes to the next field in the "tab order".
Definition: Form.cpp:118
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
virtual int dispatch(int event)
Dispatches event via this field.
Definition: Field.cpp:96
+
void addField(Field *field)
Adds field to this form.
Definition: Form.cpp:165
+
void hide()
Hides the form, or does nothing if the form is not on-screen.
Definition: Form.cpp:293
+
virtual void exitField()
Exits the field due to form navigation.
Definition: Field.cpp:129
+
void removeField(Field *field)
Removes field from this form.
Definition: Form.cpp:187
+
void setCurrentField(Field *field)
Sets the current field that is displayed on-screen.
Definition: Form.cpp:230
+
~Form()
Detaches all remaining fields and destroys this form.
Definition: Form.cpp:58
+
void show()
Shows the form, or does nothing if the form is already on-screen.
Definition: Form.cpp:274
+
void defaultField()
Changes to default field (i.e., the first field).
Definition: Form.cpp:152
+
void prevField()
Changes to the previous field in the "tab order".
Definition: Form.cpp:135
+
+ + + + diff --git a/html/Form_8h_source.html b/html/Form_8h_source.html new file mode 100644 index 00000000..db308ea9 --- /dev/null +++ b/html/Form_8h_source.html @@ -0,0 +1,180 @@ + + + + + + +ArduinoLibs: Form.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Form.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Form_h
+
24 #define Form_h
+
25 
+
26 #include "LCD.h"
+
27 
+
28 class Field;
+
29 
+
30 #define FORM_CHANGED 1
+
31 
+
32 class Form {
+
33 public:
+
34  explicit Form(LiquidCrystal &lcd);
+
35  ~Form();
+
36 
+
37  int dispatch(int event);
+
38 
+
39  void nextField();
+
40  void prevField();
+
41  void defaultField();
+
42 
+
43  void addField(Field *field);
+
44  void removeField(Field *field);
+
45 
+
46  Field *currentField() const { return current; }
+
47  void setCurrentField(Field *field);
+
48 
+
49  bool isCurrent(Field &field) const { return current == &field; }
+
50 
+
51  void show();
+
52  void hide();
+
53  bool isVisible() const { return visible; }
+
54 
+
55 private:
+
56  LiquidCrystal *_lcd;
+
57  Field *first;
+
58  Field *last;
+
59  Field *current;
+
60  bool visible;
+
61 
+
62  friend class Field;
+
63 };
+
64 
+
65 #endif
+
bool isVisible() const
Returns true if the form is shown; false if the form is hidden.
Definition: Form.h:53
+
Form(LiquidCrystal &lcd)
Constructs a new form and associates it with lcd.
Definition: Form.cpp:47
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
int dispatch(int event)
Dispatches event to the currently active field using Field::dispatch().
Definition: Form.cpp:99
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
void nextField()
Changes to the next field in the "tab order".
Definition: Form.cpp:118
+
void addField(Field *field)
Adds field to this form.
Definition: Form.cpp:165
+
void hide()
Hides the form, or does nothing if the form is not on-screen.
Definition: Form.cpp:293
+
void removeField(Field *field)
Removes field from this form.
Definition: Form.cpp:187
+
void setCurrentField(Field *field)
Sets the current field that is displayed on-screen.
Definition: Form.cpp:230
+
~Form()
Detaches all remaining fields and destroys this form.
Definition: Form.cpp:58
+
void show()
Shows the form, or does nothing if the form is already on-screen.
Definition: Form.cpp:274
+
void defaultField()
Changes to default field (i.e., the first field).
Definition: Form.cpp:152
+
bool isCurrent(Field &field) const
Returns true if field is currently displayed on-screen, false otherwise.
Definition: Form.h:49
+
void prevField()
Changes to the previous field in the "tab order".
Definition: Form.cpp:135
+
Field * currentField() const
Returns the current field that is displayed on-screen.
Definition: Form.h:46
+
+ + + + diff --git a/html/Hash_8cpp_source.html b/html/Hash_8cpp_source.html new file mode 100644 index 00000000..8b2ddb60 --- /dev/null +++ b/html/Hash_8cpp_source.html @@ -0,0 +1,159 @@ + + + + + + +ArduinoLibs: Hash.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Hash.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Hash.h"
+
24 #include <string.h>
+
25 
+ +
37 {
+
38 }
+
39 
+ +
49 {
+
50 }
+
51 
+
162 void Hash::formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
+
163 {
+
164  size_t size = blockSize();
+
165  reset();
+
166  if (len <= size) {
+
167  memcpy(block, key, len);
+
168  } else {
+
169  update(key, len);
+
170  len = hashSize();
+
171  finalize(block, len);
+
172  reset();
+
173  }
+
174  memset(block + len, pad, size - len);
+
175  uint8_t *b = (uint8_t *)block;
+
176  while (len > 0) {
+
177  *b++ ^= pad;
+
178  --len;
+
179  }
+
180 }
+
virtual size_t blockSize() const =0
Size of the internal block used by the hash algorithm.
+
Hash()
Constructs a new hash object.
Definition: Hash.cpp:36
+
virtual void reset()=0
Resets the hash ready for a new hashing process.
+
virtual size_t hashSize() const =0
Size of the hash result from finalize().
+
virtual ~Hash()
Destroys this hash object.
Definition: Hash.cpp:48
+
virtual void update(const void *data, size_t len)=0
Updates the hash with more data.
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
virtual void finalize(void *hash, size_t len)=0
Finalizes the hashing process and returns the hash.
+
+ + + + diff --git a/html/Hash_8h_source.html b/html/Hash_8h_source.html new file mode 100644 index 00000000..20ac38f9 --- /dev/null +++ b/html/Hash_8h_source.html @@ -0,0 +1,162 @@ + + + + + + +ArduinoLibs: Hash.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Hash.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_HASH_h
+
24 #define CRYPTO_HASH_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 class Hash
+
30 {
+
31 public:
+
32  Hash();
+
33  virtual ~Hash();
+
34 
+
35  virtual size_t hashSize() const = 0;
+
36  virtual size_t blockSize() const = 0;
+
37 
+
38  virtual void reset() = 0;
+
39  virtual void update(const void *data, size_t len) = 0;
+
40  virtual void finalize(void *hash, size_t len) = 0;
+
41 
+
42  virtual void clear() = 0;
+
43 
+
44  virtual void resetHMAC(const void *key, size_t keyLen) = 0;
+
45  virtual void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen) = 0;
+
46 
+
47 protected:
+
48  void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad);
+
49 };
+
50 
+
51 #endif
+
virtual size_t blockSize() const =0
Size of the internal block used by the hash algorithm.
+
virtual void clear()=0
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
+
Hash()
Constructs a new hash object.
Definition: Hash.cpp:36
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
virtual void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)=0
Finalizes the HMAC hashing process and returns the hash.
+
virtual void reset()=0
Resets the hash ready for a new hashing process.
+
virtual void resetHMAC(const void *key, size_t keyLen)=0
Resets the hash ready for a new HMAC hashing process.
+
virtual size_t hashSize() const =0
Size of the hash result from finalize().
+
virtual ~Hash()
Destroys this hash object.
Definition: Hash.cpp:48
+
virtual void update(const void *data, size_t len)=0
Updates the hash with more data.
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
virtual void finalize(void *hash, size_t len)=0
Finalizes the hashing process and returns the hash.
+
+ + + + diff --git a/html/HelloWorld.png b/html/HelloWorld.png new file mode 100644 index 00000000..29ddaa52 Binary files /dev/null and b/html/HelloWorld.png differ diff --git a/html/I2CMaster_8cpp_source.html b/html/I2CMaster_8cpp_source.html new file mode 100644 index 00000000..216f2ec9 --- /dev/null +++ b/html/I2CMaster_8cpp_source.html @@ -0,0 +1,123 @@ + + + + + + +ArduinoLibs: I2CMaster.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
I2CMaster.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "I2CMaster.h"
+
24 
+
+ + + + diff --git a/html/I2CMaster_8h_source.html b/html/I2CMaster_8h_source.html new file mode 100644 index 00000000..59aa5943 --- /dev/null +++ b/html/I2CMaster_8h_source.html @@ -0,0 +1,148 @@ + + + + + + +ArduinoLibs: I2CMaster.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
I2CMaster.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef I2CMaster_h
+
24 #define I2CMaster_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class I2CMaster {
+
29 public:
+
30  virtual unsigned int maxTransferSize() const = 0;
+
31 
+
32  virtual void startWrite(unsigned int address);
+
33  virtual void write(uint8_t value) = 0;
+
34  virtual bool endWrite() = 0;
+
35 
+
36  virtual bool startRead(unsigned int address, unsigned int count) = 0;
+
37  virtual unsigned int available() = 0;
+
38  virtual uint8_t read() = 0;
+
39 };
+
40 
+
41 #endif
+
virtual void write(uint8_t value)=0
Writes a single byte value on the I2C bus.
+
virtual bool startRead(unsigned int address, unsigned int count)=0
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
+
virtual unsigned int maxTransferSize() const =0
Returns the maximum number of bytes that can be read or written in a single request by this bus maste...
+
virtual unsigned int available()=0
Returns the number of bytes that are still available for reading.
+
virtual void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
+
virtual bool endWrite()=0
Ends the current write operation.
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
virtual uint8_t read()=0
Reads a single byte from the I2C bus.
+
+ + + + diff --git a/html/IRreceiver_8cpp_source.html b/html/IRreceiver_8cpp_source.html new file mode 100644 index 00000000..63c48845 --- /dev/null +++ b/html/IRreceiver_8cpp_source.html @@ -0,0 +1,269 @@ + + + + + + +ArduinoLibs: IRreceiver.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
IRreceiver.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "IRreceiver.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
159 static IRreceiver *receiver = 0;
+
160 
+
161 void _IR_receive_interrupt(void)
+
162 {
+
163  receiver->handleInterrupt();
+
164 }
+
165 
+
176 IRreceiver::IRreceiver(int interruptNumber)
+
177  : _system(0)
+
178  , _systemFilter(-1)
+
179  , started(false)
+
180  , halfChange(false)
+
181  , lastChange(0)
+
182  , bits(0)
+
183  , bitCount(0)
+
184  , buffer(0)
+
185  , lastBuffer(0)
+
186 {
+
187  switch (interruptNumber) {
+
188  case 0: default: pin = 2; break;
+
189  case 1: pin = 3; break;
+
190  case 2: pin = 21; break; // Arduino Mega only
+
191  case 3: pin = 20; break; // Arduino Mega only
+
192  case 4: pin = 19; break; // Arduino Mega only
+
193  case 5: pin = 18; break; // Arduino Mega only
+
194  }
+
195  receiver = this;
+
196  attachInterrupt(interruptNumber, _IR_receive_interrupt, CHANGE);
+
197 }
+
198 
+ +
221 {
+
222  unsigned buf;
+
223 
+
224  // Read the last-delivered sequence from the buffer and clear it.
+
225  cli();
+
226  buf = buffer;
+
227  buffer = 0;
+
228  sei();
+
229 
+
230  // Bail out if no sequence or it is not for us.
+
231  if (!buf) {
+
232  _system = -1;
+
233  return -1;
+
234  }
+
235  if (_systemFilter != -1) {
+
236  if (((buf >> 6) & 0x1F) != _systemFilter) {
+
237  _system = -1;
+
238  return -1;
+
239  }
+
240  }
+
241 
+
242  // Extract the command.
+
243  int cmd = buf & 0x3F;
+
244  if ((buf & 0x1000) == 0)
+
245  cmd += 64;
+
246 
+
247  // Is this a new command or an auto-repeat of the previous command?
+
248  // Bit 11 will toggle whenever a new button press is started.
+
249  if (lastBuffer == buf)
+
250  cmd += AUTO_REPEAT;
+
251  else
+
252  lastBuffer = buf;
+
253  _system = (buf >> 6) & 0x1F;
+
254  return cmd;
+
255 }
+
256 
+
304 // Number of microseconds that the signal is HIGH or LOW for
+
305 // indicating a bit. A 1 bit is transmitted as LOW for 889us
+
306 // followed by HIGH for 889us. A 0 bit is HIGH, then LOW.
+
307 #define IR_BIT_TIME 889
+
308 
+
309 // Number of microseconds to detect a long gap in the coding
+
310 // corresponding to 2 time units HIGH or LOW. We actually check
+
311 // for at least 1.5 time units to allow for slight variations
+
312 // in timing on different remote controls.
+
313 #define IR_LONG_BIT_TIME (889 * 6 / 4)
+
314 
+
315 // Maximum timeout for a single bit. If we don't see a rising edge
+
316 // within this time, then we have lost sync and need to restart.
+
317 #define IR_MAX_TIME (IR_BIT_TIME * 4)
+
318 
+
319 // Protocol details from http://en.wikipedia.org/wiki/RC-5
+
320 void IRreceiver::handleInterrupt()
+
321 {
+
322  bool value = digitalRead(pin);
+
323  unsigned long currentTime = micros();
+
324  if (!value) {
+
325  // Rising edge (input is active-LOW)
+
326  if (started && (currentTime - lastChange) > IR_MAX_TIME) {
+
327  // Too long since the last received bit, so restart the process.
+
328  started = false;
+
329  }
+
330  if (started) {
+
331  // We recognize bits on the falling edges, so merely
+
332  // adjust the "changed at last half-cycle" flag.
+
333  if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
+
334  // Long time since last falling edge indicates that the
+
335  // next bit will definitely be a 1.
+
336  halfChange = true;
+
337  } else {
+
338  halfChange = !halfChange;
+
339  }
+
340  lastChange = currentTime;
+
341  } else {
+
342  // Encountered the start bit - start receiving up to 14 bits.
+
343  lastChange = currentTime;
+
344  started = true;
+
345  halfChange = true;
+
346  bits = 0;
+
347  bitCount = 14;
+
348  }
+
349  } else if (started) {
+
350  // Falling edge
+
351  if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
+
352  // Long time since last rise indicates 1 followed by 0.
+
353  bits = (bits << 2) | 0x02;
+
354  --bitCount;
+
355  halfChange = true;
+
356  } else if (halfChange) {
+
357  // Rise was halfway through, so falling edge indicates a 1.
+
358  bits = (bits << 1) | 0x01;
+
359  halfChange = false;
+
360  } else {
+
361  // Rise was at the start, so falling edge indicates a 0.
+
362  bits <<= 1;
+
363  halfChange = true;
+
364  }
+
365  lastChange = currentTime;
+
366  --bitCount;
+
367  if (bitCount <= 0) {
+
368  // All 14 bits have been received, so deliver the value.
+
369  started = false;
+
370  buffer = bits;
+
371  }
+
372  }
+
373 }
+
IRreceiver(int interruptNumber=0)
Constructs a new infrared remote control receiver that is attached to interruptNumber.
Definition: IRreceiver.cpp:176
+
Manages the reception of RC-5 commands from an infrared remote control.
Definition: IRreceiver.h:29
+
int command()
Returns the next command from the remote control.
Definition: IRreceiver.cpp:220
+
static const int AUTO_REPEAT
Flag that is added to the output of command() when the command is an auto-repeated button press rathe...
Definition: IRreceiver.h:34
+
+ + + + diff --git a/html/IRreceiver_8h_source.html b/html/IRreceiver_8h_source.html new file mode 100644 index 00000000..988413c7 --- /dev/null +++ b/html/IRreceiver_8h_source.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: IRreceiver.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
IRreceiver.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef IRreceiver_h
+
24 #define IRreceiver_h
+
25 
+
26 #include <inttypes.h>
+
27 #include "RC5.h"
+
28 
+ +
30 {
+
31 public:
+
32  explicit IRreceiver(int interruptNumber = 0);
+
33 
+
34  static const int AUTO_REPEAT = 128;
+
35 
+
36  int command();
+
37  int system() const { return _system; }
+
38 
+
39  int systemFilter() const { return _systemFilter; }
+
40  void setSystemFilter(int system) { _systemFilter = system; }
+
41 
+
42 private:
+
43  int _system;
+
44  int _systemFilter;
+
45  uint8_t pin;
+
46  bool started;
+
47  bool halfChange; // Value last changed half-way through bit cycle time.
+
48  unsigned long lastChange;
+
49  unsigned bits;
+
50  int8_t bitCount;
+
51  volatile unsigned buffer;
+
52  unsigned lastBuffer;
+
53 
+
54  void handleInterrupt();
+
55 
+
56  friend void _IR_receive_interrupt(void);
+
57 };
+
58 
+
59 #endif
+
int system() const
Returns the system number of the previous command(), indicating whether the command was for a TV...
Definition: IRreceiver.h:37
+
IRreceiver(int interruptNumber=0)
Constructs a new infrared remote control receiver that is attached to interruptNumber.
Definition: IRreceiver.cpp:176
+
Manages the reception of RC-5 commands from an infrared remote control.
Definition: IRreceiver.h:29
+
int command()
Returns the next command from the remote control.
Definition: IRreceiver.cpp:220
+
void setSystemFilter(int system)
Sets the system to filter commands against, or -1 to turn off the system filter.
Definition: IRreceiver.h:40
+
static const int AUTO_REPEAT
Flag that is added to the output of command() when the command is an auto-repeated button press rathe...
Definition: IRreceiver.h:34
+
int systemFilter() const
Returns the system to filter commands against, or -1 if no filter is set.
Definition: IRreceiver.h:39
+
+ + + + diff --git a/html/IntField_8cpp_source.html b/html/IntField_8cpp_source.html new file mode 100644 index 00000000..f3c32805 --- /dev/null +++ b/html/IntField_8cpp_source.html @@ -0,0 +1,216 @@ + + + + + + +ArduinoLibs: IntField.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
IntField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "IntField.h"
+
24 
+
71 IntField::IntField(const String &label)
+
72  : Field(label)
+
73  , _minValue(0)
+
74  , _maxValue(100)
+
75  , _stepValue(1)
+
76  , _value(0)
+
77  , _printLen(0)
+
78 {
+
79 }
+
80 
+
88 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
+
89  : Field(form, label)
+
90  , _minValue(minValue)
+
91  , _maxValue(maxValue)
+
92  , _stepValue(stepValue)
+
93  , _value(value)
+
94  , _printLen(0)
+
95 {
+
96 }
+
97 
+
103 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
+
104  : Field(form, label)
+
105  , _minValue(minValue)
+
106  , _maxValue(maxValue)
+
107  , _stepValue(stepValue)
+
108  , _value(value)
+
109  , _printLen(0)
+
110  , _suffix(suffix)
+
111 {
+
112 }
+
113 
+
114 int IntField::dispatch(int event)
+
115 {
+
116  if (event == LCD_BUTTON_UP) {
+
117  setValue(_value + _stepValue);
+
118  return FORM_CHANGED;
+
119  } else if (event == LCD_BUTTON_DOWN) {
+
120  setValue(_value - _stepValue);
+
121  return FORM_CHANGED;
+
122  }
+
123  return -1;
+
124 }
+
125 
+
126 void IntField::enterField(bool reverse)
+
127 {
+
128  Field::enterField(reverse);
+
129  printValue();
+
130 }
+
131 
+
198 void IntField::setValue(int value)
+
199 {
+
200  if (value < _minValue)
+
201  value = _minValue;
+
202  else if (value > _maxValue)
+
203  value = _maxValue;
+
204  if (value != _value) {
+
205  _value = value;
+
206  if (isCurrent())
+
207  printValue();
+
208  }
+
209 }
+
210 
+
231 void IntField::setSuffix(const String &suffix)
+
232 {
+
233  _suffix = suffix;
+
234  if (isCurrent())
+
235  printValue();
+
236 }
+
237 
+
238 void IntField::printValue()
+
239 {
+
240  String str(_value);
+
241  if (_suffix.length())
+
242  str += _suffix;
+
243  lcd()->setCursor(0, 1);
+
244  lcd()->print(str);
+
245  unsigned int len = str.length();
+
246  while (len++ < _printLen)
+
247  lcd()->write(' ');
+
248  _printLen = str.length();
+
249 }
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
void setValue(int value)
Sets the current value of this field.
Definition: IntField.cpp:198
+
int dispatch(int event)
Dispatches event via this field.
Definition: IntField.cpp:114
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
const String & suffix() const
Returns the suffix string to be displayed after the field's value.
Definition: IntField.h:50
+
int value() const
Returns the current value of this field.
Definition: IntField.h:47
+
IntField(const String &label)
Constructs a new integer field with a specific label.
Definition: IntField.cpp:71
+
void setSuffix(const String &suffix)
Sets the suffix string to be displayed after the field's value.
Definition: IntField.cpp:231
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: IntField.cpp:126
+
+ + + + diff --git a/html/IntField_8h_source.html b/html/IntField_8h_source.html new file mode 100644 index 00000000..4fcee9f9 --- /dev/null +++ b/html/IntField_8h_source.html @@ -0,0 +1,181 @@ + + + + + + +ArduinoLibs: IntField.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
IntField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef IntField_h
+
24 #define IntField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class IntField : public Field {
+
29 public:
+
30  explicit IntField(const String &label);
+
31  IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value);
+
32  IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix);
+
33 
+
34  int dispatch(int event);
+
35 
+
36  void enterField(bool reverse);
+
37 
+
38  int minValue() const { return _minValue; }
+
39  void setMinValue(int value) { _minValue = value; }
+
40 
+
41  int maxValue() const { return _maxValue; }
+
42  void setMaxValue(int value) { _maxValue = value; }
+
43 
+
44  int stepValue() const { return _stepValue; }
+
45  void setStepValue(int value) { _stepValue = value; }
+
46 
+
47  int value() const { return _value; }
+
48  void setValue(int value);
+
49 
+
50  const String &suffix() const { return _suffix; }
+
51  void setSuffix(const String &suffix);
+
52 
+
53 private:
+
54  int _minValue;
+
55  int _maxValue;
+
56  int _stepValue;
+
57  int _value;
+
58  int _printLen;
+
59  String _suffix;
+
60 
+
61  void printValue();
+
62 };
+
63 
+
64 #endif
+
Field that manages the input of an integer value.
Definition: IntField.h:28
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
void setValue(int value)
Sets the current value of this field.
Definition: IntField.cpp:198
+
int minValue() const
Returns the minimum value for the input field.
Definition: IntField.h:38
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
int dispatch(int event)
Dispatches event via this field.
Definition: IntField.cpp:114
+
void setMinValue(int value)
Sets the minimum value for the input field.
Definition: IntField.h:39
+
const String & suffix() const
Returns the suffix string to be displayed after the field's value.
Definition: IntField.h:50
+
int stepValue() const
Returns the step value to use when increasing or decreasing the value() due to Up and Down button pre...
Definition: IntField.h:44
+
int value() const
Returns the current value of this field.
Definition: IntField.h:47
+
void setMaxValue(int value)
Sets the maximum value for the input field.
Definition: IntField.h:42
+
IntField(const String &label)
Constructs a new integer field with a specific label.
Definition: IntField.cpp:71
+
int maxValue() const
Returns the maximum value for the input field.
Definition: IntField.h:41
+
void setStepValue(int value)
Sets the step value value to use when increasing or decreasing the value() due to Up and Down button ...
Definition: IntField.h:45
+
void setSuffix(const String &suffix)
Sets the suffix string to be displayed after the field's value.
Definition: IntField.cpp:231
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: IntField.cpp:126
+
+ + + + diff --git a/html/KeccakCore_8cpp_source.html b/html/KeccakCore_8cpp_source.html new file mode 100644 index 00000000..56c53a18 --- /dev/null +++ b/html/KeccakCore_8cpp_source.html @@ -0,0 +1,366 @@ + + + + + + +ArduinoLibs: KeccakCore.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
KeccakCore.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "KeccakCore.h"
+
24 #include "Crypto.h"
+
25 #include "utility/EndianUtil.h"
+
26 #include "utility/RotateUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+ +
50  : _blockSize(8)
+
51 {
+
52  memset(state.A, 0, sizeof(state.A));
+
53  state.inputSize = 0;
+
54  state.outputSize = 0;
+
55 }
+
56 
+ +
62 {
+
63  clean(state);
+
64 }
+
65 
+
71 size_t KeccakCore::capacity() const
+
72 {
+
73  return 1600 - ((size_t)_blockSize) * 8;
+
74 }
+
75 
+
89 void KeccakCore::setCapacity(size_t capacity)
+
90 {
+
91  _blockSize = (1600 - capacity) / 8;
+
92  reset();
+
93 }
+
94 
+ +
110 {
+
111  memset(state.A, 0, sizeof(state.A));
+
112  state.inputSize = 0;
+
113  state.outputSize = 0;
+
114 }
+
115 
+
128 void KeccakCore::update(const void *data, size_t size)
+
129 {
+
130  // Stop generating output while we incorporate the new data.
+
131  state.outputSize = 0;
+
132 
+
133  // Break the input up into chunks and process each in turn.
+
134  const uint8_t *d = (const uint8_t *)data;
+
135 #if !defined(CRYPTO_LITTLE_ENDIAN)
+
136  uint64_t *Awords = &(state.A[0][0]);
+
137  uint8_t index, index2;
+
138 #endif
+
139  while (size > 0) {
+
140  uint8_t len = _blockSize - state.inputSize;
+
141  if (len > size)
+
142  len = size;
+
143 #if defined(CRYPTO_LITTLE_ENDIAN)
+
144  uint8_t *Abytes = ((uint8_t *)state.A) + state.inputSize;
+
145  for (uint8_t posn = 0; posn < len; ++posn)
+
146  Abytes[posn] ^= d[posn];
+
147 #else
+
148  index2 = state.inputSize;
+
149  for (index = 0; index < len; ++index) {
+
150  Awords[index2 / 8] ^= (((uint64_t)d[index]) << ((index2 % 8) * 8));
+
151  ++index2;
+
152  }
+
153 #endif
+
154  state.inputSize += len;
+
155  size -= len;
+
156  d += len;
+
157  if (state.inputSize == _blockSize) {
+
158  keccakp();
+
159  state.inputSize = 0;
+
160  }
+
161  }
+
162 }
+
163 
+
174 void KeccakCore::pad(uint8_t tag)
+
175 {
+
176  // Padding for SHA3-NNN variants according to FIPS 202 appends "01",
+
177  // then another "1", then many zero bits, followed by a final "1".
+
178  // SHAKE appends "1111" first instead of "01". Note that SHA-3 numbers
+
179  // bits from the least significant, so appending "01" is equivalent
+
180  // to 0x02 for byte-aligned data, not 0x40.
+
181  uint8_t size = state.inputSize;
+
182  uint64_t *Awords = &(state.A[0][0]);
+
183  Awords[size / 8] ^= (((uint64_t)tag) << ((size % 8) * 8));
+
184  Awords[(_blockSize - 1) / 8] ^= 0x8000000000000000ULL;
+
185  keccakp();
+
186  state.inputSize = 0;
+
187  state.outputSize = 0;
+
188 }
+
189 
+
201 void KeccakCore::extract(void *data, size_t size)
+
202 {
+
203 #if !defined(CRYPTO_LITTLE_ENDIAN)
+
204  uint8_t index, index2;
+
205  const uint64_t *Awords = &(state.A[0][0]);
+
206 #endif
+
207 
+
208  // Stop accepting input while we are generating output.
+
209  state.inputSize = 0;
+
210 
+
211  // Copy the output data into the caller's return buffer.
+
212  uint8_t *d = (uint8_t *)data;
+
213  uint8_t tempSize;
+
214  while (size > 0) {
+
215  // Generate another output block if the current one has been exhausted.
+
216  if (state.outputSize >= _blockSize) {
+
217  keccakp();
+
218  state.outputSize = 0;
+
219  }
+
220 
+
221  // How many bytes can we copy this time around?
+
222  tempSize = _blockSize - state.outputSize;
+
223  if (tempSize > size)
+
224  tempSize = size;
+
225 
+
226  // Copy the partial output data into the caller's return buffer.
+
227 #if defined(CRYPTO_LITTLE_ENDIAN)
+
228  memcpy(d, ((uint8_t *)(state.A)) + state.outputSize, tempSize);
+
229 #else
+
230  index2 = state.outputSize;
+
231  for (index = 0; index < tempSize; ++index) {
+
232  d[index] = (uint8_t)(Awords[index2 / 8] >> ((index2 % 8) * 8));
+
233  ++index2;
+
234  }
+
235 #endif
+
236  state.outputSize += tempSize;
+
237  size -= tempSize;
+
238  d += tempSize;
+
239  }
+
240 }
+
241 
+ +
246 {
+
247  clean(state);
+
248 }
+
249 
+
263 void KeccakCore::setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize)
+
264 {
+
265  uint8_t *b = (uint8_t *)state.B;
+
266  size_t size = blockSize();
+
267  reset();
+
268  if (len <= size) {
+
269  memcpy(b, key, len);
+
270  } else {
+
271  update(key, len);
+
272  this->pad(0x06);
+
273  extract(b, hashSize);
+
274  len = hashSize;
+
275  reset();
+
276  }
+
277  memset(b + len, pad, size - len);
+
278  while (len > 0) {
+
279  *b++ ^= pad;
+
280  --len;
+
281  }
+
282  update(state.B, size);
+
283 }
+
284 
+
288 void KeccakCore::keccakp()
+
289 {
+
290  static const uint8_t addMod5Table[9] PROGMEM = {
+
291  0, 1, 2, 3, 4, 0, 1, 2, 3
+
292  };
+
293  #define addMod5(x, y) (pgm_read_byte(&(addMod5Table[(x) + (y)])))
+
294  uint64_t D;
+
295  uint8_t index, index2;
+
296  for (uint8_t round = 0; round < 24; ++round) {
+
297  // Step mapping theta. The specification mentions two temporary
+
298  // arrays of size 5 called C and D. To save a bit of memory,
+
299  // we use the first row of B to store C and compute D on the fly.
+
300  for (index = 0; index < 5; ++index) {
+
301  state.B[0][index] = state.A[0][index] ^ state.A[1][index] ^
+
302  state.A[2][index] ^ state.A[3][index] ^
+
303  state.A[4][index];
+
304  }
+
305  for (index = 0; index < 5; ++index) {
+
306  D = state.B[0][addMod5(index, 4)] ^
+
307  leftRotate1_64(state.B[0][addMod5(index, 1)]);
+
308  for (index2 = 0; index2 < 5; ++index2)
+
309  state.A[index2][index] ^= D;
+
310  }
+
311 
+
312  // Step mapping rho and pi combined into a single step.
+
313  // Rotate all lanes by a specific offset and rearrange.
+
314  state.B[0][0] = state.A[0][0];
+
315  state.B[1][0] = leftRotate28_64(state.A[0][3]);
+
316  state.B[2][0] = leftRotate1_64 (state.A[0][1]);
+
317  state.B[3][0] = leftRotate27_64(state.A[0][4]);
+
318  state.B[4][0] = leftRotate62_64(state.A[0][2]);
+
319  state.B[0][1] = leftRotate44_64(state.A[1][1]);
+
320  state.B[1][1] = leftRotate20_64(state.A[1][4]);
+
321  state.B[2][1] = leftRotate6_64 (state.A[1][2]);
+
322  state.B[3][1] = leftRotate36_64(state.A[1][0]);
+
323  state.B[4][1] = leftRotate55_64(state.A[1][3]);
+
324  state.B[0][2] = leftRotate43_64(state.A[2][2]);
+
325  state.B[1][2] = leftRotate3_64 (state.A[2][0]);
+
326  state.B[2][2] = leftRotate25_64(state.A[2][3]);
+
327  state.B[3][2] = leftRotate10_64(state.A[2][1]);
+
328  state.B[4][2] = leftRotate39_64(state.A[2][4]);
+
329  state.B[0][3] = leftRotate21_64(state.A[3][3]);
+
330  state.B[1][3] = leftRotate45_64(state.A[3][1]);
+
331  state.B[2][3] = leftRotate8_64 (state.A[3][4]);
+
332  state.B[3][3] = leftRotate15_64(state.A[3][2]);
+
333  state.B[4][3] = leftRotate41_64(state.A[3][0]);
+
334  state.B[0][4] = leftRotate14_64(state.A[4][4]);
+
335  state.B[1][4] = leftRotate61_64(state.A[4][2]);
+
336  state.B[2][4] = leftRotate18_64(state.A[4][0]);
+
337  state.B[3][4] = leftRotate56_64(state.A[4][3]);
+
338  state.B[4][4] = leftRotate2_64 (state.A[4][1]);
+
339 
+
340  // Step mapping chi. Combine each lane with two other lanes in its row.
+
341  for (index = 0; index < 5; ++index) {
+
342  for (index2 = 0; index2 < 5; ++index2) {
+
343  state.A[index2][index] =
+
344  state.B[index2][index] ^
+
345  ((~state.B[index2][addMod5(index, 1)]) &
+
346  state.B[index2][addMod5(index, 2)]);
+
347  }
+
348  }
+
349 
+
350  // Step mapping iota. XOR A[0][0] with the round constant.
+
351  static uint64_t const RC[24] PROGMEM = {
+
352  0x0000000000000001ULL, 0x0000000000008082ULL, 0x800000000000808AULL,
+
353  0x8000000080008000ULL, 0x000000000000808BULL, 0x0000000080000001ULL,
+
354  0x8000000080008081ULL, 0x8000000000008009ULL, 0x000000000000008AULL,
+
355  0x0000000000000088ULL, 0x0000000080008009ULL, 0x000000008000000AULL,
+
356  0x000000008000808BULL, 0x800000000000008BULL, 0x8000000000008089ULL,
+
357  0x8000000000008003ULL, 0x8000000000008002ULL, 0x8000000000000080ULL,
+
358  0x000000000000800AULL, 0x800000008000000AULL, 0x8000000080008081ULL,
+
359  0x8000000000008080ULL, 0x0000000080000001ULL, 0x8000000080008008ULL
+
360  };
+
361  state.A[0][0] ^= pgm_read_qword(RC + round);
+
362  }
+
363 }
+
size_t blockSize() const
Returns the input block size for the sponge function in bytes.
Definition: KeccakCore.h:38
+
void setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize)
Sets a HMAC key for a Keccak-based hash algorithm.
Definition: KeccakCore.cpp:263
+
void setCapacity(size_t capacity)
Sets the capacity of the Keccak sponge function in bits.
Definition: KeccakCore.cpp:89
+
~KeccakCore()
Destroys this Keccak sponge function after clearing all sensitive information.
Definition: KeccakCore.cpp:61
+
void extract(void *data, size_t size)
Extracts data from the Keccak sponge function.
Definition: KeccakCore.cpp:201
+
void pad(uint8_t tag)
Pads the last block of input data to blockSize().
Definition: KeccakCore.cpp:174
+
size_t capacity() const
Returns the capacity of the sponge function in bits.
Definition: KeccakCore.cpp:71
+
KeccakCore()
Constructs a new Keccak sponge function.
Definition: KeccakCore.cpp:49
+
void update(const void *data, size_t size)
Updates the Keccak sponge function with more input data.
Definition: KeccakCore.cpp:128
+
void clear()
Clears all sensitive data from this object.
Definition: KeccakCore.cpp:245
+
void reset()
Resets the Keccak sponge function ready for a new session.
Definition: KeccakCore.cpp:109
+
+ + + + diff --git a/html/KeccakCore_8h_source.html b/html/KeccakCore_8h_source.html new file mode 100644 index 00000000..ac3959bc --- /dev/null +++ b/html/KeccakCore_8h_source.html @@ -0,0 +1,174 @@ + + + + + + +ArduinoLibs: KeccakCore.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
KeccakCore.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_KECCAKCORE_H
+
24 #define CRYPTO_KECCAKCORE_H
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+ +
30 {
+
31 public:
+
32  KeccakCore();
+
33  ~KeccakCore();
+
34 
+
35  size_t capacity() const;
+
36  void setCapacity(size_t capacity);
+
37 
+
38  size_t blockSize() const { return _blockSize; }
+
39 
+
40  void reset();
+
41 
+
42  void update(const void *data, size_t size);
+
43  void pad(uint8_t tag);
+
44 
+
45  void extract(void *data, size_t size);
+
46 
+
47  void clear();
+
48 
+
49  void setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize);
+
50 
+
51 private:
+
52  struct {
+
53  uint64_t A[5][5];
+
54  uint64_t B[5][5];
+
55  uint8_t inputSize;
+
56  uint8_t outputSize;
+
57  } state;
+
58  uint8_t _blockSize;
+
59 
+
60  void keccakp();
+
61 };
+
62 
+
63 #endif
+
size_t blockSize() const
Returns the input block size for the sponge function in bytes.
Definition: KeccakCore.h:38
+
void setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize)
Sets a HMAC key for a Keccak-based hash algorithm.
Definition: KeccakCore.cpp:263
+
void setCapacity(size_t capacity)
Sets the capacity of the Keccak sponge function in bits.
Definition: KeccakCore.cpp:89
+
~KeccakCore()
Destroys this Keccak sponge function after clearing all sensitive information.
Definition: KeccakCore.cpp:61
+
void extract(void *data, size_t size)
Extracts data from the Keccak sponge function.
Definition: KeccakCore.cpp:201
+
void pad(uint8_t tag)
Pads the last block of input data to blockSize().
Definition: KeccakCore.cpp:174
+
size_t capacity() const
Returns the capacity of the sponge function in bits.
Definition: KeccakCore.cpp:71
+
KeccakCore()
Constructs a new Keccak sponge function.
Definition: KeccakCore.cpp:49
+
void update(const void *data, size_t size)
Updates the Keccak sponge function with more input data.
Definition: KeccakCore.cpp:128
+
void clear()
Clears all sensitive data from this object.
Definition: KeccakCore.cpp:245
+
void reset()
Resets the Keccak sponge function ready for a new session.
Definition: KeccakCore.cpp:109
+
Keccak core sponge function.
Definition: KeccakCore.h:29
+
+ + + + diff --git a/html/LCD_8cpp_source.html b/html/LCD_8cpp_source.html new file mode 100644 index 00000000..ffb4b2d9 --- /dev/null +++ b/html/LCD_8cpp_source.html @@ -0,0 +1,298 @@ + + + + + + +ArduinoLibs: LCD.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
LCD.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "LCD.h"
+
24 #include <avr/pgmspace.h>
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
31 #define LCD_BACK_LIGHT 3 // Default LCD backlight is on D3
+
32 #define LCD_BUTTON_PIN A0 // Button state is on A0
+
33 
+
34 #define DEBOUNCE_DELAY 10 // Delay in ms to debounce buttons
+
35 
+
145 void LCD::init()
+
146 {
+
147  // The Freetronics display is 16x2.
+
148  begin(16, 2);
+
149 
+
150  // Configure the backlight pin, but don't activate it yet in
+
151  // case the application sets it to something else during setup().
+
152  // Initialization will be forced in the first call to getButton().
+
153  _backlightPin = LCD_BACK_LIGHT;
+
154  backlightInit = false;
+
155 
+
156  // Initialise button input.
+
157  pinMode(LCD_BUTTON_PIN, INPUT);
+
158  digitalWrite(LCD_BUTTON_PIN, LOW);
+
159  prevButton = LCD_BUTTON_NONE;
+
160  debounceButton = LCD_BUTTON_NONE;
+
161  lastDebounce = 0;
+
162  eatRelease = false;
+
163 
+
164  // Initialize screen saver.
+
165  timeout = 0;
+
166  lastRestore = millis();
+
167  screenSaved = false;
+
168  mode = DisplayOff;
+
169 }
+
170 
+
197 void LCD::setBacklightPin(uint8_t pin)
+
198 {
+
199  if (_backlightPin != pin) {
+
200  if (backlightInit) {
+
201  // Restore the previous backlight pin to input, floating.
+
202  pinMode(_backlightPin, INPUT);
+
203  digitalWrite(_backlightPin, LOW);
+
204 
+
205  // Need to re-initialize the backlight at the earliest opportunity.
+
206  backlightInit = false;
+
207  }
+
208  _backlightPin = pin;
+
209  }
+
210 }
+
211 
+ +
222 {
+
223  LiquidCrystal::display();
+
224  pinMode(_backlightPin, OUTPUT);
+
225  digitalWrite(_backlightPin, HIGH);
+
226  screenSaved = false;
+
227  backlightInit = true;
+
228  lastRestore = millis();
+
229 }
+
230 
+ +
239 {
+
240  if (mode == DisplayOff)
+
241  LiquidCrystal::noDisplay();
+
242  pinMode(_backlightPin, OUTPUT);
+
243  digitalWrite(_backlightPin, LOW);
+
244  screenSaved = true;
+
245  backlightInit = true;
+
246 }
+
247 
+ +
284 {
+
285  if (this->mode != mode) {
+
286  this->mode = mode;
+
287  if (screenSaved)
+
288  noDisplay();
+
289  else
+
290  display();
+
291  }
+
292 }
+
293 
+
309 void LCD::enableScreenSaver(int timeoutSecs)
+
310 {
+
311  if (timeoutSecs < 0)
+
312  timeout = 0;
+
313  else
+
314  timeout = ((unsigned long)timeoutSecs) * 1000;
+
315  display();
+
316 }
+
317 
+ +
324 {
+
325  timeout = 0;
+
326  display();
+
327 }
+
328 
+
336 // Button mapping table generated by genlookup.c
+
337 static unsigned char const buttonMappings[] PROGMEM = {
+
338  2, 0, 0, 0, 3, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 1,
+
339  1, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0
+
340 };
+
341 #define mapButton(value) (pgm_read_byte(&(buttonMappings[(value) >> 5])))
+
342 
+ +
369 {
+
370  // Initialize the backlight for the first time if necessary.
+
371  if (!backlightInit)
+
372  display();
+
373 
+
374  // Read the currently pressed button.
+
375  int button = mapButton(analogRead(LCD_BUTTON_PIN));
+
376 
+
377  // Debounce the button state.
+
378  unsigned long currentTime = millis();
+
379  if (button != debounceButton)
+
380  lastDebounce = currentTime;
+
381  debounceButton = button;
+
382  if ((currentTime - lastDebounce) < DEBOUNCE_DELAY)
+
383  button = prevButton;
+
384 
+
385  // Process the button event if the state has changed.
+
386  if (prevButton == LCD_BUTTON_NONE && button != LCD_BUTTON_NONE) {
+
387  prevButton = button;
+
388  if (screenSaved) {
+
389  // Button pressed when screen saver active.
+
390  if (mode == BacklightOnSelect) {
+
391  // Turn on the back light only if Select was pressed.
+
392  if (button == LCD_BUTTON_SELECT) {
+
393  pinMode(_backlightPin, OUTPUT);
+
394  digitalWrite(_backlightPin, HIGH);
+
395  screenSaved = false;
+
396  backlightInit = true;
+
397  }
+
398  } else if (mode == DisplayOff) {
+
399  display();
+
400  eatRelease = true;
+
401  return LCD_BUTTON_NONE;
+
402  } else {
+
403  display();
+
404  }
+
405  } else if (mode == BacklightOnSelect && button != LCD_BUTTON_SELECT) {
+
406  eatRelease = false;
+
407  return button;
+
408  }
+
409  eatRelease = false;
+
410  lastRestore = currentTime;
+
411  return button;
+
412  } else if (prevButton != LCD_BUTTON_NONE && button == LCD_BUTTON_NONE) {
+
413  button = -prevButton;
+
414  prevButton = LCD_BUTTON_NONE;
+
415  lastRestore = currentTime;
+
416  if (eatRelease) {
+
417  eatRelease = false;
+
418  return LCD_BUTTON_NONE;
+
419  }
+
420  return button;
+
421  } else {
+
422  if (!screenSaved && prevButton == LCD_BUTTON_NONE &&
+
423  timeout != 0 && (currentTime - lastRestore) >= timeout)
+
424  noDisplay(); // Activate screen saver.
+
425  return LCD_BUTTON_NONE;
+
426  }
+
427 }
+
void setScreenSaverMode(ScreenSaverMode mode)
Sets the current screen saver mode.
Definition: LCD.cpp:283
+
int getButton()
Gets the next button press, release, or idle event.
Definition: LCD.cpp:368
+
Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons h...
Definition: LCD.h:66
+
ScreenSaverMode
Screen saver mode that controls the display and back light.
Definition: LCD.h:62
+
void setBacklightPin(uint8_t pin)
Sets the back light pin for the LCD shield.
Definition: LCD.cpp:197
+
void enableScreenSaver(int timeoutSecs=10)
Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...
Definition: LCD.cpp:309
+
void noDisplay()
Turns off the display of text on the LCD and the back light.
Definition: LCD.cpp:238
+
Turn off both the display and the backlight when the screen saver is activated.
Definition: LCD.h:64
+
void disableScreenSaver()
Disables the screen saver.
Definition: LCD.cpp:323
+
void display()
Turns on the display of text on the LCD and the back light.
Definition: LCD.cpp:221
+
+ + + + diff --git a/html/LCD_8h_source.html b/html/LCD_8h_source.html new file mode 100644 index 00000000..aa64a5b5 --- /dev/null +++ b/html/LCD_8h_source.html @@ -0,0 +1,210 @@ + + + + + + +ArduinoLibs: LCD.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
LCD.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef LCD_h
+
24 #define LCD_h
+
25 
+
26 // Extended version of the LiquidCrystal library that works specifically
+
27 // with Freetronics' 16x2 LCD display, including support for the back
+
28 // light and the Up/Down/Left/Right/Select buttons. More info:
+
29 //
+
30 // http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
+
31 
+
32 // Include a copy of the standard LiquidCrystal library so we can extend it.
+
33 #include "utility/LiquidCrystal.h"
+
34 
+
35 // Button event codes.
+
36 #define LCD_BUTTON_NONE 0
+
37 #define LCD_BUTTON_LEFT 1
+
38 #define LCD_BUTTON_RIGHT 2
+
39 #define LCD_BUTTON_UP 3
+
40 #define LCD_BUTTON_DOWN 4
+
41 #define LCD_BUTTON_SELECT 5
+
42 #define LCD_BUTTON_LEFT_RELEASED -1
+
43 #define LCD_BUTTON_RIGHT_RELEASED -2
+
44 #define LCD_BUTTON_UP_RELEASED -3
+
45 #define LCD_BUTTON_DOWN_RELEASED -4
+
46 #define LCD_BUTTON_SELECT_RELEASED -5
+
47 
+
48 class LCD : public LiquidCrystal {
+
49 public:
+
50  LCD() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
+
51  LCD(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
+
52  LCD(uint8_t rs, uint8_t enable,
+
53  uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
+
54  : LiquidCrystal(rs, enable, d0, d1, d2, d3) { init(); }
+
55 
+
56  uint8_t backlightPin() const { return _backlightPin; }
+
57  void setBacklightPin(uint8_t pin);
+
58 
+
59  void display();
+
60  void noDisplay();
+
61 
+ +
63  {
+ + + +
67  };
+
68 
+
69  ScreenSaverMode screenSaverMode() const { return mode; }
+ +
71 
+
72  void enableScreenSaver(int timeoutSecs = 10);
+
73  void disableScreenSaver();
+
74  bool isScreenSaved() const { return screenSaved; }
+
75 
+
76  int getButton();
+
77 
+
78 private:
+
79  uint8_t _backlightPin;
+
80  bool backlightInit;
+
81  int prevButton;
+
82  int debounceButton;
+
83  unsigned long timeout;
+
84  unsigned long lastRestore;
+
85  unsigned long lastDebounce;
+
86  bool screenSaved;
+
87  bool eatRelease;
+
88  ScreenSaverMode mode;
+
89 
+
90  void init();
+
91 };
+
92 
+
93 #endif
+
void setScreenSaverMode(ScreenSaverMode mode)
Sets the current screen saver mode.
Definition: LCD.cpp:283
+
int getButton()
Gets the next button press, release, or idle event.
Definition: LCD.cpp:368
+
Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons h...
Definition: LCD.h:66
+
ScreenSaverMode
Screen saver mode that controls the display and back light.
Definition: LCD.h:62
+
LCD(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
Initialize the Freetronics LCD display with custom pins.
Definition: LCD.h:52
+
Turn off the back light but leave the display on when the screen saver is activated.
Definition: LCD.h:65
+
void setBacklightPin(uint8_t pin)
Sets the back light pin for the LCD shield.
Definition: LCD.cpp:197
+
LCD()
Initialize the Freetronics LCD display with the default pin assignment.
Definition: LCD.h:50
+
void enableScreenSaver(int timeoutSecs=10)
Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons...
Definition: LCD.cpp:309
+
LCD(uint8_t pin9)
Initialize the Freetronics LCD display for USBDroid.
Definition: LCD.h:51
+
void noDisplay()
Turns off the display of text on the LCD and the back light.
Definition: LCD.cpp:238
+
Turn off both the display and the backlight when the screen saver is activated.
Definition: LCD.h:64
+
void disableScreenSaver()
Disables the screen saver.
Definition: LCD.cpp:323
+
void display()
Turns on the display of text on the LCD and the back light.
Definition: LCD.cpp:221
+
uint8_t backlightPin() const
Returns the pin that is being used to control the back light. The default is 3.
Definition: LCD.h:56
+
Enhanced library for Freetronics 16x2 LCD shields.
Definition: LCD.h:48
+
bool isScreenSaved() const
Returns true if the screen has been saved; false otherwise.
Definition: LCD.h:74
+
ScreenSaverMode screenSaverMode() const
Returns the current screen saver mode; default is DisplayOff.
Definition: LCD.h:69
+
+ + + + diff --git a/html/ListField_8cpp_source.html b/html/ListField_8cpp_source.html new file mode 100644 index 00000000..ffff232d --- /dev/null +++ b/html/ListField_8cpp_source.html @@ -0,0 +1,229 @@ + + + + + + +ArduinoLibs: ListField.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ListField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "ListField.h"
+
24 #include <string.h>
+
25 
+
64 ListField::ListField(const String &label)
+
65  : Field(label)
+
66  , _items(0)
+
67  , _itemCount(0)
+
68  , _value(-1)
+
69  , _printLen(0)
+
70 {
+
71 }
+
72 
+
77 ListField::ListField(Form &form, const String &label, ListItems items, int value)
+
78  : Field(form, label)
+
79  , _items(0)
+
80  , _itemCount(0)
+
81  , _value(value)
+
82  , _printLen(0)
+
83 {
+
84  setItems(items);
+
85 }
+
86 
+
87 int ListField::dispatch(int event)
+
88 {
+
89  if (event == LCD_BUTTON_DOWN) {
+
90  if (_value >= (_itemCount - 1))
+
91  setValue(0);
+
92  else
+
93  setValue(_value + 1);
+
94  return FORM_CHANGED;
+
95  } else if (event == LCD_BUTTON_UP) {
+
96  if (_value <= 0)
+
97  setValue(_itemCount - 1);
+
98  else
+
99  setValue(_value - 1);
+
100  return FORM_CHANGED;
+
101  }
+
102  return -1;
+
103 }
+
104 
+
105 void ListField::enterField(bool reverse)
+
106 {
+
107  Field::enterField(reverse);
+
108  _printLen = 0;
+
109  printValue();
+
110 }
+
111 
+
141 void ListField::setItems(ListItems items)
+
142 {
+
143  _items = items;
+
144  _itemCount = 0;
+
145  if (items) {
+
146  for (;;) {
+
147  ListItem item = (ListItem)pgm_read_word(items);
+
148  if (!item)
+
149  break;
+
150  ++items;
+
151  ++_itemCount;
+
152  }
+
153  }
+
154  if (_value >= _itemCount)
+
155  _value = _itemCount - 1;
+
156  if (isCurrent())
+
157  printValue();
+
158 }
+
159 
+
178 void ListField::setValue(int value)
+
179 {
+
180  if (_value != value) {
+
181  _value = value;
+
182  if (_value < 0)
+
183  _value = 0;
+
184  if (_value >= _itemCount)
+
185  _value = _itemCount - 1;
+
186  if (isCurrent())
+
187  printValue();
+
188  }
+
189 }
+
190 
+
191 void ListField::printValue()
+
192 {
+
193  lcd()->setCursor(0, 1);
+
194  int len = 0;
+
195  if (_value >= 0) {
+
196  ListItem str = (ListItem)pgm_read_word(&(_items[_value]));
+
197  char ch;
+
198  while ((ch = pgm_read_byte(str)) != 0) {
+
199  lcd()->write(ch);
+
200  ++len;
+
201  ++str;
+
202  }
+
203  }
+
204  while (_printLen-- > len)
+
205  lcd()->write(' ');
+
206  _printLen = len;
+
207 }
+
ListField(const String &label)
Constructs a new list field with a specific label.
Definition: ListField.cpp:64
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
int value() const
Returns the value of this list; i.e. the index within items() of the selected item.
Definition: ListField.h:44
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
void setItems(ListItems items)
Sets the array of items for this list.
Definition: ListField.cpp:141
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
ListItems items() const
Returns the array of items in this list.
Definition: ListField.h:41
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: ListField.cpp:105
+
void setValue(int value)
Sets the value of this list; i.e. the index within items() of the selected item.
Definition: ListField.cpp:178
+
int dispatch(int event)
Dispatches event via this field.
Definition: ListField.cpp:87
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
+ + + + diff --git a/html/ListField_8h_source.html b/html/ListField_8h_source.html new file mode 100644 index 00000000..81f42fd5 --- /dev/null +++ b/html/ListField_8h_source.html @@ -0,0 +1,167 @@ + + + + + + +ArduinoLibs: ListField.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
ListField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef ListField_h
+
24 #define ListField_h
+
25 
+
26 #include "Field.h"
+
27 #include <avr/pgmspace.h>
+
28 
+
29 typedef PGM_P ListItem;
+
30 typedef const PROGMEM ListItem *ListItems;
+
31 
+
32 class ListField : public Field {
+
33 public:
+
34  explicit ListField(const String &label);
+
35  ListField(Form &form, const String &label, ListItems items, int value = 0);
+
36 
+
37  int dispatch(int event);
+
38 
+
39  void enterField(bool reverse);
+
40 
+
41  ListItems items() const { return _items; }
+
42  void setItems(ListItems items);
+
43 
+
44  int value() const { return _value; }
+
45  void setValue(int value);
+
46 
+
47 private:
+
48  ListItems _items;
+
49  int _itemCount;
+
50  int _value;
+
51  int _printLen;
+
52 
+
53  void printValue();
+
54 };
+
55 
+
56 #endif
+
ListField(const String &label)
Constructs a new list field with a specific label.
Definition: ListField.cpp:64
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
int value() const
Returns the value of this list; i.e. the index within items() of the selected item.
Definition: ListField.h:44
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
void setItems(ListItems items)
Sets the array of items for this list.
Definition: ListField.cpp:141
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
ListItems items() const
Returns the array of items in this list.
Definition: ListField.h:41
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: ListField.cpp:105
+
void setValue(int value)
Sets the value of this list; i.e. the index within items() of the selected item.
Definition: ListField.cpp:178
+
Field that manages selection from a static list of items.
Definition: ListField.h:32
+
int dispatch(int event)
Dispatches event via this field.
Definition: ListField.cpp:87
+
+ + + + diff --git a/html/Melody_8cpp_source.html b/html/Melody_8cpp_source.html new file mode 100644 index 00000000..1ea56e8f --- /dev/null +++ b/html/Melody_8cpp_source.html @@ -0,0 +1,223 @@ + + + + + + +ArduinoLibs: Melody.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Melody.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Melody.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
85 Melody::Melody(uint8_t pin)
+
86  : _pin(pin)
+
87  , playing(false)
+
88  , _loopCount(0)
+
89  , loopsLeft(0)
+
90  , notes(0)
+
91  , lengths(0)
+
92  , size(0)
+
93  , posn(0)
+
94  , duration(0)
+
95  , startNote(0)
+
96 {
+
97 }
+
98 
+
131 void Melody::setLoopDuration(unsigned long ms)
+
132 {
+
133  unsigned long duration = 0;
+
134  for (unsigned int index = 0; index < size; ++index)
+
135  duration += (1000 / lengths[index]) * 13 / 10;
+
136  _loopCount = (int)(ms / duration);
+
137  if (!_loopCount)
+
138  _loopCount = 1; // Play the melody at least once.
+
139 }
+
140 
+ +
147 {
+
148  stop();
+
149  if (size == 0)
+
150  return; // No melody to play.
+
151  loopsLeft = _loopCount;
+
152  posn = 0;
+
153  playing = true;
+
154  nextNote();
+
155 }
+
156 
+ +
163 {
+
164  stop();
+
165  if (size == 0)
+
166  return; // No melody to play.
+
167  loopsLeft = 1;
+
168  posn = 0;
+
169  playing = true;
+
170  nextNote();
+
171 }
+
172 
+ +
179 {
+
180  if (!playing)
+
181  return;
+
182  playing = false;
+
183  noTone(_pin);
+
184 }
+
185 
+
199 void Melody::setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
+
200 {
+
201  stop();
+
202  this->notes = notes;
+
203  this->lengths = lengths;
+
204  this->size = size;
+
205 }
+
206 
+ +
215 {
+
216  if (!playing)
+
217  return;
+
218  if ((millis() - startNote) >= duration) {
+
219  noTone(_pin);
+
220  nextNote();
+
221  }
+
222 }
+
223 
+
224 void Melody::nextNote()
+
225 {
+
226  if (posn >= size) {
+
227  if (loopsLeft != 0 && --loopsLeft <= 0) {
+
228  stop();
+
229  return;
+
230  }
+
231  posn = 0;
+
232  }
+
233  duration = 1000 / lengths[posn];
+
234  if (notes[posn] != NOTE_REST)
+
235  tone(_pin, notes[posn], duration);
+
236  ++posn;
+
237  duration = duration * 13 / 10; // i.e., duration * 1.3
+
238  startNote = millis();
+
239 }
+
void setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
Sets the melody to the size elements of notes and lengths.
Definition: Melody.cpp:199
+
void stop()
Stops playing the melody.
Definition: Melody.cpp:178
+
void run()
Runs the melody control loop.
Definition: Melody.cpp:214
+
void playOnce()
Plays the melody once and then stops.
Definition: Melody.cpp:162
+
Melody(uint8_t pin)
Constructs a new melody playing object for pin.
Definition: Melody.cpp:85
+
void setLoopDuration(unsigned long ms)
Sets the maximum number of loops to last no longer than ms milliseconds.
Definition: Melody.cpp:131
+
void play()
Starts playing the melody, or restarts it if already playing.
Definition: Melody.cpp:146
+
+ + + + diff --git a/html/Melody_8h_source.html b/html/Melody_8h_source.html new file mode 100644 index 00000000..59b1f132 --- /dev/null +++ b/html/Melody_8h_source.html @@ -0,0 +1,266 @@ + + + + + + +ArduinoLibs: Melody.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Melody.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Melody_h
+
24 #define Melody_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 // Note frequencies from http://arduino.cc/en/Tutorial/Tone
+
29 #define NOTE_B0 31
+
30 #define NOTE_C1 33
+
31 #define NOTE_CS1 35
+
32 #define NOTE_D1 37
+
33 #define NOTE_DS1 39
+
34 #define NOTE_E1 41
+
35 #define NOTE_F1 44
+
36 #define NOTE_FS1 46
+
37 #define NOTE_G1 49
+
38 #define NOTE_GS1 52
+
39 #define NOTE_A1 55
+
40 #define NOTE_AS1 58
+
41 #define NOTE_B1 62
+
42 #define NOTE_C2 65
+
43 #define NOTE_CS2 69
+
44 #define NOTE_D2 73
+
45 #define NOTE_DS2 78
+
46 #define NOTE_E2 82
+
47 #define NOTE_F2 87
+
48 #define NOTE_FS2 93
+
49 #define NOTE_G2 98
+
50 #define NOTE_GS2 104
+
51 #define NOTE_A2 110
+
52 #define NOTE_AS2 117
+
53 #define NOTE_B2 123
+
54 #define NOTE_C3 131
+
55 #define NOTE_CS3 139
+
56 #define NOTE_D3 147
+
57 #define NOTE_DS3 156
+
58 #define NOTE_E3 165
+
59 #define NOTE_F3 175
+
60 #define NOTE_FS3 185
+
61 #define NOTE_G3 196
+
62 #define NOTE_GS3 208
+
63 #define NOTE_A3 220
+
64 #define NOTE_AS3 233
+
65 #define NOTE_B3 247
+
66 #define NOTE_C4 262
+
67 #define NOTE_CS4 277
+
68 #define NOTE_D4 294
+
69 #define NOTE_DS4 311
+
70 #define NOTE_E4 330
+
71 #define NOTE_F4 349
+
72 #define NOTE_FS4 370
+
73 #define NOTE_G4 392
+
74 #define NOTE_GS4 415
+
75 #define NOTE_A4 440
+
76 #define NOTE_AS4 466
+
77 #define NOTE_B4 494
+
78 #define NOTE_C5 523
+
79 #define NOTE_CS5 554
+
80 #define NOTE_D5 587
+
81 #define NOTE_DS5 622
+
82 #define NOTE_E5 659
+
83 #define NOTE_F5 698
+
84 #define NOTE_FS5 740
+
85 #define NOTE_G5 784
+
86 #define NOTE_GS5 831
+
87 #define NOTE_A5 880
+
88 #define NOTE_AS5 932
+
89 #define NOTE_B5 988
+
90 #define NOTE_C6 1047
+
91 #define NOTE_CS6 1109
+
92 #define NOTE_D6 1175
+
93 #define NOTE_DS6 1245
+
94 #define NOTE_E6 1319
+
95 #define NOTE_F6 1397
+
96 #define NOTE_FS6 1480
+
97 #define NOTE_G6 1568
+
98 #define NOTE_GS6 1661
+
99 #define NOTE_A6 1760
+
100 #define NOTE_AS6 1865
+
101 #define NOTE_B6 1976
+
102 #define NOTE_C7 2093
+
103 #define NOTE_CS7 2217
+
104 #define NOTE_D7 2349
+
105 #define NOTE_DS7 2489
+
106 #define NOTE_E7 2637
+
107 #define NOTE_F7 2794
+
108 #define NOTE_FS7 2960
+
109 #define NOTE_G7 3136
+
110 #define NOTE_GS7 3322
+
111 #define NOTE_A7 3520
+
112 #define NOTE_AS7 3729
+
113 #define NOTE_B7 3951
+
114 #define NOTE_C8 4186
+
115 #define NOTE_CS8 4435
+
116 #define NOTE_D8 4699
+
117 #define NOTE_DS8 4978
+
118 
+
119 // Special note value that indicates a rest.
+
120 #define NOTE_REST 0
+
121 
+
122 class Melody {
+
123 public:
+
124  Melody(uint8_t pin);
+
125 
+
126  bool isPlaying() const { return playing; }
+
127 
+
128  int loopCount() const { return _loopCount; }
+
129  void setLoopCount(int count) { _loopCount = count; }
+
130 
+
131  void setLoopDuration(unsigned long ms);
+
132 
+
133  void play();
+
134  void playOnce();
+
135  void stop();
+
136 
+
137  void setMelody(const int *notes, const uint8_t *lengths, unsigned int size);
+
138 
+
139  void run();
+
140 
+
141 private:
+
142  uint8_t _pin;
+
143  bool playing;
+
144  int _loopCount;
+
145  int loopsLeft;
+
146  const int *notes;
+
147  const uint8_t *lengths;
+
148  unsigned int size;
+
149  unsigned int posn;
+
150  unsigned long duration;
+
151  unsigned long startNote;
+
152 
+
153  void nextNote();
+
154 };
+
155 
+
156 #endif
+
void setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
Sets the melody to the size elements of notes and lengths.
Definition: Melody.cpp:199
+
void stop()
Stops playing the melody.
Definition: Melody.cpp:178
+
void run()
Runs the melody control loop.
Definition: Melody.cpp:214
+
bool isPlaying() const
Returns true if the melody is currently playing; false if not.
Definition: Melody.h:126
+
void playOnce()
Plays the melody once and then stops.
Definition: Melody.cpp:162
+
Melody(uint8_t pin)
Constructs a new melody playing object for pin.
Definition: Melody.cpp:85
+
int loopCount() const
Returns the number of times the melody should loop before stopping.
Definition: Melody.h:128
+
Plays a melody on a digital output pin using tone().
Definition: Melody.h:122
+
void setLoopDuration(unsigned long ms)
Sets the maximum number of loops to last no longer than ms milliseconds.
Definition: Melody.cpp:131
+
void play()
Starts playing the melody, or restarts it if already playing.
Definition: Melody.cpp:146
+
void setLoopCount(int count)
Sets the number of times the melody should loop to count.
Definition: Melody.h:129
+
+ + + + diff --git a/html/Mono5x7_8h_source.html b/html/Mono5x7_8h_source.html new file mode 100644 index 00000000..d55b863a --- /dev/null +++ b/html/Mono5x7_8h_source.html @@ -0,0 +1,254 @@ + + + + + + +ArduinoLibs: Mono5x7.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Mono5x7.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * Mono5x7
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : Mono5x7.h
+
14  * Date : 29.05.2012
+
15  * Font size in bytes : 3462
+
16  * Font width : 5
+
17  * Font height : 7
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef MONO5X7_H
+
43 #define MONO5X7_H
+
44 
+
45 #define MONO5X7_WIDTH 5
+
46 #define MONO5X7_HEIGHT 7
+
47 
+
48 static uint8_t const Mono5x7[] PROGMEM = {
+
49  0x00, 0x00, // size
+
50  0x05, // width
+
51  0x07, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // font data
+
56  0x00, 0x00, 0x00, 0x00, 0x00, // 32
+
57  0x00, 0x00, 0x5F, 0x00, 0x00, // 33
+
58  0x00, 0x07, 0x00, 0x07, 0x00, // 34
+
59  0x14, 0x7F, 0x14, 0x7F, 0x14, // 35
+
60  0x24, 0x2A, 0x7F, 0x2A, 0x12, // 36
+
61  0x23, 0x13, 0x08, 0x64, 0x62, // 37
+
62  0x36, 0x49, 0x55, 0x22, 0x50, // 38
+
63  0x00, 0x05, 0x03, 0x00, 0x00, // 39
+
64  0x00, 0x1C, 0x22, 0x41, 0x00, // 40
+
65  0x00, 0x41, 0x22, 0x1C, 0x00, // 41
+
66  0x14, 0x08, 0x3E, 0x08, 0x14, // 42
+
67  0x08, 0x08, 0x3E, 0x08, 0x08, // 43
+
68  0x00, 0x50, 0x30, 0x00, 0x00, // 44
+
69  0x08, 0x08, 0x08, 0x08, 0x08, // 45
+
70  0x00, 0x60, 0x60, 0x00, 0x00, // 46
+
71  0x20, 0x10, 0x08, 0x04, 0x02, // 47
+
72  0x3E, 0x51, 0x49, 0x45, 0x3E, // 48
+
73  0x00, 0x42, 0x7F, 0x40, 0x00, // 49
+
74  0x42, 0x61, 0x51, 0x49, 0x46, // 50
+
75  0x21, 0x41, 0x45, 0x4B, 0x31, // 51
+
76  0x18, 0x14, 0x12, 0x7F, 0x10, // 52
+
77  0x27, 0x45, 0x45, 0x45, 0x39, // 53
+
78  0x3C, 0x4A, 0x49, 0x49, 0x30, // 54
+
79  0x01, 0x71, 0x09, 0x05, 0x03, // 55
+
80  0x36, 0x49, 0x49, 0x49, 0x36, // 56
+
81  0x06, 0x49, 0x49, 0x29, 0x1E, // 57
+
82  0x00, 0x36, 0x36, 0x00, 0x00, // 58
+
83  0x00, 0x56, 0x36, 0x00, 0x00, // 59
+
84  0x08, 0x14, 0x22, 0x41, 0x00, // 60
+
85  0x14, 0x14, 0x14, 0x14, 0x14, // 61
+
86  0x00, 0x41, 0x22, 0x14, 0x08, // 62
+
87  0x02, 0x01, 0x51, 0x09, 0x06, // 63
+
88  0x32, 0x49, 0x79, 0x41, 0x3E, // 64
+
89  0x7E, 0x11, 0x11, 0x11, 0x7E, // 65
+
90  0x7F, 0x49, 0x49, 0x49, 0x36, // 66
+
91  0x3E, 0x41, 0x41, 0x41, 0x22, // 67
+
92  0x7F, 0x41, 0x41, 0x22, 0x1C, // 68
+
93  0x7F, 0x49, 0x49, 0x49, 0x41, // 69
+
94  0x7F, 0x09, 0x09, 0x09, 0x01, // 70
+
95  0x3E, 0x41, 0x49, 0x49, 0x78, // 71
+
96  0x7F, 0x08, 0x08, 0x08, 0x7F, // 72
+
97  0x00, 0x41, 0x7F, 0x41, 0x00, // 73
+
98  0x20, 0x40, 0x41, 0x3F, 0x01, // 74
+
99  0x7F, 0x08, 0x14, 0x22, 0x41, // 75
+
100  0x7F, 0x40, 0x40, 0x40, 0x40, // 76
+
101  0x7F, 0x02, 0x0C, 0x02, 0x7F, // 77
+
102  0x7F, 0x04, 0x08, 0x10, 0x7F, // 78
+
103  0x3E, 0x41, 0x41, 0x41, 0x3E, // 79
+
104  0x7F, 0x09, 0x09, 0x09, 0x06, // 80
+
105  0x3E, 0x41, 0x51, 0x21, 0x5E, // 81
+
106  0x7F, 0x09, 0x19, 0x29, 0x46, // 82
+
107  0x46, 0x49, 0x49, 0x49, 0x31, // 83
+
108  0x01, 0x01, 0x7F, 0x01, 0x01, // 84
+
109  0x3F, 0x40, 0x40, 0x40, 0x3F, // 85
+
110  0x1F, 0x20, 0x40, 0x20, 0x1F, // 86
+
111  0x3F, 0x40, 0x38, 0x40, 0x3F, // 87
+
112  0x63, 0x14, 0x08, 0x14, 0x63, // 88
+
113  0x07, 0x08, 0x70, 0x08, 0x07, // 89
+
114  0x61, 0x51, 0x49, 0x45, 0x43, // 90
+
115  0x00, 0x7F, 0x41, 0x41, 0x00, // 91
+
116  0x02, 0x04, 0x08, 0x10, 0x20, // 92
+
117  0x00, 0x41, 0x41, 0x7F, 0x00, // 93
+
118  0x04, 0x02, 0x01, 0x02, 0x04, // 94
+
119  0x40, 0x40, 0x40, 0x40, 0x40, // 95
+
120  0x00, 0x02, 0x04, 0x08, 0x00, // 96
+
121  0x20, 0x54, 0x54, 0x54, 0x78, // 97
+
122  0x7F, 0x48, 0x44, 0x44, 0x38, // 98
+
123  0x38, 0x44, 0x44, 0x44, 0x20, // 99
+
124  0x38, 0x44, 0x44, 0x48, 0x7F, // 100
+
125  0x38, 0x54, 0x54, 0x54, 0x18, // 101
+
126  0x08, 0x7E, 0x09, 0x01, 0x02, // 102
+
127  0x0C, 0x52, 0x52, 0x52, 0x3E, // 103
+
128  0x7F, 0x08, 0x04, 0x04, 0x78, // 104
+
129  0x00, 0x44, 0x7D, 0x40, 0x00, // 105
+
130  0x20, 0x40, 0x44, 0x3D, 0x00, // 106
+
131  0x7F, 0x10, 0x28, 0x44, 0x00, // 107
+
132  0x00, 0x41, 0x7F, 0x40, 0x00, // 108
+
133  0x7C, 0x04, 0x18, 0x04, 0x78, // 109
+
134  0x7C, 0x08, 0x04, 0x04, 0x78, // 110
+
135  0x38, 0x44, 0x44, 0x44, 0x38, // 111
+
136  0x7C, 0x14, 0x14, 0x14, 0x08, // 112
+
137  0x08, 0x14, 0x14, 0x18, 0x7C, // 113
+
138  0x7C, 0x08, 0x04, 0x04, 0x08, // 114
+
139  0x48, 0x54, 0x54, 0x54, 0x20, // 115
+
140  0x04, 0x3F, 0x44, 0x40, 0x00, // 116
+
141  0x3C, 0x40, 0x40, 0x20, 0x7C, // 117
+
142  0x1C, 0x20, 0x40, 0x20, 0x1C, // 118
+
143  0x3C, 0x40, 0x30, 0x40, 0x3C, // 119
+
144  0x44, 0x28, 0x10, 0x28, 0x44, // 120
+
145  0x0C, 0x50, 0x50, 0x50, 0x3C, // 121
+
146  0x44, 0x64, 0x54, 0x4C, 0x44, // 122
+
147  0x00, 0x08, 0x36, 0x41, 0x00, // 123
+
148  0x00, 0x00, 0x7F, 0x00, 0x00, // 124
+
149  0x00, 0x41, 0x36, 0x08, 0x00, // 125
+
150  0x08, 0x04, 0x08, 0x10, 0x08, // 126
+
151  0x00, 0x00, 0x00, 0x00, 0x00 // 127
+
152 
+
153 };
+
154 
+
155 #endif
+
+ + + + diff --git a/html/NoiseSource_8cpp_source.html b/html/NoiseSource_8cpp_source.html new file mode 100644 index 00000000..a1fe11f4 --- /dev/null +++ b/html/NoiseSource_8cpp_source.html @@ -0,0 +1,140 @@ + + + + + + +ArduinoLibs: NoiseSource.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
NoiseSource.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "NoiseSource.h"
+
24 #include "RNG.h"
+
25 
+ +
37 {
+
38 }
+
39 
+ +
44 {
+
45 }
+
46 
+
102 void NoiseSource::output(const uint8_t *data, size_t len, unsigned int credit)
+
103 {
+
104  RNG.stir(data, len, credit);
+
105 }
+
NoiseSource()
Constructs a new random noise source.
Definition: NoiseSource.cpp:36
+
virtual void output(const uint8_t *data, size_t len, unsigned int credit)
Called from subclasses to output noise to the global random number pool.
+
virtual ~NoiseSource()
Destroys this random noise source.
Definition: NoiseSource.cpp:43
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:406
+
+ + + + diff --git a/html/NoiseSource_8h_source.html b/html/NoiseSource_8h_source.html new file mode 100644 index 00000000..e0b2569f --- /dev/null +++ b/html/NoiseSource_8h_source.html @@ -0,0 +1,147 @@ + + + + + + +ArduinoLibs: NoiseSource.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
NoiseSource.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_NOISESOURCE_H
+
24 #define CRYPTO_NOISESOURCE_H
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+ +
30 {
+
31 public:
+
32  NoiseSource();
+
33  virtual ~NoiseSource();
+
34 
+
35  virtual bool calibrating() const = 0;
+
36  virtual void stir() = 0;
+
37 
+
38 protected:
+
39  virtual void output(const uint8_t *data, size_t len, unsigned int credit);
+
40 };
+
41 
+
42 #endif
+
NoiseSource()
Constructs a new random noise source.
Definition: NoiseSource.cpp:36
+
virtual void stir()=0
Stirs entropy from this noise source into the global random number pool.
+
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
+
virtual void output(const uint8_t *data, size_t len, unsigned int credit)
Called from subclasses to output noise to the global random number pool.
+
virtual ~NoiseSource()
Destroys this random noise source.
Definition: NoiseSource.cpp:43
+
virtual bool calibrating() const =0
Determine if the noise source is still calibrating itself.
+
+ + + + diff --git a/html/OFB_8cpp_source.html b/html/OFB_8cpp_source.html new file mode 100644 index 00000000..394bac26 --- /dev/null +++ b/html/OFB_8cpp_source.html @@ -0,0 +1,214 @@ + + + + + + +ArduinoLibs: OFB.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
OFB.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "OFB.h"
+
24 #include "Crypto.h"
+
25 #include <string.h>
+
26 
+ +
43  : blockCipher(0)
+
44  , posn(16)
+
45 {
+
46 }
+
47 
+ +
52 {
+
53  clean(iv);
+
54 }
+
55 
+
56 size_t OFBCommon::keySize() const
+
57 {
+
58  return blockCipher->keySize();
+
59 }
+
60 
+
61 size_t OFBCommon::ivSize() const
+
62 {
+
63  return 16;
+
64 }
+
65 
+
66 bool OFBCommon::setKey(const uint8_t *key, size_t len)
+
67 {
+
68  // Verify the cipher's block size, just in case.
+
69  if (blockCipher->blockSize() != 16)
+
70  return false;
+
71 
+
72  // Set the key on the underlying block cipher.
+
73  return blockCipher->setKey(key, len);
+
74 }
+
75 
+
76 bool OFBCommon::setIV(const uint8_t *iv, size_t len)
+
77 {
+
78  if (len != 16)
+
79  return false;
+
80  memcpy(this->iv, iv, 16);
+
81  posn = 16;
+
82  return true;
+
83 }
+
84 
+
85 void OFBCommon::encrypt(uint8_t *output, const uint8_t *input, size_t len)
+
86 {
+
87  uint8_t size;
+
88  while (len > 0) {
+
89  // If we have exhausted the current keystream block, then encrypt
+
90  // the IV/ciphertext to get another keystream block.
+
91  if (posn >= 16) {
+
92  blockCipher->encryptBlock(iv, iv);
+
93  posn = 0;
+
94  }
+
95 
+
96  // XOR the plaintext with the encrypted IV to get the new ciphertext.
+
97  size = 16 - posn;
+
98  if (size > len)
+
99  size = len;
+
100  len -= size;
+
101  while (size > 0) {
+
102  *output++ = *input++ ^ iv[posn++];
+
103  --size;
+
104  }
+
105  }
+
106 }
+
107 
+
108 void OFBCommon::decrypt(uint8_t *output, const uint8_t *input, size_t len)
+
109 {
+
110  encrypt(output, input, len);
+
111 }
+
112 
+ +
114 {
+
115  blockCipher->clear();
+
116  clean(iv);
+
117  posn = 16;
+
118 }
+
119 
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: OFB.cpp:113
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: OFB.cpp:66
+
virtual void encryptBlock(uint8_t *output, const uint8_t *input)=0
Encrypts a single block using this cipher.
+
OFBCommon()
Constructs a new cipher in OFB mode.
Definition: OFB.cpp:42
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: OFB.cpp:85
+
virtual bool setKey(const uint8_t *key, size_t len)=0
Sets the key to use for future encryption and decryption operations.
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: OFB.cpp:108
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: OFB.cpp:56
+
virtual void clear()=0
Clears all security-sensitive state from this block cipher.
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: OFB.cpp:76
+
virtual size_t blockSize() const =0
Size of a single block processed by this cipher, in bytes.
+
virtual size_t keySize() const =0
Default size of the key for this block cipher, in bytes.
+
virtual ~OFBCommon()
Destroys this cipher object after clearing sensitive information.
Definition: OFB.cpp:51
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: OFB.cpp:61
+
+ + + + diff --git a/html/OFB_8h_source.html b/html/OFB_8h_source.html new file mode 100644 index 00000000..5d1c4684 --- /dev/null +++ b/html/OFB_8h_source.html @@ -0,0 +1,179 @@ + + + + + + +ArduinoLibs: OFB.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
OFB.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_OFB_h
+
24 #define CRYPTO_OFB_h
+
25 
+
26 #include "Cipher.h"
+
27 #include "BlockCipher.h"
+
28 
+
29 class OFBCommon : public Cipher
+
30 {
+
31 public:
+
32  virtual ~OFBCommon();
+
33 
+
34  size_t keySize() const;
+
35  size_t ivSize() const;
+
36 
+
37  bool setKey(const uint8_t *key, size_t len);
+
38  bool setIV(const uint8_t *iv, size_t len);
+
39 
+
40  void encrypt(uint8_t *output, const uint8_t *input, size_t len);
+
41  void decrypt(uint8_t *output, const uint8_t *input, size_t len);
+
42 
+
43  void clear();
+
44 
+
45 protected:
+
46  OFBCommon();
+
47  void setBlockCipher(BlockCipher *cipher) { blockCipher = cipher; }
+
48 
+
49 private:
+
50  BlockCipher *blockCipher;
+
51  uint8_t iv[16];
+
52  uint8_t posn;
+
53 };
+
54 
+
55 template <typename T>
+
56 class OFB : public OFBCommon
+
57 {
+
58 public:
+
59  OFB() { setBlockCipher(&cipher); }
+
60 
+
61 private:
+
62  T cipher;
+
63 };
+
64 
+
65 #endif
+
Abstract base class for stream ciphers.
Definition: Cipher.h:29
+
Abstract base class for block ciphers.
Definition: BlockCipher.h:29
+
Concrete base class to assist with implementing OFB for 128-bit block ciphers.
Definition: OFB.h:29
+
void clear()
Clears all security-sensitive state from this cipher.
Definition: OFB.cpp:113
+
bool setKey(const uint8_t *key, size_t len)
Sets the key to use for future encryption and decryption operations.
Definition: OFB.cpp:66
+
OFBCommon()
Constructs a new cipher in OFB mode.
Definition: OFB.cpp:42
+
void encrypt(uint8_t *output, const uint8_t *input, size_t len)
Encrypts an input buffer and writes the ciphertext to an output buffer.
Definition: OFB.cpp:85
+
void decrypt(uint8_t *output, const uint8_t *input, size_t len)
Decrypts an input buffer and writes the plaintext to an output buffer.
Definition: OFB.cpp:108
+
size_t keySize() const
Default size of the key for this cipher, in bytes.
Definition: OFB.cpp:56
+
OFB()
Constructs a new OFB object for the block cipher T.
Definition: OFB.h:59
+
bool setIV(const uint8_t *iv, size_t len)
Sets the initialization vector to use for future encryption and decryption operations.
Definition: OFB.cpp:76
+
virtual ~OFBCommon()
Destroys this cipher object after clearing sensitive information.
Definition: OFB.cpp:51
+
void setBlockCipher(BlockCipher *cipher)
Sets the block cipher to use for this OFB object.
Definition: OFB.h:47
+
size_t ivSize() const
Size of the initialization vector for this cipher, in bytes.
Definition: OFB.cpp:61
+
Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers.
Definition: OFB.h:56
+
+ + + + diff --git a/html/PowerSave_8cpp_source.html b/html/PowerSave_8cpp_source.html new file mode 100644 index 00000000..7cd2467c --- /dev/null +++ b/html/PowerSave_8cpp_source.html @@ -0,0 +1,163 @@ + + + + + + +ArduinoLibs: PowerSave.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
PowerSave.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "PowerSave.h"
+
24 #include <avr/wdt.h>
+
25 #include <avr/sleep.h>
+
26 #include <avr/power.h>
+
27 #include <avr/interrupt.h>
+
28 
+
36 /*\@{*/
+
37 
+
48 ISR(WDT_vect)
+
49 {
+
50  wdt_disable();
+
51 }
+
132 void sleepFor(SleepDuration duration, uint8_t mode)
+
133 {
+
134  // Turn off the analog to digital converter.
+
135  ADCSRA &= ~(1 << ADEN);
+
136  power_adc_disable();
+
137 
+
138  // Turn on the watchdog timer for the desired duration.
+
139  wdt_enable(duration);
+
140  WDTCSR |= (1 << WDIE);
+
141 
+
142  // Put the device to sleep, including turning off the Brown Out Detector.
+
143  set_sleep_mode(mode);
+
144  cli();
+
145  sleep_enable();
+
146 #if defined(sleep_bod_disable)
+
147  sleep_bod_disable();
+
148 #endif
+
149  sei();
+
150  sleep_cpu();
+
151  sleep_disable();
+
152  sei();
+
153 
+
154  // Turn the analog to digital converter back on.
+
155  power_adc_enable();
+
156  ADCSRA |= (1 << ADEN);
+
157 }
+
158 
+
159 /*\@}*/
+
void sleepFor(SleepDuration duration, uint8_t mode)
Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detec...
Definition: PowerSave.cpp:132
+
SleepDuration
Duration to put the CPU to sleep with sleepFor().
Definition: PowerSave.h:38
+
+ + + + diff --git a/html/PowerSave_8h_source.html b/html/PowerSave_8h_source.html new file mode 100644 index 00000000..481fdd5f --- /dev/null +++ b/html/PowerSave_8h_source.html @@ -0,0 +1,166 @@ + + + + + + +ArduinoLibs: PowerSave.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
PowerSave.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef PowerSave_h
+
24 #define PowerSave_h
+
25 
+
26 #if defined(ARDUINO) && ARDUINO >= 100
+
27 #include <Arduino.h>
+
28 #else
+
29 #include <WProgram.h>
+
30 #endif
+
31 
+
32 inline void unusedPin(uint8_t pin)
+
33 {
+
34  pinMode(pin, INPUT);
+
35  digitalWrite(pin, HIGH);
+
36 }
+
37 
+ +
39 {
+ + + + + + + + + + +
50 };
+
51 
+
52 void sleepFor(SleepDuration duration, uint8_t mode = 0);
+
53 
+
54 #endif
+
void unusedPin(uint8_t pin)
Marks an I/O pin as unused.This function sets pin to be an input with pullups enabled, which will reduce power consumption compared to pins that are left floating.
Definition: PowerSave.h:32
+
Sleep for 60 milliseconds.
Definition: PowerSave.h:42
+
Sleep for 250 milliseconds.
Definition: PowerSave.h:44
+
void sleepFor(SleepDuration duration, uint8_t mode=0)
Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detec...
Definition: PowerSave.cpp:132
+
Sleep for 120 milliseconds.
Definition: PowerSave.h:43
+
SleepDuration
Duration to put the CPU to sleep with sleepFor().
Definition: PowerSave.h:38
+
Sleep for 30 milliseconds.
Definition: PowerSave.h:41
+
Sleep for 2 seconds.
Definition: PowerSave.h:47
+
Sleep for 8 seconds.
Definition: PowerSave.h:49
+
Sleep for 1 second.
Definition: PowerSave.h:46
+
Sleep for 4 seconds.
Definition: PowerSave.h:48
+
Sleep for 500 milliseconds.
Definition: PowerSave.h:45
+
Sleep for 15 milliseconds.
Definition: PowerSave.h:40
+
+ + + + diff --git a/html/RC5_8h_source.html b/html/RC5_8h_source.html new file mode 100644 index 00000000..c8ff9269 --- /dev/null +++ b/html/RC5_8h_source.html @@ -0,0 +1,443 @@ + + + + + + +ArduinoLibs: RC5.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RC5.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef RC5_h
+
24 #define RC5_h
+
25 
+
26 // http://en.wikipedia.org/wiki/RC-5#System_Number_Allocations
+
27 #define RC5_SYS_TV 0 // TV receiver 1
+
28 #define RC5_SYS_TV2 1 // TV receiver 2
+
29 #define RC5_SYS_TXT 2 // Teletext
+
30 #define RC5_SYS_TV_EXT 3 // Extension to TV 1 & 2
+
31 #define RC5_SYS_LV 4 // Laservision player
+
32 #define RC5_SYS_VCR 5 // VCR 1
+
33 #define RC5_SYS_VCR2 6 // VCR 2
+
34 #define RC5_SYS_SAT 8 // Satellite receiver 1
+
35 #define RC5_SYS_VCR_EXT 9 // Extension to VCR 1 & 2
+
36 #define RC5_SYS_SAT2 10 // Satellite receiver 2
+
37 #define RC5_SYS_CD_VIDEO 12 // CD video player
+
38 #define RC5_SYS_CD_PHOTO 14 // CD photo player
+
39 #define RC5_SYS_PREAMP 16 // Audio preamplifier 1
+
40 #define RC5_SYS_RADIO 17 // Radio tuner
+
41 #define RC5_SYS_REC 18 // Casette recorder 1
+
42 #define RC5_SYS_PREAMP2 19 // Audio preamplifier 2
+
43 #define RC5_SYS_CD 20 // CD player
+
44 #define RC5_SYS_COMBI 21 // Audio stack or record player
+
45 #define RC5_SYS_AUDIO_SAT 22 // Audio satellite
+
46 #define RC5_SYS_REC2 23 // Casette recorder 2
+
47 #define RC5_SYS_CD_R 26 // CD recorder
+
48 
+
49 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
50 // Table 2, Common commands:
+
51 #define RC5_0 0 // Digit 0
+
52 #define RC5_1 1 // Digit 1
+
53 #define RC5_2 2 // Digit 2
+
54 #define RC5_3 3 // Digit 3
+
55 #define RC5_4 4 // Digit 4
+
56 #define RC5_5 5 // Digit 5
+
57 #define RC5_6 6 // Digit 6
+
58 #define RC5_7 7 // Digit 7
+
59 #define RC5_8 8 // Digit 8
+
60 #define RC5_9 9 // Digit 9
+
61 #define RC5_INC_VOLUME 16 // Increase sound volume
+
62 #define RC5_DEC_VOLUME 17 // Decrease sound volume
+
63 #define RC5_INC_BRIGHTNESS 18 // Increase display brightness
+
64 #define RC5_DEC_BRIGHTNESS 19 // Decrease display brightness
+
65 #define RC5_INC_BASS 22 // Increase bass response
+
66 #define RC5_DEC_BASS 23 // Decrease bass response
+
67 #define RC5_INC_TREBLE 24 // Increase treble response
+
68 #define RC5_DEC_TREBLE 25 // Decrease treble response
+
69 #define RC5_BALANCE_LEFT 26 // Shift sound balance to left
+
70 #define RC5_BALANCE_RIGHT 27 // Shift sound balance to right
+
71 #define RC5_TRANSMIT_MODE 63 // Select remote transmit mode
+
72 #define RC5_DIM 71 // Dim local display
+
73 #define RC5_INC_LINEAR 77 // Increase linear control
+
74 #define RC5_DEC_LINEAR 78 // Decrease linear control
+
75 #define RC5_UP 80 // Move cursor up
+
76 #define RC5_DOWN 81 // Move cursor down
+
77 #define RC5_MENU_ON 82 // Switch display/screen menu on
+
78 #define RC5_MENU_OFF 83 // Switch display/screen menu off
+
79 #define RC5_AV_STATUS 84 // Display A/V system status
+
80 #define RC5_LEFT 85 // Move cursor left
+
81 #define RC5_RIGHT 86 // Move cursor right
+
82 #define RC5_OK 87 // Acknowledge function at cursor
+
83 #define RC5_SUBMODE 118 // Select sub-mode
+
84 #define RC5_OPTIONS 119 // Select options sub-mode
+
85 #define RC5_CONNECT_EURO 123 // Connect items via Euroconnector
+
86 #define RC5_DISCONNECT_EURO 124 // Disconnect items via Euroconnector
+
87 
+
88 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
89 // Table 3, Common video system commands:
+
90 #define RC5_INC_SATURATION 20 // Increase color saturation
+
91 #define RC5_DEC_SATURATION 21 // Decrease color saturation
+
92 #define RC5_PIP 88 // Picture-in-picture on/off
+
93 #define RC5_PIP_SHIFT 89 // Picture-in-picture shift
+
94 #define RC5_PIP_SWAP 90 // Picture-in-picture swap
+
95 #define RC5_PIP_STROBE 91 // Strobe main picture on/off
+
96 #define RC5_PIP_MULTI_STROBE 92 // Multi-strobe
+
97 #define RC5_PIP_FREEZE_MAIN 93 // Main picture frame frozen
+
98 #define RC5_PIP_MULTI_SCAN 94 // 3/9 multi-scan
+
99 #define RC5_PIP_SOURCE 95 // Select picture-in-picture source
+
100 #define RC5_PIP_MOSAIC 96 // Mosaic/multi-PIP
+
101 #define RC5_PIP_NOISE 97 // Digital noise reduction of picture
+
102 #define RC5_PIP_STORE 98 // Store main picture
+
103 #define RC5_PIP_PHOTO_FINISH 99 // PIP strobe; display photo-finish
+
104 #define RC5_PIP_RECALL 100 // Recall main stored picture
+
105 #define RC5_PIP_FREEZE 101 // Freeze PIP
+
106 #define RC5_PIP_UP 102 // Step up PIP options/source
+
107 #define RC5_PIP_DOWN 103 // Step down PIP options/source
+
108 
+
109 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
110 // Table 4a, TV and VCR commands:
+
111 #define RC5_123 10 // 1/2/3 digit entry
+
112 #define RC5_11 11 // Channel/program/frequency 11
+
113 #define RC5_STANDBY 12 // Standby
+
114 #define RC5_MUTE 13 // Master mute/de-mute
+
115 #define RC5_PREFERENCES 14 // Personal preference settings
+
116 #define RC5_DISPLAY_INFO 15 // Display user info on screen
+
117 #define RC5_INC_CONTRAST 28 // Increase picture contrast
+
118 #define RC5_DEC_CONTRAST 29 // Decrease picture contrast
+
119 #define RC5_SEARCH_UP 30 // Search up
+
120 #define RC5_DEC_TINT 31 // Decrease tint/hue
+
121 #define RC5_CHANNEL_UP 32 // Channel/program up
+
122 #define RC5_CHANNEL_DOWN 33 // Channel/program down
+
123 #define RC5_CHANNEL_LAST 34 // Last viewed channel/program
+
124 #define RC5_STEREO_SELECT 35 // Select stereo channel/language
+
125 #define RC5_STEREO_SPATIAL 36 // Spatial stereo
+
126 #define RC5_STEREO_TOGGLE 37 // Toggle stereo/mono
+
127 #define RC5_SLEEP_TIMER 38 // Sleep timer
+
128 #define RC5_INC_TINT 39 // Increase tint/hue
+
129 #define RC5_SWITCH_RF 40 // Switch RF inputs
+
130 #define RC5_STORE 41 // Store/vote
+
131 #define RC5_TIME 42 // Display time
+
132 #define RC5_INC_SCAN 43 // Scan forward/increment
+
133 #define RC5_DEC_SCAN 44 // Scan backward/decrement
+
134 #define RC5_SECONDARY_MENU 46 // Secondary menu
+
135 #define RC5_CLOCK 47 // Show clock
+
136 #define RC5_PAUSE 48 // Pause
+
137 #define RC5_ERASE 49 // Erase/correct entry
+
138 #define RC5_REWIND 50 // Rewind
+
139 #define RC5_GOTO 51 // Go to
+
140 #define RC5_WIND 52 // Wind (fast forward)
+
141 #define RC5_PLAY 53 // Play
+
142 #define RC5_STOP 54 // Stop
+
143 #define RC5_RECORD 55 // Record
+
144 #define RC5_EXTERNAL1 56 // External 1
+
145 #define RC5_EXTERNAL2 57 // External 2
+
146 #define RC5_VIEW_DATA 59 // View data, advance
+
147 #define RC5_12 60 // Channel 12 (or TXT/TV toggle)
+
148 #define RC5_SYSTEM_STANDBY 61 // System standby
+
149 #define RC5_CRISP 62 // Picture crispener (coutour boost)
+
150 #define RC5_AUDIO_RESPONSE 70 // Audio response for speech/music
+
151 #define RC5_SOUND_FUNCTIONS 79 // Select sound functions in sequence
+
152 #define RC5_PIP_SIZE 104 // Alter PIP size step-by-step
+
153 #define RC5_VISION_FUNCTIONS 105 // Select vision functions in sequence
+
154 #define RC5_COLOR_KEY 106 // Colored or other special key
+
155 #define RC5_RED 107 // Red button
+
156 #define RC5_GREEN 108 // Green button
+
157 #define RC5_YELLOW 109 // Yellow button
+
158 #define RC5_CYAN 110 // Cyan button
+
159 #define RC5_INDEX 111 // Index page/white function
+
160 #define RC5_NEXT_OPTION 112 // Next option
+
161 #define RC5_PREVIOUS_OPTION 113 // Previous option
+
162 #define RC5_STORE_OPEN_CLOSE 122 // Store open/close
+
163 #define RC5_PARENTAL_ACCESS 123 // Parental access via PIN code
+
164 
+
165 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
166 // Table 4b, TV1 and TV2 extension
+
167 #define RC5_DEFAULT_VIDEO 10 // Default video settings (TV1)
+
168 #define RC5_DEFAULT_AUDIO 11 // Default audio settings (TV1)
+
169 #define RC5_PAYTV_CHANNEL_UP 28 // Pay TV channel up (TV1)
+
170 #define RC5_PAYTV_CHANNEL_DOWN 29 // Pay TV channel down (TV1)
+
171 #define RC5_RADIO_CHANNEL_UP 30 // Radio channel up (TV1)
+
172 #define RC5_RADIO_CHANNEL_DOWN 31 // Radio channel down (TV1)
+
173 #define RC5_TILT_FORWARD 32 // Tilt cabinet forward (TV1)
+
174 #define RC5_TILT_BACKWARD 33 // Tilt cabinet backward (TV1)
+
175 #define RC5_EXTERNAL3 56 // External 3 (TV1)
+
176 #define RC5_EXTERNAL4 56 // External 4 (TV1)
+
177 #define RC5_PICTURE_FORMAT 62 // 4:3 vs 16:9 (TV1)
+
178 #define RC5_CHANNEL_10 67 // Channel 10
+
179 #define RC5_CHANNEL_11 68 // Channel 11
+
180 #define RC5_CHANNEL_12 69 // Channel 12
+
181 #define RC5_DEFAULT_VIDEO2 72 // Default video settings (TV2)
+
182 #define RC5_DEFAULT_AUDIO2 73 // Default audio settings (TV2)
+
183 #define RC5_PAYTV_CHANNEL_UP2 88 // Pay TV channel up (TV2)
+
184 #define RC5_PAYTV_CHANNEL_DOWN2 89 // Pay TV channel down (TV2)
+
185 #define RC5_RADIO_CHANNEL_UP2 90 // Radio channel up (TV2)
+
186 #define RC5_RADIO_CHANNEL_DOWN2 91 // Radio channel down (TV2)
+
187 #define RC5_TILT_FORWARD2 104 // Tilt cabinet forward (TV2)
+
188 #define RC5_TILT_BACKWARD2 105 // Tilt cabinet backward (TV2)
+
189 #define RC5_EXTERNAL3_2 120 // External 3 (TV2)
+
190 #define RC5_EXTERNAL4_2 121 // External 4 (TV2)
+
191 #define RC5_CHANNEL_MENU 122 // Channel setting menu
+
192 #define RC5_PICTURE_FORMAT2 126 // 4:3 vs 16:9 (TV2)
+
193 
+
194 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
195 // Table 5, Teletext commands
+
196 #define RC5_NEXT_PAGE 10 // Next page
+
197 #define RC5_PREVIOUS_PAGE 11 // Previous page
+
198 // RC5_STANDBY 12 // Standby
+
199 #define RC5_ENTER_PAGE_NUMBER 28 // Enter page number in memory
+
200 #define RC5_SEQ_DISPLAY 29 // Sequential display of pages
+
201 #define RC5_SEQ_DELETE 30 // Sequential display/deletion of pages
+
202 #define RC5_EXCHANGE 32 // Exchange (Antiope function)
+
203 #define RC5_MAIN_INDEX 33 // Main index
+
204 #define RC5_ROW_ZERO 34 // Row zero (Antiope function)
+
205 #define RC5_PRINT 38 // Print displayed page
+
206 #define RC5_MIX 39 // Mix Antiope/TV pictures
+
207 #define RC5_HOLD_PAGE 41 // Page hold
+
208 // RC5_TIME 42 // Display time
+
209 #define RC5_LARGE 43 // Large top/bottom/normal
+
210 #define RC5_REVEAL 44 // Reveal/conceal
+
211 #define RC5_TV_TXT 45 // TV/TXT
+
212 #define RC5_TV_TXT_SUBTITLE 46 // TV + TXT/subtitle
+
213 // RC5_ERASE 49 // Erase/correct entry
+
214 #define RC5_NEWS_FLASH 62 // News flash (Antiope function)
+
215 
+
216 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
217 // Table 6, LaserVision commands
+
218 #define RC5_PICTURE_NUMBER 10 // Display picture number/time
+
219 #define RC5_CHAPTER_NUMBER 11 // Display chapter number
+
220 // RC5_STANDBY 12 // Standby
+
221 // RC5_MUTE 13 // Master mute/de-mute
+
222 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
223 #define RC5_SHUFFLE 28 // Total shuffle play/repeat once
+
224 #define RC5_REPEAT 29 // Repeat continuously
+
225 #define RC5_SELECT_NEXT 30 // Select next option
+
226 #define RC5_FAST_REVERSE 31 // Fast run reverse
+
227 #define RC5_ENTRY 32 // Entry (prepare to program)
+
228 #define RC5_AUTO_STOP 33 // Auto-stop at pre-programmed point
+
229 #define RC5_SLOW_REVERSE 34 // Slow run reverse
+
230 #define RC5_STEREO_CHANNEL1 35 // Select stereo sound channel 1/language 1
+
231 #define RC5_STEREO_CHANNEL2 36 // Select stereo sound channel 2/language 2
+
232 #define RC5_DEC_STILL 37 // Still increment reverse
+
233 #define RC5_INC_SPEED 38 // Increase speed
+
234 #define RC5_DEC_SPEED 39 // Decrease speed
+
235 #define RC5_SLOW_FORWARD 40 // Slow run forward
+
236 #define RC5_INC_STILL 41 // Still increment forward
+
237 #define RC5_FAST_FORWARD 42 // Fast run forward
+
238 #define RC5_SEARCH_USER_CHOICE 43 // Automatic search for user choice
+
239 #define RC5_SEARCH_REVERSE 44 // Search in reverse
+
240 #define RC5_TRAY 45 // Open/close tray
+
241 #define RC5_SEARCH_FORWARD 46 // Search forward
+
242 #define RC5_PLAY_REVERSE 47 // Play reverse/play opposite sound track
+
243 // RC5_PAUSE 48 // Pause
+
244 // RC5_ERASE 49 // Erase/correct entry
+
245 // RC5_PLAY 53 // Play
+
246 // RC5_STOP 54 // Stop
+
247 #define RC5_CLEAR_MEMORY 58 // Clear memory all
+
248 #define RC5_FREEZE_SEGMENT 59 // Freeze segment(s) indicated by picture numbers.
+
249 #define RC5_TV_TXT_ALT 60 // TV/TXT toggle; RF switch (USA only)
+
250 #define RC5_CX 62 // CX 1, 2, 3; toggle for CX noise reduction
+
251 
+
252 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
253 // Table 11, Preamplifier commands
+
254 #define RC5_GEQ_L 10 // Graphic equalizer left
+
255 #define RC5_GEQ_R 11 // Graphic equalizer right
+
256 // RC5_STANDBY 12 // Standby
+
257 // RC5_MUTE 13 // Master mute/de-mute
+
258 // RC5_PREFERENCES 14 // Personal preference settings
+
259 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
260 #define RC5_GEQ_L_AND_R 28 // Graphic equalizer left and right
+
261 #define RC5_SPEAKER_SELECT 29 // Speaker select
+
262 #define RC5_SCRATCH_FILTER 30 // Scratch filter on/off
+
263 #define RC5_RUMBLE_FILTER 31 // Rumble filter on/off
+
264 #define RC5_INC_STEP 32 // Step function +
+
265 #define RC5_DEC_STEP 33 // Step function -
+
266 #define RC5_SIGNAL_PATH 34 // Signal path options
+
267 #define RC5_SPEAKER_A 35 // Speaker A on/off
+
268 #define RC5_SURROUND_OPTIONS 37 // Surround sound options
+
269 // RC5_SLEEP_TIMER 38 // Sleep timer
+
270 #define RC5_SPEAKER_B 39 // Speaker B on/off
+
271 #define RC5_SPEAKER_C 40 // Speaker C on/off
+
272 #define RC5_TIMER_PROGRAM 41 // Timer program mode
+
273 // RC5_TIME 42 // Display time
+
274 #define RC5_INC_TIMER 43 // Timer +
+
275 #define RC5_DEC_TIMER 44 // Timer -
+
276 #define RC5_TIMER_MEMORY 45 // Open timer memory
+
277 #define RC5_ACOUSTIC_CONTROL 46 // Open acoustic control setting memory
+
278 #define RC5_ACOUSTIC_SELECT 47 // Select acoustic settings in memory
+
279 // RC5_ERASE 49 // Erase/correct entry
+
280 // RC5_CLEAR_MEMORY 58 // Clear memory all
+
281 #define RC5_DYNAMIC_EXPAND 60 // Dynamic range expand
+
282 #define RC5_DYNAMIC_COMPRESS 62 // Dynamic range compress
+
283 #define RC5_SURROUND_SOUND 64 // Surround sound on/off
+
284 #define RC5_BALANCE_FRONT 65 // Balance front
+
285 #define RC5_BALANCE_REAR 66 // Balance rear
+
286 #define RC5_LINEAR_SOUND 79 // Scroll linear sound functions
+
287 #define RC5_RANDOM_NOISE 88 // Random noise generator on/off
+
288 #define RC5_TIMER 89 // Timer on/off
+
289 #define RC5_NEWS_TIMER 90 // News timer on/off
+
290 #define RC5_INC_CENTER_VOLUME 102 // Increase center channel volume
+
291 #define RC5_DEC_CENTER_VOLUME 103 // Decrease center channel volume
+
292 #define RC5_INC_DELAY_SURROUND 104 // Increase delay front to surround
+
293 #define RC5_DEC_DELAY_SURROUND 105 // Decrease delay front to surround
+
294 #define RC5_LINEAR_PHASE 106 // Linear phase
+
295 #define RC5_TAPE_MONITOR 122 // Tape monitor
+
296 
+
297 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
298 // Table 14, Compact disc player commands
+
299 #define RC5_LOCAL_CURSOR 10 // Scroll local display cursor
+
300 #define RC5_LOCAL_FUNCTION 11 // Scroll local display function
+
301 // RC5_STANDBY 12 // Standby
+
302 // RC5_MUTE 13 // Master mute/de-mute
+
303 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
304 // RC5_SHUFFLE 28 // Total shuffle play/repeat once
+
305 // RC5_REPEAT 29 // Repeat continuously
+
306 #define RC5_INC_SELECT 30 // Select increment
+
307 #define RC5_DEC_SELECT 31 // Select decrement
+
308 #define RC5_NEXT 32 // Next
+
309 #define RC5_PREVIOUS 33 // Previous
+
310 #define RC5_INDEX_NEXT 34 // Index next
+
311 #define RC5_INDEX_PREVIOUS 35 // Index previous
+
312 #define RC5_PLAY_PROGRAM 36 // Play/program
+
313 #define RC5_NOMINAL_SPEED 37 // Speed nominal
+
314 // RC5_INC_SPEED 38 // Increase speed
+
315 // RC5_DEC_SPEED 39 // Decrease speed
+
316 // RC5_STORE 41 // Store/vote
+
317 // RC5_INC_SCAN 43 // Scan forward/increment
+
318 // RC5_TRAY 45 // Open/close tray
+
319 #define RC5_CARTRIDGE 47 // Fast/select disc from catridge
+
320 // RC5_PAUSE 48 // Pause
+
321 // RC5_ERASE 49 // Erase/correct entry
+
322 // RC5_REWIND 50 // Rewind
+
323 // RC5_GOTO 51 // Go to
+
324 // RC5_WIND 52 // Wind (fast forward)
+
325 // RC5_PLAY 53 // Play
+
326 // RC5_STOP 54 // Stop
+
327 // RC5_CLEAR_MEMORY 58 // Clear memory all
+
328 #define RC5_REPEAT_AB 59 // Repeat program marked A/B
+
329 // RC5_DYNAMIC_EXPAND 60 // Dynamic range expand
+
330 // RC5_DYNAMIC_COMPRESS 62 // Dynamic range compress
+
331 #define RC5_DSP 91 // Digital signal processing on/off
+
332 #define RC5_DSP_MUSIC 92 // Music mode (DSP)
+
333 #define RC5_DSP_ACOUSTICS 93 // Select room acoustics (DSP)
+
334 #define RC5_DSP_JAZZ 94 // Jazz/s-hall effect (DSP)
+
335 #define RC5_DSP_POP 95 // Pop/s-hall effect (DSP)
+
336 #define RC5_DSP_CLASSIC 96 // Classic/church music for music/room mode (DSP)
+
337 #define RC5_DSP_EASY 97 // Easy/club music for music/room mode (DSP)
+
338 #define RC5_DSP_DISCO 98 // Disco/stadium music for music/room mode (DSP)
+
339 #define RC5_SECOND_FAVORITE 107 // Second favorite track selection
+
340 #define RC5_FAVORITE 108 // Favorite track selection
+
341 #define RC5_TITLE_INTO_MEMORY 109 // Title into memory
+
342 #define RC5_FADE 120 // Fade in/out audio
+
343 
+
344 #endif
+
+ + + + diff --git a/html/RNG_8cpp_source.html b/html/RNG_8cpp_source.html new file mode 100644 index 00000000..3f4be017 --- /dev/null +++ b/html/RNG_8cpp_source.html @@ -0,0 +1,380 @@ + + + + + + +ArduinoLibs: RNG.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RNG.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "RNG.h"
+
24 #include "NoiseSource.h"
+
25 #include "ChaCha.h"
+
26 #include "Crypto.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <Arduino.h>
+
29 #include <avr/eeprom.h>
+
30 #include <string.h>
+
31 
+
117 RNGClass RNG;
+
118 
+
124 // Number of ChaCha hash rounds to use for random number generation.
+
125 #define RNG_ROUNDS 20
+
126 
+
127 // Force a rekey after this many blocks of random data.
+
128 #define RNG_REKEY_BLOCKS 16
+
129 
+
130 // Maximum entropy credit that can be contained in the pool.
+
131 #define RNG_MAX_CREDITS 384
+
132 
+
135 // Tag for 256-bit ChaCha20 keys. This will always appear in the
+
136 // first 16 bytes of the block. The remaining 48 bytes are the seed.
+
137 static const char tagRNG[16] PROGMEM = {
+
138  'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
+
139  '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
+
140 };
+
141 
+
142 // Initialization seed. This is the ChaCha20 output of hashing
+
143 // "expand 32-byte k" followed by 48 bytes set to the numbers 1 to 48.
+
144 // The ChaCha20 output block is then truncated to the first 48 bytes.
+
145 //
+
146 // This value is intended to start the RNG in a semi-chaotic state if
+
147 // we don't have a previously saved seed in EEPROM.
+
148 static const uint8_t initRNG[48] PROGMEM = {
+
149  0xB0, 0x2A, 0xAE, 0x7D, 0xEE, 0xCB, 0xBB, 0xB1,
+
150  0xFC, 0x03, 0x6F, 0xDD, 0xDC, 0x7D, 0x76, 0x67,
+
151  0x0C, 0xE8, 0x1F, 0x0D, 0xA3, 0xA0, 0xAA, 0x1E,
+
152  0xB0, 0xBD, 0x72, 0x6B, 0x2B, 0x4C, 0x8A, 0x7E,
+
153  0x34, 0xFC, 0x37, 0x60, 0xF4, 0x1E, 0x22, 0xA0,
+
154  0x0B, 0xFB, 0x18, 0x84, 0x60, 0xA5, 0x77, 0x72
+
155 };
+
156 
+ +
168  : address(0)
+
169  , credits(0)
+
170  , firstSave(1)
+
171  , timer(0)
+
172  , timeout(3600000UL) // 1 hour in milliseconds
+
173  , count(0)
+
174 {
+
175 }
+
176 
+ +
181 {
+
182  clean(block);
+
183  clean(stream);
+
184 }
+
185 
+
202 void RNGClass::begin(const char *tag, int eepromAddress)
+
203 {
+
204  // Save the EEPROM address for use by save().
+
205  address = eepromAddress;
+
206 
+
207  // Initialize the ChaCha20 input block from the saved seed.
+
208  memcpy_P(block, tagRNG, sizeof(tagRNG));
+
209  memcpy_P(block + 4, initRNG, sizeof(initRNG));
+
210  if (eeprom_read_byte((const uint8_t *)address) == 'S') {
+
211  // We have a saved seed: XOR it with the initialization block.
+
212  for (int posn = 0; posn < 12; ++posn) {
+
213  block[posn + 4] ^=
+
214  eeprom_read_dword((const uint32_t *)(address + posn * 4 + 1));
+
215  }
+
216  }
+
217 
+
218  // No entropy credits for the saved seed.
+
219  credits = 0;
+
220 
+
221  // Trigger an automatic save once the entropy credits max out.
+
222  firstSave = 1;
+
223 
+
224  // Rekey the random number generator immediately.
+
225  rekey();
+
226 
+
227  // Stir in the supplied tag data but don't credit any entropy to it.
+
228  if (tag)
+
229  stir((const uint8_t *)tag, strlen(tag));
+
230 
+
231  // Re-save the seed to obliterate the previous value and to ensure
+
232  // that if the system is reset without a call to save() that we won't
+
233  // accidentally generate the same sequence of random data again.
+
234  save();
+
235 }
+
236 
+ +
250 {
+
251  #define MAX_NOISE_SOURCES (sizeof(noiseSources) / sizeof(noiseSources[0]))
+
252  if (count < MAX_NOISE_SOURCES)
+
253  noiseSources[count++] = &source;
+
254 }
+
255 
+
272 void RNGClass::setAutoSaveTime(uint16_t minutes)
+
273 {
+
274  if (!minutes)
+
275  minutes = 1; // Just in case.
+
276  timeout = ((uint32_t)minutes) * 60000U;
+
277 }
+
278 
+
296 void RNGClass::rand(uint8_t *data, size_t len)
+
297 {
+
298  // Decrease the amount of entropy in the pool.
+
299  if (len > (credits / 8))
+
300  credits = 0;
+
301  else
+
302  credits -= len * 8;
+
303 
+
304  // Generate the random data.
+
305  uint8_t count = 0;
+
306  while (len > 0) {
+
307  // Force a rekey if we have generated too many blocks in this request.
+
308  if (count >= RNG_REKEY_BLOCKS) {
+
309  rekey();
+
310  count = 1;
+
311  } else {
+
312  ++count;
+
313  }
+
314 
+
315  // Increment the low counter word and generate a new keystream block.
+
316  ++(block[12]);
+
317  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
318 
+
319  // Copy the data to the return buffer.
+
320  if (len < 64) {
+
321  memcpy(data, stream, len);
+
322  break;
+
323  } else {
+
324  memcpy(data, stream, 64);
+
325  data += 64;
+
326  len -= 64;
+
327  }
+
328  }
+
329 
+
330  // Force a rekey after every request.
+
331  rekey();
+
332 }
+
333 
+
373 bool RNGClass::available(size_t len) const
+
374 {
+
375  if (len >= (RNG_MAX_CREDITS / 8))
+
376  return credits >= RNG_MAX_CREDITS;
+
377  else
+
378  return len <= (credits / 8);
+
379 }
+
380 
+
406 void RNGClass::stir(const uint8_t *data, size_t len, unsigned int credit)
+
407 {
+
408  // Increase the entropy credit.
+
409  if ((credit / 8) >= len)
+
410  credit = len * 8;
+
411  if ((RNG_MAX_CREDITS - credits) > credit)
+
412  credits += credit;
+
413  else
+
414  credits = RNG_MAX_CREDITS;
+
415 
+
416  // Process the supplied input data.
+
417  if (len > 0) {
+
418  // XOR the data with the ChaCha input block in 48 byte
+
419  // chunks and rekey the ChaCha cipher for each chunk to mix
+
420  // the data in. This should scatter any "true entropy" in
+
421  // the input across the entire block.
+
422  while (len > 0) {
+
423  size_t templen = len;
+
424  if (templen > 48)
+
425  templen = 48;
+
426  uint8_t *output = ((uint8_t *)block) + 16;
+
427  len -= templen;
+
428  while (templen > 0) {
+
429  *output++ ^= *data++;
+
430  --templen;
+
431  }
+
432  rekey();
+
433  }
+
434  } else {
+
435  // There was no input data, so just force a rekey so we
+
436  // get some mixing of the state even without new data.
+
437  rekey();
+
438  }
+
439 
+
440  // Save if this is the first time we have reached max entropy.
+
441  // This provides some protection if the system is powered off before
+
442  // the first auto-save timeout occurs.
+
443  if (firstSave && credits >= RNG_MAX_CREDITS) {
+
444  firstSave = 0;
+
445  save();
+
446  }
+
447 }
+
448 
+ +
476 {
+
477  // Generate random data from the current state and save
+
478  // that as the seed. Then force a rekey.
+
479  ++(block[12]);
+
480  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
481  eeprom_write_block(stream, (void *)(address + 1), 48);
+
482  eeprom_update_byte((uint8_t *)address, 'S');
+
483  rekey();
+
484  timer = millis();
+
485 }
+
486 
+ +
494 {
+
495  // Stir in the entropy from all registered noise sources.
+
496  for (uint8_t posn = 0; posn < count; ++posn)
+
497  noiseSources[posn]->stir();
+
498 
+
499  // Save the seed if the auto-save timer has expired.
+
500  if ((millis() - timer) >= timeout)
+
501  save();
+
502 }
+
503 
+ +
524 {
+
525  clean(block);
+
526  clean(stream);
+
527  for (int posn = 0; posn < SEED_SIZE; ++posn)
+
528  eeprom_write_byte((uint8_t *)(address + posn), 0xFF);
+
529 }
+
530 
+
534 void RNGClass::rekey()
+
535 {
+
536  // Rekey the cipher for the next request by generating a new block.
+
537  // This is intended to make it difficult to wind the random number
+
538  // backwards if the state is captured later. The first 16 bytes of
+
539  // "block" remain set to "tagRNG".
+
540  ++(block[12]);
+
541  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
542  memcpy(block + 4, stream, 48);
+
543 
+
544  // Permute the high word of the counter using the system microsecond
+
545  // counter to introduce a little bit of non-stir randomness for each
+
546  // request. Note: If random data is requested on a predictable schedule
+
547  // then this may not help very much. It is still necessary to stir in
+
548  // high quality entropy data on a regular basis using stir().
+
549  block[13] ^= micros();
+
550 }
+
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:475
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:296
+
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:202
+
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
+
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:180
+
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:249
+
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:167
+
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:523
+
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:373
+
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:493
+
Pseudo random number generator suitable for cryptography.
Definition: RNG.h:31
+
static const int SEED_SIZE
Size of a saved random number seed in EEPROM space.
Definition: RNG.h:53
+
static void hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)
Executes the ChaCha hash core on an input memory block.
Definition: ChaCha.cpp:230
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:406
+
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:272
+
+ + + + diff --git a/html/RNG_8h_source.html b/html/RNG_8h_source.html new file mode 100644 index 00000000..38eeb55a --- /dev/null +++ b/html/RNG_8h_source.html @@ -0,0 +1,184 @@ + + + + + + +ArduinoLibs: RNG.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RNG.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_RNG_h
+
24 #define CRYPTO_RNG_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 class NoiseSource;
+
30 
+
31 class RNGClass
+
32 {
+
33 public:
+
34  RNGClass();
+
35  ~RNGClass();
+
36 
+
37  void begin(const char *tag, int eepromAddress);
+
38  void addNoiseSource(NoiseSource &source);
+
39 
+
40  void setAutoSaveTime(uint16_t minutes);
+
41 
+
42  void rand(uint8_t *data, size_t len);
+
43  bool available(size_t len) const;
+
44 
+
45  void stir(const uint8_t *data, size_t len, unsigned int credit = 0);
+
46 
+
47  void save();
+
48 
+
49  void loop();
+
50 
+
51  void destroy();
+
52 
+
53  static const int SEED_SIZE = 49;
+
54 
+
55 private:
+
56  uint32_t block[16];
+
57  uint32_t stream[16];
+
58  int address;
+
59  uint16_t credits : 15;
+
60  uint16_t firstSave : 1;
+
61  unsigned long timer;
+
62  unsigned long timeout;
+
63  NoiseSource *noiseSources[4];
+
64  uint8_t count;
+
65 
+
66  void rekey();
+
67 };
+
68 
+
69 extern RNGClass RNG;
+
70 
+
71 #endif
+
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:475
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:296
+
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:202
+
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
+
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:180
+
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:249
+
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:167
+
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:523
+
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:373
+
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:493
+
Pseudo random number generator suitable for cryptography.
Definition: RNG.h:31
+
static const int SEED_SIZE
Size of a saved random number seed in EEPROM space.
Definition: RNG.h:53
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:406
+
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:272
+
+ + + + diff --git a/html/RTC_8cpp_source.html b/html/RTC_8cpp_source.html new file mode 100644 index 00000000..83343adc --- /dev/null +++ b/html/RTC_8cpp_source.html @@ -0,0 +1,388 @@ + + + + + + +ArduinoLibs: RTC.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "RTC.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <stdlib.h>
+
30 #include <string.h>
+
31 
+
58 #define DEFAULT_BYTE_COUNT 43 // Default simulates DS1307 NVRAM size.
+
59 
+
60 #define MILLIS_PER_DAY 86400000UL
+
61 #define MILLIS_PER_SECOND 1000UL
+
62 #define MILLIS_PER_MINUTE 60000UL
+
63 #define MILLIS_PER_HOUR 3600000UL
+
64 
+
65 static uint8_t monthLengths[] = {
+
66  31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+
67 };
+
68 
+
69 static unsigned int monthOffsets[] = {
+
70  0,
+
71  31,
+
72  31 + 28,
+
73  31 + 28 + 31,
+
74  31 + 28 + 31 + 30,
+
75  31 + 28 + 31 + 30 + 31,
+
76  31 + 28 + 31 + 30 + 31 + 30,
+
77  31 + 28 + 31 + 30 + 31 + 30 + 31,
+
78  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
+
79  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
+
80  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
+
81  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
+
82 };
+
83 
+
84 inline bool isLeapYear(unsigned int year)
+
85 {
+
86  if ((year % 100) == 0)
+
87  return (year % 400) == 0;
+
88  else
+
89  return (year % 4) == 0;
+
90 }
+
91 
+
92 inline uint8_t monthLength(const RTCDate *date)
+
93 {
+
94  if (date->month != 2 || !isLeapYear(date->year))
+
95  return monthLengths[date->month - 1];
+
96  else
+
97  return 29;
+
98 }
+
99 
+ +
106  : midnight(millis() - 9 * MILLIS_PER_HOUR) // Simulated clock starts at 9am
+
107  , nvram(0)
+
108 {
+
109  // Start the simulated date at 1 Jan, 2000.
+
110  date.day = 1;
+
111  date.month = 1;
+
112  date.year = 2000;
+
113 
+
114  // Set all simulated alarms to 6am by default.
+
115  for (uint8_t index = 0; index < ALARM_COUNT; ++index) {
+
116  alarms[index].hour = 6;
+
117  alarms[index].minute = 0;
+
118  alarms[index].flags = 0;
+
119  }
+
120 }
+
121 
+
122 RTC::~RTC()
+
123 {
+
124  if (nvram)
+
125  free(nvram);
+
126 }
+
127 
+ +
135 {
+
136  return true;
+
137 }
+
138 
+
144 void RTC::readTime(RTCTime *value)
+
145 {
+
146  // Determine the number of seconds since the last midnight event.
+
147  unsigned long sinceMidnight = millis() - midnight;
+
148  if (sinceMidnight >= MILLIS_PER_DAY) {
+
149  // We have overflowed into the next day. Readjust midnight.
+
150  midnight += MILLIS_PER_DAY;
+
151  sinceMidnight -= MILLIS_PER_DAY;
+
152 
+
153  // Increment the simulated date.
+
154  adjustDays(&date, INCREMENT);
+
155  }
+
156  value->second = (uint8_t)(((sinceMidnight / MILLIS_PER_SECOND) % 60));
+
157  value->minute = (uint8_t)(((sinceMidnight / MILLIS_PER_MINUTE) % 60));
+
158  value->hour = (uint8_t)(sinceMidnight / MILLIS_PER_HOUR);
+
159 }
+
160 
+
169 void RTC::readDate(RTCDate *value)
+
170 {
+
171  *value = date;
+
172 }
+
173 
+
179 void RTC::writeTime(const RTCTime *value)
+
180 {
+
181  // Adjust the position of the last simulated midnight event.
+
182  unsigned long sinceMidnight =
+
183  value->second * MILLIS_PER_SECOND +
+
184  value->minute * MILLIS_PER_MINUTE +
+
185  value->hour * MILLIS_PER_HOUR;
+
186  midnight = millis() - sinceMidnight;
+
187 }
+
188 
+
194 void RTC::writeDate(const RTCDate *value)
+
195 {
+
196  date = *value;
+
197 }
+
198 
+
209 void RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
210 {
+
211  *value = alarms[alarmNum];
+
212 }
+
213 
+
224 void RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
225 {
+
226  alarms[alarmNum] = *value;
+
227 }
+
228 
+
235 int RTC::byteCount() const
+
236 {
+
237  return DEFAULT_BYTE_COUNT;
+
238 }
+
239 
+
247 uint8_t RTC::readByte(uint8_t offset)
+
248 {
+
249  if (nvram)
+
250  return nvram[offset];
+
251  else
+
252  return 0;
+
253 }
+
254 
+
262 void RTC::writeByte(uint8_t offset, uint8_t value)
+
263 {
+
264  if (nvram) {
+
265  nvram[offset] = value;
+
266  } else {
+
267  nvram = (uint8_t *)malloc(DEFAULT_BYTE_COUNT);
+
268  if (nvram) {
+
269  memset(nvram, 0, DEFAULT_BYTE_COUNT);
+
270  nvram[offset] = value;
+
271  }
+
272  }
+
273 }
+
274 
+ +
289 {
+
290  return NO_TEMPERATURE;
+
291 }
+
292 
+
313 void RTC::adjustDays(RTCDate *date, uint8_t flags)
+
314 {
+
315  if (flags & DECREMENT) {
+
316  --(date->day);
+
317  if (date->day == 0) {
+
318  if (!(flags & WRAP)) {
+
319  --(date->month);
+
320  if (date->month == 0)
+
321  date->month = 12;
+
322  }
+
323  date->day = monthLength(date);
+
324  }
+
325  } else {
+
326  ++(date->day);
+
327  if (date->day > monthLength(date)) {
+
328  if (!(flags & WRAP)) {
+
329  ++(date->month);
+
330  if (date->month == 13)
+
331  date->month = 1;
+
332  }
+
333  date->day = 1;
+
334  }
+
335  }
+
336 }
+
337 
+
343 void RTC::adjustMonths(RTCDate *date, uint8_t flags)
+
344 {
+
345  if (flags & DECREMENT) {
+
346  --(date->month);
+
347  if (date->month == 0) {
+
348  date->month = 12;
+
349  if (!(flags & WRAP) && date->year > 2000)
+
350  --(date->year);
+
351  }
+
352  } else {
+
353  ++(date->month);
+
354  if (date->month == 13) {
+
355  date->month = 1;
+
356  if (!(flags & WRAP) && date->year < 2099)
+
357  ++(date->year);
+
358  }
+
359  }
+
360  uint8_t len = monthLength(date);
+
361  if (date->day > len)
+
362  date->day = len;
+
363 }
+
364 
+
370 void RTC::adjustYears(RTCDate *date, uint8_t flags)
+
371 {
+
372  if (flags & DECREMENT) {
+
373  --(date->year);
+
374  if (date->year < 2000)
+
375  date->year = 2000;
+
376  } else {
+
377  ++(date->year);
+
378  if (date->year > 2099)
+
379  date->year = 2099;
+
380  }
+
381  uint8_t len = monthLength(date);
+
382  if (date->day > len)
+
383  date->day = len;
+
384 }
+
385 
+ +
400 {
+
401  // The +4 here adjusts for Jan 1, 2000 being a Saturday.
+
402  unsigned long daynum = date->day + 4;
+
403  daynum += monthOffsets[date->month - 1];
+
404  if (date->month > 2 && isLeapYear(date->year))
+
405  ++daynum;
+
406  daynum += 365UL * (date->year - 2000);
+
407  if (date->year > 2000)
+
408  daynum += ((date->year - 2001) / 4) + 1;
+
409  return (DayOfWeek)((daynum % 7) + 1);
+
410 }
+
411 
+
uint8_t month
Month of the year (1-12)
Definition: RTC.h:38
+
virtual void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: RTC.cpp:179
+
RTC()
Constructs a new realtime clock handler.
Definition: RTC.cpp:105
+
static DayOfWeek dayOfWeek(const RTCDate *date)
Returns the day of the week corresponding to date.
Definition: RTC.cpp:399
+
uint8_t minute
Minute within the hour (0-59)
Definition: RTC.h:31
+
virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: RTC.cpp:209
+
virtual void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: RTC.cpp:169
+
static const uint8_t DECREMENT
Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
Definition: RTC.h:92
+
DayOfWeek
Day of the week corresponding to a date.
Definition: RTC.h:58
+
virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: RTC.cpp:224
+
static const uint8_t ALARM_COUNT
Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
Definition: RTC.h:77
+
virtual void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: RTC.cpp:194
+
virtual int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: RTC.cpp:235
+
uint8_t hour
Hour of the day for the alarm (0-23).
Definition: RTC.h:46
+
static const int NO_TEMPERATURE
Value that is returned from readTemperature() if the realtime clock chip cannot determine the tempera...
Definition: RTC.h:86
+
uint8_t flags
Additional flags for the alarm.
Definition: RTC.h:49
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
unsigned int year
Year (4-digit)
Definition: RTC.h:37
+
virtual int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: RTC.cpp:288
+
virtual void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:262
+
static void adjustYears(RTCDate *date, uint8_t flags)
Adjusts date up or down one year according to flags.
Definition: RTC.cpp:370
+
uint8_t minute
Minute of the hour for the alarm (0-59).
Definition: RTC.h:47
+
static const uint8_t INCREMENT
Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
Definition: RTC.h:91
+
virtual uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:247
+
static void adjustDays(RTCDate *date, uint8_t flags)
Adjusts date up or down one day according to flags.
Definition: RTC.cpp:313
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
static void adjustMonths(RTCDate *date, uint8_t flags)
Adjusts date up or down one month according to flags.
Definition: RTC.cpp:343
+
uint8_t hour
Hour of the day (0-23)
Definition: RTC.h:30
+
uint8_t day
Day of the month (1-31)
Definition: RTC.h:39
+
uint8_t second
Second within the minute (0-59)
Definition: RTC.h:32
+
virtual bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: RTC.cpp:134
+
virtual void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: RTC.cpp:144
+
static const uint8_t WRAP
Wrap around to the beginning of the current month/year rather than advance to the next one...
Definition: RTC.h:93
+
+ + + + diff --git a/html/RTC_8h_source.html b/html/RTC_8h_source.html new file mode 100644 index 00000000..48fd84fc --- /dev/null +++ b/html/RTC_8h_source.html @@ -0,0 +1,245 @@ + + + + + + +ArduinoLibs: RTC.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef RTC_h
+
24 #define RTC_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 struct RTCTime
+
29 {
+
30  uint8_t hour;
+
31  uint8_t minute;
+
32  uint8_t second;
+
33 };
+
34 
+
35 struct RTCDate
+
36 {
+
37  unsigned int year;
+
38  uint8_t month;
+
39  uint8_t day;
+
40 };
+
41 
+
42 struct RTCAlarm
+
43 {
+
44  uint8_t day;
+
45  uint8_t dow;
+
46  uint8_t hour;
+
47  uint8_t minute;
+
48  uint8_t second;
+
49  uint8_t flags;
+
50 };
+
51 
+
52 class RTC
+
53 {
+
54 public:
+
55  RTC();
+
56  ~RTC();
+
57 
+
58  enum DayOfWeek
+
59  {
+
60  Monday = 1,
+
61  Tuesday,
+
62  Wednesday,
+
63  Thursday,
+
64  Friday,
+
65  Saturday,
+
66  Sunday,
+
67  };
+
68 
+
69  virtual bool hasUpdates();
+
70 
+
71  virtual void readTime(RTCTime *value);
+
72  virtual void readDate(RTCDate *value);
+
73 
+
74  virtual void writeTime(const RTCTime *value);
+
75  virtual void writeDate(const RTCDate *value);
+
76 
+
77  static const uint8_t ALARM_COUNT = 4;
+
78 
+
79  virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
80  virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
81 
+
82  virtual int byteCount() const;
+
83  virtual uint8_t readByte(uint8_t offset);
+
84  virtual void writeByte(uint8_t offset, uint8_t value);
+
85 
+
86  static const int NO_TEMPERATURE = 32767;
+
87 
+
88  virtual int readTemperature();
+
89 
+
90  // Flags for adjustDays(), adjustMonths(), and adjustYears().
+
91  static const uint8_t INCREMENT = 0x0000;
+
92  static const uint8_t DECREMENT = 0x0001;
+
93  static const uint8_t WRAP = 0x0002;
+
94 
+
95  static void adjustDays(RTCDate *date, uint8_t flags);
+
96  static void adjustMonths(RTCDate *date, uint8_t flags);
+
97  static void adjustYears(RTCDate *date, uint8_t flags);
+
98 
+
99  static DayOfWeek dayOfWeek(const RTCDate *date);
+
100 
+
101 private:
+
102  unsigned long midnight;
+
103  RTCDate date;
+
104  RTCAlarm alarms[ALARM_COUNT];
+
105  uint8_t *nvram;
+
106 };
+
107 
+
108 #endif
+
uint8_t month
Month of the year (1-12)
Definition: RTC.h:38
+
virtual void writeTime(const RTCTime *value)
Updates the time in the realtime clock to match value.
Definition: RTC.cpp:179
+
RTC()
Constructs a new realtime clock handler.
Definition: RTC.cpp:105
+
static DayOfWeek dayOfWeek(const RTCDate *date)
Returns the day of the week corresponding to date.
Definition: RTC.cpp:399
+
uint8_t minute
Minute within the hour (0-59)
Definition: RTC.h:31
+
virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value)
Reads the details of the alarm with index alarmNum into value.
Definition: RTC.cpp:209
+
virtual void readDate(RTCDate *value)
Reads the current date from the realtime clock into value.
Definition: RTC.cpp:169
+
uint8_t day
Day of the month for the alarm if not zero.
Definition: RTC.h:44
+
static const uint8_t DECREMENT
Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
Definition: RTC.h:92
+
DayOfWeek
Day of the week corresponding to a date.
Definition: RTC.h:58
+
virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
Updates the details of the alarm with index alarmNum from value.
Definition: RTC.cpp:224
+
static const uint8_t ALARM_COUNT
Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
Definition: RTC.h:77
+
virtual void writeDate(const RTCDate *value)
Updates the date in the realtime clock to match value.
Definition: RTC.cpp:194
+
virtual int byteCount() const
Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings...
Definition: RTC.cpp:235
+
uint8_t hour
Hour of the day for the alarm (0-23).
Definition: RTC.h:46
+
static const int NO_TEMPERATURE
Value that is returned from readTemperature() if the realtime clock chip cannot determine the tempera...
Definition: RTC.h:86
+
uint8_t flags
Additional flags for the alarm.
Definition: RTC.h:49
+
uint8_t dow
Day of the week for the alarm if not zero.
Definition: RTC.h:45
+
Stores date information from a realtime clock chip.
Definition: RTC.h:35
+
unsigned int year
Year (4-digit)
Definition: RTC.h:37
+
virtual int readTemperature()
Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius...
Definition: RTC.cpp:288
+
virtual void writeByte(uint8_t offset, uint8_t value)
Writes value to offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:262
+
static void adjustYears(RTCDate *date, uint8_t flags)
Adjusts date up or down one year according to flags.
Definition: RTC.cpp:370
+
uint8_t minute
Minute of the hour for the alarm (0-59).
Definition: RTC.h:47
+
static const uint8_t INCREMENT
Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
Definition: RTC.h:91
+
virtual uint8_t readByte(uint8_t offset)
Reads the byte at offset within the realtime clock's non-volatile memory.
Definition: RTC.cpp:247
+
static void adjustDays(RTCDate *date, uint8_t flags)
Adjusts date up or down one day according to flags.
Definition: RTC.cpp:313
+
uint8_t second
Second of the minute for the alarm (0-59).
Definition: RTC.h:48
+
Stores time information from a realtime clock chip.
Definition: RTC.h:28
+
Stores alarm information from a realtime clock chip.
Definition: RTC.h:42
+
static void adjustMonths(RTCDate *date, uint8_t flags)
Adjusts date up or down one month according to flags.
Definition: RTC.cpp:343
+
uint8_t hour
Hour of the day (0-23)
Definition: RTC.h:30
+
uint8_t day
Day of the month (1-31)
Definition: RTC.h:39
+
uint8_t second
Second within the minute (0-59)
Definition: RTC.h:32
+
virtual bool hasUpdates()
Returns true if the realtime clock has updated since the last call to this function.
Definition: RTC.cpp:134
+
virtual void readTime(RTCTime *value)
Reads the current time from the realtime clock into value.
Definition: RTC.cpp:144
+
Base class for realtime clock handlers.
Definition: RTC.h:52
+
static const uint8_t WRAP
Wrap around to the beginning of the current month/year rather than advance to the next one...
Definition: RTC.h:93
+
+ + + + diff --git a/html/RingOscillatorNoiseSource_8cpp_source.html b/html/RingOscillatorNoiseSource_8cpp_source.html new file mode 100644 index 00000000..d7c59680 --- /dev/null +++ b/html/RingOscillatorNoiseSource_8cpp_source.html @@ -0,0 +1,293 @@ + + + + + + +ArduinoLibs: RingOscillatorNoiseSource.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RingOscillatorNoiseSource.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "RingOscillatorNoiseSource.h"
+
24 #include "Crypto.h"
+
25 #include "RNG.h"
+
26 #include <Arduino.h>
+
27 
+
100 // Choose the input capture timer and pin to use for this board.
+
101 #if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
+
102 // Arduino Mega or Mega 2560 - input capture on TIMER4 and D49/PL0.
+
103 #define RING_TIMER 4
+
104 #define RING_PIN 49
+
105 #define RING_CAPT_vect TIMER4_CAPT_vect
+
106 #define RING_ICR ICR4
+
107 #elif defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
+
108 // Arduino Leonardo - input capture on Timer1 and D4/PD4.
+
109 #define RING_TIMER 1
+
110 #define RING_PIN 4
+
111 #define RING_CAPT_vect TIMER1_CAPT_vect
+
112 #define RING_ICR ICR1
+
113 #else
+
114 // Assuming Arduino Uno or equivalent - input capture on TIMER1 and D8/PB0.
+
115 #define RING_TIMER 1
+
116 #define RING_PIN 8
+
117 #define RING_CAPT_vect TIMER1_CAPT_vect
+
118 #define RING_ICR ICR1
+
119 #endif
+
120 
+
121 // Calibration states.
+
122 #define NOISE_NOT_CALIBRATING 0
+
123 #define NOISE_CALIBRATING 1
+
124 
+
125 // If there is no capture event for this many milliseconds,
+
126 // then assume that the oscillator is stopped or disconnected.
+
127 #define RING_DISCONNECT_TIME 200
+
128 
+
129 RingOscillatorNoiseSource::RingOscillatorNoiseSource()
+
130  : calState(NOISE_CALIBRATING)
+
131  , lastSignal(millis())
+
132 {
+
133  // Initialize the bit collection routines.
+
134  restart();
+
135 
+
136  // Set up the capture pin as an input with no pull-ups.
+
137  pinMode(RING_PIN, INPUT);
+
138  digitalWrite(RING_PIN, LOW);
+
139 
+
140 #if RING_TIMER == 1
+
141  // Set up TIMER1 to perform input capture on PB8/D8.
+
142  TCCR1B = 0; // Turn off TIMER1.
+
143  TIMSK1 = 0; // Turn off TIMER1 interrupts.
+
144  TCNT1 = 0; // Zero the timer.
+
145  TCCR1A = 0; // Turn off output compare.
+
146  TCCR1B |= (1 << ICES1); // Input capture on rising edge.
+
147  TIMSK1 |= (1 << ICIE1); // Input capture interrupts enabled.
+
148 
+
149  // Start TIMER1 at the highest frequency with no prescaling.
+
150  TCCR1B |= (1 << CS10);
+
151 #elif RING_TIMER == 4
+
152  // Set up TIMER4 to perform input capture on PL0/D49.
+
153  TCCR4B = 0; // Turn off TIMER4.
+
154  TIMSK4 = 0; // Turn off TIMER4 interrupts.
+
155  TCNT4 = 0; // Zero the timer.
+
156  TCCR4A = 0; // Turn off output compare.
+
157  TCCR4B |= (1 << ICES4); // Input capture on rising edge.
+
158  TIMSK4 |= (1 << ICIE4); // Input capture interrupts enabled.
+
159 
+
160  // Start TIMER4 at the highest frequency with no prescaling.
+
161  TCCR4B |= (1 << CS10);
+
162 #endif
+
163 }
+
164 
+
165 RingOscillatorNoiseSource::~RingOscillatorNoiseSource()
+
166 {
+
167  // Turn off the capture timer.
+
168 #if RING_TIMER == 1
+
169  TCCR1B = 0;
+
170 #elif RING_TIMER == 4
+
171  TCCR4B = 0;
+
172 #endif
+
173 
+
174  // Clean up.
+
175  clean(buffer);
+
176 }
+
177 
+ +
179 {
+
180  return calState == NOISE_CALIBRATING;
+
181 }
+
182 
+
183 static uint16_t volatile out = 0;
+
184 static uint8_t volatile outBits = 0;
+
185 
+
186 // Interrupt service routine for the timer's input capture interrupt.
+
187 ISR(RING_CAPT_vect)
+
188 {
+
189  // We are interested in the jitter; that is the difference in
+
190  // time between one rising edge and the next in the signal.
+
191  // Extract a single bit from the jitter and add it to the
+
192  // rolling "out" buffer for the main code to process later.
+
193  // If the buffer overflows, we discard bits and keep going.
+
194  static uint16_t prev = 0;
+
195  uint16_t next = RING_ICR;
+
196  out = (out << 1) | ((next - prev) & 1);
+
197  prev = next;
+
198  ++outBits;
+
199 }
+
200 
+ +
202 {
+
203  // If the "out" buffer is full, then convert the bits. Turn off
+
204  // interrupts while we read the "out" buffer and reset "outBits".
+
205  unsigned long now = millis();
+
206  cli();
+
207  if (outBits >= 16) {
+
208  uint16_t bits = out;
+
209  outBits = 0;
+
210  sei();
+
211  for (uint8_t index = 0; index < 8; ++index) {
+
212  // Collect two bits of input and remove bias using the Von Neumann
+
213  // method. If both bits are the same, then discard both.
+
214  // Otherwise choose one of the bits and output that one.
+
215  // We have to do this carefully so that instruction timing does
+
216  // not reveal the value of the bit that is chosen.
+
217  if ((bits ^ (bits << 1)) & 0x8000) {
+
218  // The bits are different: add the top-most to the buffer.
+
219  if (posn < sizeof(buffer)) {
+
220  buffer[posn] = (buffer[posn] >> 1) |
+
221  (((uint8_t)(bits >> 8)) & (uint8_t)0x80);
+
222  if (++bitNum >= 8) {
+
223  ++posn;
+
224  bitNum = 0;
+
225  }
+
226  }
+
227  }
+
228  bits = bits << 2;
+
229  }
+
230  } else {
+
231  // The "out" buffer isn't full yet. Re-enable interrupts.
+
232  sei();
+
233 
+
234  // If it has been too long since the last useful block,
+
235  // then go back to calibrating. The oscillator may be
+
236  // stopped or disconnected.
+
237  if (calState == NOISE_NOT_CALIBRATING) {
+
238  if ((now - lastSignal) >= RING_DISCONNECT_TIME) {
+
239  restart();
+
240  calState = NOISE_CALIBRATING;
+
241  }
+
242  }
+
243  }
+
244 
+
245  // If the buffer is full, then stir it into the random number pool.
+
246  // We credit 1 bit of entropy for every 8 bits of output because
+
247  // ring oscillators aren't quite as good as a true noise source.
+
248  // We have to collect a lot more data to get something random enough.
+
249  if (posn >= sizeof(buffer)) {
+
250  output(buffer, posn, posn);
+
251  restart();
+
252  calState = NOISE_NOT_CALIBRATING;
+
253  lastSignal = now;
+
254  }
+
255 }
+
256 
+
257 void RingOscillatorNoiseSource::restart()
+
258 {
+
259  clean(buffer);
+
260  prevBit = 0;
+
261  posn = 0;
+
262  bitNum = 0;
+
263 }
+
void stir()
Stirs entropy from this noise source into the global random number pool.
+
bool calibrating() const
Determine if the noise source is still calibrating itself.
+
virtual void output(const uint8_t *data, size_t len, unsigned int credit)
Called from subclasses to output noise to the global random number pool.
+
+ + + + diff --git a/html/RingOscillatorNoiseSource_8h_source.html b/html/RingOscillatorNoiseSource_8h_source.html new file mode 100644 index 00000000..9925c451 --- /dev/null +++ b/html/RingOscillatorNoiseSource_8h_source.html @@ -0,0 +1,153 @@ + + + + + + +ArduinoLibs: RingOscillatorNoiseSource.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RingOscillatorNoiseSource.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_RINGOSCILLATORNOISESOURCE_H
+
24 #define CRYPTO_RINGOSCILLATORNOISESOURCE_H
+
25 
+
26 #include <inttypes.h>
+
27 #include "NoiseSource.h"
+
28 
+ +
30 {
+
31 public:
+ +
33  virtual ~RingOscillatorNoiseSource();
+
34 
+
35  bool calibrating() const;
+
36 
+
37  void stir();
+
38 
+
39 private:
+
40  uint8_t prevBit;
+
41  uint8_t posn;
+
42  uint8_t bitNum;
+
43  uint8_t calState;
+
44  uint8_t buffer[32];
+
45  unsigned long lastSignal;
+
46 
+
47  void restart();
+
48 };
+
49 
+
50 #endif
+
void stir()
Stirs entropy from this noise source into the global random number pool.
+
bool calibrating() const
Determine if the noise source is still calibrating itself.
+
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
+
Processes the signal from a ring oscillator based noise source.
+
+ + + + diff --git a/html/SHA1_8cpp_source.html b/html/SHA1_8cpp_source.html new file mode 100644 index 00000000..f89abaad --- /dev/null +++ b/html/SHA1_8cpp_source.html @@ -0,0 +1,331 @@ + + + + + + +ArduinoLibs: SHA1.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA1.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SHA1.h"
+
24 #include "Crypto.h"
+
25 #include "utility/RotateUtil.h"
+
26 #include "utility/EndianUtil.h"
+
27 #include <string.h>
+
28 
+ +
42 {
+
43  reset();
+
44 }
+
45 
+ +
50 {
+
51  clean(state);
+
52 }
+
53 
+
54 size_t SHA1::hashSize() const
+
55 {
+
56  return 20;
+
57 }
+
58 
+
59 size_t SHA1::blockSize() const
+
60 {
+
61  return 64;
+
62 }
+
63 
+ +
65 {
+
66  state.h[0] = 0x67452301;
+
67  state.h[1] = 0xEFCDAB89;
+
68  state.h[2] = 0x98BADCFE;
+
69  state.h[3] = 0x10325476;
+
70  state.h[4] = 0xC3D2E1F0;
+
71  state.chunkSize = 0;
+
72  state.length = 0;
+
73 }
+
74 
+
75 void SHA1::update(const void *data, size_t len)
+
76 {
+
77  // Update the total length (in bits, not bytes).
+
78  state.length += ((uint64_t)len) << 3;
+
79 
+
80  // Break the input up into 512-bit chunks and process each in turn.
+
81  const uint8_t *d = (const uint8_t *)data;
+
82  while (len > 0) {
+
83  uint8_t size = 64 - state.chunkSize;
+
84  if (size > len)
+
85  size = len;
+
86  memcpy(((uint8_t *)state.w) + state.chunkSize, d, size);
+
87  state.chunkSize += size;
+
88  len -= size;
+
89  d += size;
+
90  if (state.chunkSize == 64) {
+
91  processChunk();
+
92  state.chunkSize = 0;
+
93  }
+
94  }
+
95 }
+
96 
+
97 void SHA1::finalize(void *hash, size_t len)
+
98 {
+
99  // Pad the last chunk. We may need two padding chunks if there
+
100  // isn't enough room in the first for the padding and length.
+
101  uint8_t *wbytes = (uint8_t *)state.w;
+
102  if (state.chunkSize <= (64 - 9)) {
+
103  wbytes[state.chunkSize] = 0x80;
+
104  memset(wbytes + state.chunkSize + 1, 0x00, 64 - 8 - (state.chunkSize + 1));
+
105  state.w[14] = htobe32((uint32_t)(state.length >> 32));
+
106  state.w[15] = htobe32((uint32_t)state.length);
+
107  processChunk();
+
108  } else {
+
109  wbytes[state.chunkSize] = 0x80;
+
110  memset(wbytes + state.chunkSize + 1, 0x00, 64 - (state.chunkSize + 1));
+
111  processChunk();
+
112  memset(wbytes, 0x00, 64 - 8);
+
113  state.w[14] = htobe32((uint32_t)(state.length >> 32));
+
114  state.w[15] = htobe32((uint32_t)state.length);
+
115  processChunk();
+
116  }
+
117 
+
118  // Convert the result into big endian and return it.
+
119  for (uint8_t posn = 0; posn < 5; ++posn)
+
120  state.w[posn] = htobe32(state.h[posn]);
+
121 
+
122  // Copy the hash to the caller's return buffer.
+
123  if (len > 20)
+
124  len = 20;
+
125  memcpy(hash, state.w, len);
+
126 }
+
127 
+ +
129 {
+
130  clean(state);
+
131  reset();
+
132 }
+
133 
+
134 void SHA1::resetHMAC(const void *key, size_t keyLen)
+
135 {
+
136  formatHMACKey(state.w, key, keyLen, 0x36);
+
137  state.length += 64 * 8;
+
138  processChunk();
+
139 }
+
140 
+
141 void SHA1::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
142 {
+
143  uint8_t temp[20];
+
144  finalize(temp, sizeof(temp));
+
145  formatHMACKey(state.w, key, keyLen, 0x5C);
+
146  state.length += 64 * 8;
+
147  processChunk();
+
148  update(temp, sizeof(temp));
+
149  finalize(hash, hashLen);
+
150  clean(temp);
+
151 }
+
152 
+
158 void SHA1::processChunk()
+
159 {
+
160  uint8_t index;
+
161 
+
162  // Convert the first 16 words from big endian to host byte order.
+
163  for (index = 0; index < 16; ++index)
+
164  state.w[index] = be32toh(state.w[index]);
+
165 
+
166  // Initialize the hash value for this chunk.
+
167  uint32_t a = state.h[0];
+
168  uint32_t b = state.h[1];
+
169  uint32_t c = state.h[2];
+
170  uint32_t d = state.h[3];
+
171  uint32_t e = state.h[4];
+
172 
+
173  // Perform the first 16 rounds of the compression function main loop.
+
174  uint32_t temp;
+
175  for (index = 0; index < 16; ++index) {
+
176  temp = leftRotate5(a) + ((b & c) | ((~b) & d)) + e + 0x5A827999 + state.w[index];
+
177  e = d;
+
178  d = c;
+
179  c = leftRotate30(b);
+
180  b = a;
+
181  a = temp;
+
182  }
+
183 
+
184  // Perform the 64 remaining rounds. We expand the first 16 words to
+
185  // 80 in-place in the "w" array. This saves 256 bytes of memory
+
186  // that would have otherwise need to be allocated to the "w" array.
+
187  for (; index < 20; ++index) {
+
188  temp = state.w[index & 0x0F] = leftRotate1
+
189  (state.w[(index - 3) & 0x0F] ^ state.w[(index - 8) & 0x0F] ^
+
190  state.w[(index - 14) & 0x0F] ^ state.w[(index - 16) & 0x0F]);
+
191  temp = leftRotate5(a) + ((b & c) | ((~b) & d)) + e + 0x5A827999 + temp;
+
192  e = d;
+
193  d = c;
+
194  c = leftRotate30(b);
+
195  b = a;
+
196  a = temp;
+
197  }
+
198  for (; index < 40; ++index) {
+
199  temp = state.w[index & 0x0F] = leftRotate1
+
200  (state.w[(index - 3) & 0x0F] ^ state.w[(index - 8) & 0x0F] ^
+
201  state.w[(index - 14) & 0x0F] ^ state.w[(index - 16) & 0x0F]);
+
202  temp = leftRotate5(a) + (b ^ c ^ d) + e + 0x6ED9EBA1 + temp;
+
203  e = d;
+
204  d = c;
+
205  c = leftRotate30(b);
+
206  b = a;
+
207  a = temp;
+
208  }
+
209  for (; index < 60; ++index) {
+
210  temp = state.w[index & 0x0F] = leftRotate1
+
211  (state.w[(index - 3) & 0x0F] ^ state.w[(index - 8) & 0x0F] ^
+
212  state.w[(index - 14) & 0x0F] ^ state.w[(index - 16) & 0x0F]);
+
213  temp = leftRotate5(a) + ((b & c) | (b & d) | (c & d)) + e + 0x8F1BBCDC + temp;
+
214  e = d;
+
215  d = c;
+
216  c = leftRotate30(b);
+
217  b = a;
+
218  a = temp;
+
219  }
+
220  for (; index < 80; ++index) {
+
221  temp = state.w[index & 0x0F] = leftRotate1
+
222  (state.w[(index - 3) & 0x0F] ^ state.w[(index - 8) & 0x0F] ^
+
223  state.w[(index - 14) & 0x0F] ^ state.w[(index - 16) & 0x0F]);
+
224  temp = leftRotate5(a) + (b ^ c ^ d) + e + 0xCA62C1D6 + temp;
+
225  e = d;
+
226  d = c;
+
227  c = leftRotate30(b);
+
228  b = a;
+
229  a = temp;
+
230  }
+
231 
+
232  // Add this chunk's hash to the result so far.
+
233  state.h[0] += a;
+
234  state.h[1] += b;
+
235  state.h[2] += c;
+
236  state.h[3] += d;
+
237  state.h[4] += e;
+
238 
+
239  // Attempt to clean up the stack.
+
240  a = b = c = d = e = temp = 0;
+
241 }
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA1.cpp:134
+
virtual ~SHA1()
Destroys this SHA-1 hash object after clearing sensitive information.
Definition: SHA1.cpp:49
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA1.cpp:64
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA1.cpp:75
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA1.cpp:128
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA1.cpp:59
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA1.cpp:97
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA1.cpp:141
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA1.cpp:54
+
SHA1()
Constructs a SHA-1 hash object.
Definition: SHA1.cpp:41
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
+ + + + diff --git a/html/SHA1_8h_source.html b/html/SHA1_8h_source.html new file mode 100644 index 00000000..06b20691 --- /dev/null +++ b/html/SHA1_8h_source.html @@ -0,0 +1,168 @@ + + + + + + +ArduinoLibs: SHA1.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA1.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_SHA1_h
+
24 #define CRYPTO_SHA1_h
+
25 
+
26 #include "Hash.h"
+
27 
+
28 class SHA1 : public Hash
+
29 {
+
30 public:
+
31  SHA1();
+
32  virtual ~SHA1();
+
33 
+
34  size_t hashSize() const;
+
35  size_t blockSize() const;
+
36 
+
37  void reset();
+
38  void update(const void *data, size_t len);
+
39  void finalize(void *hash, size_t len);
+
40 
+
41  void clear();
+
42 
+
43  void resetHMAC(const void *key, size_t keyLen);
+
44  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
45 
+
46 private:
+
47  struct {
+
48  uint32_t h[5];
+
49  uint32_t w[16];
+
50  uint64_t length;
+
51  uint8_t chunkSize;
+
52  } state;
+
53 
+
54  void processChunk();
+
55 };
+
56 
+
57 #endif
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA1.cpp:134
+
virtual ~SHA1()
Destroys this SHA-1 hash object after clearing sensitive information.
Definition: SHA1.cpp:49
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA1.cpp:64
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA1.cpp:75
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA1.cpp:128
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA1.cpp:59
+
SHA-1 hash algorithm.
Definition: SHA1.h:28
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA1.cpp:97
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA1.cpp:141
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA1.cpp:54
+
SHA1()
Constructs a SHA-1 hash object.
Definition: SHA1.cpp:41
+
+ + + + diff --git a/html/SHA256_8cpp_source.html b/html/SHA256_8cpp_source.html new file mode 100644 index 00000000..73bac9de --- /dev/null +++ b/html/SHA256_8cpp_source.html @@ -0,0 +1,347 @@ + + + + + + +ArduinoLibs: SHA256.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA256.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SHA256.h"
+
24 #include "Crypto.h"
+
25 #include "utility/RotateUtil.h"
+
26 #include "utility/EndianUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+ +
43 {
+
44  reset();
+
45 }
+
46 
+ +
52 {
+
53  clean(state);
+
54 }
+
55 
+
56 size_t SHA256::hashSize() const
+
57 {
+
58  return 32;
+
59 }
+
60 
+
61 size_t SHA256::blockSize() const
+
62 {
+
63  return 64;
+
64 }
+
65 
+ +
67 {
+
68  state.h[0] = 0x6a09e667;
+
69  state.h[1] = 0xbb67ae85;
+
70  state.h[2] = 0x3c6ef372;
+
71  state.h[3] = 0xa54ff53a,
+
72  state.h[4] = 0x510e527f;
+
73  state.h[5] = 0x9b05688c;
+
74  state.h[6] = 0x1f83d9ab;
+
75  state.h[7] = 0x5be0cd19;
+
76  state.chunkSize = 0;
+
77  state.length = 0;
+
78 }
+
79 
+
80 void SHA256::update(const void *data, size_t len)
+
81 {
+
82  // Update the total length (in bits, not bytes).
+
83  state.length += ((uint64_t)len) << 3;
+
84 
+
85  // Break the input up into 512-bit chunks and process each in turn.
+
86  const uint8_t *d = (const uint8_t *)data;
+
87  while (len > 0) {
+
88  uint8_t size = 64 - state.chunkSize;
+
89  if (size > len)
+
90  size = len;
+
91  memcpy(((uint8_t *)state.w) + state.chunkSize, d, size);
+
92  state.chunkSize += size;
+
93  len -= size;
+
94  d += size;
+
95  if (state.chunkSize == 64) {
+
96  processChunk();
+
97  state.chunkSize = 0;
+
98  }
+
99  }
+
100 }
+
101 
+
102 void SHA256::finalize(void *hash, size_t len)
+
103 {
+
104  // Pad the last chunk. We may need two padding chunks if there
+
105  // isn't enough room in the first for the padding and length.
+
106  uint8_t *wbytes = (uint8_t *)state.w;
+
107  if (state.chunkSize <= (64 - 9)) {
+
108  wbytes[state.chunkSize] = 0x80;
+
109  memset(wbytes + state.chunkSize + 1, 0x00, 64 - 8 - (state.chunkSize + 1));
+
110  state.w[14] = htobe32((uint32_t)(state.length >> 32));
+
111  state.w[15] = htobe32((uint32_t)state.length);
+
112  processChunk();
+
113  } else {
+
114  wbytes[state.chunkSize] = 0x80;
+
115  memset(wbytes + state.chunkSize + 1, 0x00, 64 - (state.chunkSize + 1));
+
116  processChunk();
+
117  memset(wbytes, 0x00, 64 - 8);
+
118  state.w[14] = htobe32((uint32_t)(state.length >> 32));
+
119  state.w[15] = htobe32((uint32_t)state.length);
+
120  processChunk();
+
121  }
+
122 
+
123  // Convert the result into big endian and return it.
+
124  for (uint8_t posn = 0; posn < 8; ++posn)
+
125  state.w[posn] = htobe32(state.h[posn]);
+
126 
+
127  // Copy the hash to the caller's return buffer.
+
128  if (len > 32)
+
129  len = 32;
+
130  memcpy(hash, state.w, len);
+
131 }
+
132 
+ +
134 {
+
135  clean(state);
+
136  reset();
+
137 }
+
138 
+
139 void SHA256::resetHMAC(const void *key, size_t keyLen)
+
140 {
+
141  formatHMACKey(state.w, key, keyLen, 0x36);
+
142  state.length += 64 * 8;
+
143  processChunk();
+
144 }
+
145 
+
146 void SHA256::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
147 {
+
148  uint8_t temp[32];
+
149  finalize(temp, sizeof(temp));
+
150  formatHMACKey(state.w, key, keyLen, 0x5C);
+
151  state.length += 64 * 8;
+
152  processChunk();
+
153  update(temp, sizeof(temp));
+
154  finalize(hash, hashLen);
+
155  clean(temp);
+
156 }
+
157 
+
163 void SHA256::processChunk()
+
164 {
+
165  // Round constants for SHA-256.
+
166  static uint32_t const k[64] PROGMEM = {
+
167  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
+
168  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+
169  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+
170  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+
171  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
+
172  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+
173  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
+
174  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+
175  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+
176  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+
177  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
+
178  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+
179  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
+
180  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+
181  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+
182  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+
183  };
+
184 
+
185  // Convert the first 16 words from big endian to host byte order.
+
186  uint8_t index;
+
187  for (index = 0; index < 16; ++index)
+
188  state.w[index] = be32toh(state.w[index]);
+
189 
+
190  // Initialise working variables to the current hash value.
+
191  uint32_t a = state.h[0];
+
192  uint32_t b = state.h[1];
+
193  uint32_t c = state.h[2];
+
194  uint32_t d = state.h[3];
+
195  uint32_t e = state.h[4];
+
196  uint32_t f = state.h[5];
+
197  uint32_t g = state.h[6];
+
198  uint32_t h = state.h[7];
+
199 
+
200  // Perform the first 16 rounds of the compression function main loop.
+
201  uint32_t temp1, temp2;
+
202  for (index = 0; index < 16; ++index) {
+
203  temp1 = h + pgm_read_dword(k + index) + state.w[index] +
+
204  (rightRotate6(e) ^ rightRotate11(e) ^ rightRotate25(e)) +
+
205  ((e & f) ^ ((~e) & g));
+
206  temp2 = (rightRotate2(a) ^ rightRotate13(a) ^ rightRotate22(a)) +
+
207  ((a & b) ^ (a & c) ^ (b & c));
+
208  h = g;
+
209  g = f;
+
210  f = e;
+
211  e = d + temp1;
+
212  d = c;
+
213  c = b;
+
214  b = a;
+
215  a = temp1 + temp2;
+
216  }
+
217 
+
218  // Perform the 48 remaining rounds. We expand the first 16 words to
+
219  // 64 in-place in the "w" array. This saves 192 bytes of memory
+
220  // that would have otherwise need to be allocated to the "w" array.
+
221  for (; index < 64; ++index) {
+
222  // Expand the next word.
+
223  temp1 = state.w[(index - 15) & 0x0F];
+
224  temp2 = state.w[(index - 2) & 0x0F];
+
225  temp1 = state.w[index & 0x0F] =
+
226  state.w[(index - 16) & 0x0F] + state.w[(index - 7) & 0x0F] +
+
227  (rightRotate7(temp1) ^ rightRotate18(temp1) ^ (temp1 >> 3)) +
+
228  (rightRotate17(temp2) ^ rightRotate19(temp2) ^ (temp2 >> 10));
+
229 
+
230  // Perform the round.
+
231  temp1 = h + pgm_read_dword(k + index) + temp1 +
+
232  (rightRotate6(e) ^ rightRotate11(e) ^ rightRotate25(e)) +
+
233  ((e & f) ^ ((~e) & g));
+
234  temp2 = (rightRotate2(a) ^ rightRotate13(a) ^ rightRotate22(a)) +
+
235  ((a & b) ^ (a & c) ^ (b & c));
+
236  h = g;
+
237  g = f;
+
238  f = e;
+
239  e = d + temp1;
+
240  d = c;
+
241  c = b;
+
242  b = a;
+
243  a = temp1 + temp2;
+
244  }
+
245 
+
246  // Add the compressed chunk to the current hash value.
+
247  state.h[0] += a;
+
248  state.h[1] += b;
+
249  state.h[2] += c;
+
250  state.h[3] += d;
+
251  state.h[4] += e;
+
252  state.h[5] += f;
+
253  state.h[6] += g;
+
254  state.h[7] += h;
+
255 
+
256  // Attempt to clean up the stack.
+
257  a = b = c = d = e = f = g = h = temp1 = temp2 = 0;
+
258 }
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA256.cpp:66
+
SHA256()
Constructs a SHA-256 hash object.
Definition: SHA256.cpp:42
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA256.cpp:102
+
virtual ~SHA256()
Destroys this SHA-256 hash object after clearing sensitive information.
Definition: SHA256.cpp:51
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA256.cpp:61
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA256.cpp:146
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA256.cpp:80
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA256.cpp:56
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA256.cpp:133
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA256.cpp:139
+
+ + + + diff --git a/html/SHA256_8h_source.html b/html/SHA256_8h_source.html new file mode 100644 index 00000000..594e954d --- /dev/null +++ b/html/SHA256_8h_source.html @@ -0,0 +1,168 @@ + + + + + + +ArduinoLibs: SHA256.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA256.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_SHA256_h
+
24 #define CRYPTO_SHA256_h
+
25 
+
26 #include "Hash.h"
+
27 
+
28 class SHA256 : public Hash
+
29 {
+
30 public:
+
31  SHA256();
+
32  virtual ~SHA256();
+
33 
+
34  size_t hashSize() const;
+
35  size_t blockSize() const;
+
36 
+
37  void reset();
+
38  void update(const void *data, size_t len);
+
39  void finalize(void *hash, size_t len);
+
40 
+
41  void clear();
+
42 
+
43  void resetHMAC(const void *key, size_t keyLen);
+
44  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
45 
+
46 private:
+
47  struct {
+
48  uint32_t h[8];
+
49  uint32_t w[16];
+
50  uint64_t length;
+
51  uint8_t chunkSize;
+
52  } state;
+
53 
+
54  void processChunk();
+
55 };
+
56 
+
57 #endif
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA256.cpp:66
+
SHA256()
Constructs a SHA-256 hash object.
Definition: SHA256.cpp:42
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA256.cpp:102
+
virtual ~SHA256()
Destroys this SHA-256 hash object after clearing sensitive information.
Definition: SHA256.cpp:51
+
SHA-256 hash algorithm.
Definition: SHA256.h:28
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA256.cpp:61
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA256.cpp:146
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA256.cpp:80
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA256.cpp:56
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA256.cpp:133
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA256.cpp:139
+
+ + + + diff --git a/html/SHA3_8cpp_source.html b/html/SHA3_8cpp_source.html new file mode 100644 index 00000000..53b4d7c5 --- /dev/null +++ b/html/SHA3_8cpp_source.html @@ -0,0 +1,265 @@ + + + + + + +ArduinoLibs: SHA3.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA3.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SHA3.h"
+
24 #include "Crypto.h"
+
25 
+ +
39 {
+
40  core.setCapacity(512);
+
41 }
+
42 
+ +
47 {
+
48  // The destructor for the KeccakCore object will do most of the work.
+
49 }
+
50 
+
51 size_t SHA3_256::hashSize() const
+
52 {
+
53  return 32;
+
54 }
+
55 
+
56 size_t SHA3_256::blockSize() const
+
57 {
+
58  return core.blockSize();
+
59 }
+
60 
+ +
62 {
+
63  core.reset();
+
64 }
+
65 
+
66 void SHA3_256::update(const void *data, size_t len)
+
67 {
+
68  core.update(data, len);
+
69 }
+
70 
+
71 void SHA3_256::finalize(void *hash, size_t len)
+
72 {
+
73  // Pad the final block and then extract the hash value.
+
74  core.pad(0x06);
+
75  core.extract(hash, len);
+
76 }
+
77 
+ +
79 {
+
80  core.clear();
+
81 }
+
82 
+
83 void SHA3_256::resetHMAC(const void *key, size_t keyLen)
+
84 {
+
85  core.setHMACKey(key, keyLen, 0x36, 32);
+
86 }
+
87 
+
88 void SHA3_256::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
89 {
+
90  uint8_t temp[32];
+
91  finalize(temp, sizeof(temp));
+
92  core.setHMACKey(key, keyLen, 0x5C, 32);
+
93  core.update(temp, sizeof(temp));
+
94  finalize(hash, hashLen);
+
95  clean(temp);
+
96 }
+
97 
+ +
111 {
+
112  core.setCapacity(1024);
+
113 }
+
114 
+ +
119 {
+
120  // The destructor for the KeccakCore object will do most of the work.
+
121 }
+
122 
+
123 size_t SHA3_512::hashSize() const
+
124 {
+
125  return 64;
+
126 }
+
127 
+
128 size_t SHA3_512::blockSize() const
+
129 {
+
130  return core.blockSize();
+
131 }
+
132 
+ +
134 {
+
135  core.reset();
+
136 }
+
137 
+
138 void SHA3_512::update(const void *data, size_t len)
+
139 {
+
140  core.update(data, len);
+
141 }
+
142 
+
143 void SHA3_512::finalize(void *hash, size_t len)
+
144 {
+
145  // Pad the final block and then extract the hash value.
+
146  core.pad(0x06);
+
147  core.extract(hash, len);
+
148 }
+
149 
+ +
151 {
+
152  core.clear();
+
153 }
+
154 
+
155 void SHA3_512::resetHMAC(const void *key, size_t keyLen)
+
156 {
+
157  core.setHMACKey(key, keyLen, 0x36, 64);
+
158 }
+
159 
+
160 void SHA3_512::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
161 {
+
162  uint8_t temp[64];
+
163  finalize(temp, sizeof(temp));
+
164  core.setHMACKey(key, keyLen, 0x5C, 64);
+
165  core.update(temp, sizeof(temp));
+
166  finalize(hash, hashLen);
+
167  clean(temp);
+
168 }
+
SHA3_512()
Constructs a new SHA3-512 hash object.
Definition: SHA3.cpp:110
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA3.cpp:61
+
size_t blockSize() const
Returns the input block size for the sponge function in bytes.
Definition: KeccakCore.h:38
+
virtual ~SHA3_256()
Destroys this hash object after clearing sensitive information.
Definition: SHA3.cpp:46
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA3.cpp:83
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA3.cpp:123
+
void setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize)
Sets a HMAC key for a Keccak-based hash algorithm.
Definition: KeccakCore.cpp:263
+
SHA3_256()
Constructs a new SHA3-256 hash object.
Definition: SHA3.cpp:38
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA3.cpp:88
+
virtual ~SHA3_512()
Destroys this hash object after clearing sensitive information.
Definition: SHA3.cpp:118
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA3.cpp:51
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:143
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA3.cpp:133
+
void setCapacity(size_t capacity)
Sets the capacity of the Keccak sponge function in bits.
Definition: KeccakCore.cpp:89
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA3.cpp:160
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA3.cpp:56
+
void extract(void *data, size_t size)
Extracts data from the Keccak sponge function.
Definition: KeccakCore.cpp:201
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA3.cpp:155
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA3.cpp:150
+
void pad(uint8_t tag)
Pads the last block of input data to blockSize().
Definition: KeccakCore.cpp:174
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA3.cpp:128
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:138
+
void update(const void *data, size_t size)
Updates the Keccak sponge function with more input data.
Definition: KeccakCore.cpp:128
+
void clear()
Clears all sensitive data from this object.
Definition: KeccakCore.cpp:245
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:71
+
void reset()
Resets the Keccak sponge function ready for a new session.
Definition: KeccakCore.cpp:109
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:66
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA3.cpp:78
+
+ + + + diff --git a/html/SHA3_8h_source.html b/html/SHA3_8h_source.html new file mode 100644 index 00000000..7cad9e90 --- /dev/null +++ b/html/SHA3_8h_source.html @@ -0,0 +1,196 @@ + + + + + + +ArduinoLibs: SHA3.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA3.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_SHA3_h
+
24 #define CRYPTO_SHA3_h
+
25 
+
26 #include "KeccakCore.h"
+
27 #include "Hash.h"
+
28 
+
29 class SHA3_256 : public Hash
+
30 {
+
31 public:
+
32  SHA3_256();
+
33  virtual ~SHA3_256();
+
34 
+
35  size_t hashSize() const;
+
36  size_t blockSize() const;
+
37 
+
38  void reset();
+
39  void update(const void *data, size_t len);
+
40  void finalize(void *hash, size_t len);
+
41 
+
42  void clear();
+
43 
+
44  void resetHMAC(const void *key, size_t keyLen);
+
45  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
46 
+
47 private:
+
48  KeccakCore core;
+
49 };
+
50 
+
51 class SHA3_512 : public Hash
+
52 {
+
53 public:
+
54  SHA3_512();
+
55  virtual ~SHA3_512();
+
56 
+
57  size_t hashSize() const;
+
58  size_t blockSize() const;
+
59 
+
60  void reset();
+
61  void update(const void *data, size_t len);
+
62  void finalize(void *hash, size_t len);
+
63 
+
64  void clear();
+
65 
+
66  void resetHMAC(const void *key, size_t keyLen);
+
67  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
68 
+
69 private:
+
70  KeccakCore core;
+
71 };
+
72 
+
73 #endif
+
SHA3_512()
Constructs a new SHA3-512 hash object.
Definition: SHA3.cpp:110
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA3.cpp:61
+
virtual ~SHA3_256()
Destroys this hash object after clearing sensitive information.
Definition: SHA3.cpp:46
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA3.cpp:83
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA3.cpp:123
+
SHA3_256()
Constructs a new SHA3-256 hash object.
Definition: SHA3.cpp:38
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA3.cpp:88
+
virtual ~SHA3_512()
Destroys this hash object after clearing sensitive information.
Definition: SHA3.cpp:118
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA3.cpp:51
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:143
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA3.cpp:133
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA3.cpp:160
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA3.cpp:56
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA3.cpp:155
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA3.cpp:150
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA3.cpp:128
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:138
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:71
+
Keccak core sponge function.
Definition: KeccakCore.h:29
+
SHA3-256 hash algorithm.
Definition: SHA3.h:29
+
SHA3-512 hash algorithm.
Definition: SHA3.h:51
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:66
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA3.cpp:78
+
+ + + + diff --git a/html/SHA512_8cpp_source.html b/html/SHA512_8cpp_source.html new file mode 100644 index 00000000..91672256 --- /dev/null +++ b/html/SHA512_8cpp_source.html @@ -0,0 +1,363 @@ + + + + + + +ArduinoLibs: SHA512.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA512.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SHA512.h"
+
24 #include "Crypto.h"
+
25 #include "utility/RotateUtil.h"
+
26 #include "utility/EndianUtil.h"
+
27 #include "utility/ProgMemUtil.h"
+
28 #include <string.h>
+
29 
+ +
43 {
+
44  reset();
+
45 }
+
46 
+ +
52 {
+
53  clean(state);
+
54 }
+
55 
+
56 size_t SHA512::hashSize() const
+
57 {
+
58  return 64;
+
59 }
+
60 
+
61 size_t SHA512::blockSize() const
+
62 {
+
63  return 128;
+
64 }
+
65 
+ +
67 {
+
68  static uint64_t const hashStart[8] PROGMEM = {
+
69  0x6A09E667F3BCC908ULL, 0xBB67AE8584CAA73BULL, 0x3C6EF372FE94F82BULL,
+
70  0xA54FF53A5F1D36F1ULL, 0x510E527FADE682D1ULL, 0x9B05688C2B3E6C1FULL,
+
71  0x1F83D9ABFB41BD6BULL, 0x5BE0CD19137E2179ULL
+
72  };
+
73  memcpy_P(state.h, hashStart, sizeof(hashStart));
+
74  state.chunkSize = 0;
+
75  state.lengthLow = 0;
+
76  state.lengthHigh = 0;
+
77 }
+
78 
+
79 void SHA512::update(const void *data, size_t len)
+
80 {
+
81  // Update the total length in bits, not bytes.
+
82  uint64_t temp = state.lengthLow;
+
83  state.lengthLow += (((uint64_t)len) << 3);
+
84  state.lengthHigh += (((uint64_t)len) >> 61);
+
85  if (state.lengthLow < temp)
+
86  ++state.lengthHigh;
+
87 
+
88  // Break the input up into 1024-bit chunks and process each in turn.
+
89  const uint8_t *d = (const uint8_t *)data;
+
90  while (len > 0) {
+
91  uint8_t size = 128 - state.chunkSize;
+
92  if (size > len)
+
93  size = len;
+
94  memcpy(((uint8_t *)state.w) + state.chunkSize, d, size);
+
95  state.chunkSize += size;
+
96  len -= size;
+
97  d += size;
+
98  if (state.chunkSize == 128) {
+
99  processChunk();
+
100  state.chunkSize = 0;
+
101  }
+
102  }
+
103 }
+
104 
+
105 void SHA512::finalize(void *hash, size_t len)
+
106 {
+
107  // Pad the last chunk. We may need two padding chunks if there
+
108  // isn't enough room in the first for the padding and length.
+
109  uint8_t *wbytes = (uint8_t *)state.w;
+
110  if (state.chunkSize <= (128 - 17)) {
+
111  wbytes[state.chunkSize] = 0x80;
+
112  memset(wbytes + state.chunkSize + 1, 0x00, 128 - 16 - (state.chunkSize + 1));
+
113  state.w[14] = htobe64(state.lengthHigh);
+
114  state.w[15] = htobe64(state.lengthLow);
+
115  processChunk();
+
116  } else {
+
117  wbytes[state.chunkSize] = 0x80;
+
118  memset(wbytes + state.chunkSize + 1, 0x00, 128 - (state.chunkSize + 1));
+
119  processChunk();
+
120  memset(wbytes, 0x00, 128 - 16);
+
121  state.w[14] = htobe64(state.lengthHigh);
+
122  state.w[15] = htobe64(state.lengthLow);
+
123  processChunk();
+
124  }
+
125 
+
126  // Convert the result into big endian and return it.
+
127  for (uint8_t posn = 0; posn < 8; ++posn)
+
128  state.w[posn] = htobe64(state.h[posn]);
+
129 
+
130  // Copy the hash to the caller's return buffer.
+
131  if (len > 64)
+
132  len = 64;
+
133  memcpy(hash, state.w, len);
+
134 }
+
135 
+ +
137 {
+
138  clean(state);
+
139  reset();
+
140 }
+
141 
+
142 void SHA512::resetHMAC(const void *key, size_t keyLen)
+
143 {
+
144  formatHMACKey(state.w, key, keyLen, 0x36);
+
145  state.lengthLow += 128 * 8;
+
146  processChunk();
+
147 }
+
148 
+
149 void SHA512::finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
+
150 {
+
151  uint8_t temp[64];
+
152  finalize(temp, sizeof(temp));
+
153  formatHMACKey(state.w, key, keyLen, 0x5C);
+
154  state.lengthLow += 128 * 8;
+
155  processChunk();
+
156  update(temp, sizeof(temp));
+
157  finalize(hash, hashLen);
+
158  clean(temp);
+
159 }
+
160 
+
166 void SHA512::processChunk()
+
167 {
+
168  // Round constants for SHA-512.
+
169  static uint64_t const k[80] PROGMEM = {
+
170  0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL, 0xB5C0FBCFEC4D3B2FULL,
+
171  0xE9B5DBA58189DBBCULL, 0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL,
+
172  0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL, 0xD807AA98A3030242ULL,
+
173  0x12835B0145706FBEULL, 0x243185BE4EE4B28CULL, 0x550C7DC3D5FFB4E2ULL,
+
174  0x72BE5D74F27B896FULL, 0x80DEB1FE3B1696B1ULL, 0x9BDC06A725C71235ULL,
+
175  0xC19BF174CF692694ULL, 0xE49B69C19EF14AD2ULL, 0xEFBE4786384F25E3ULL,
+
176  0x0FC19DC68B8CD5B5ULL, 0x240CA1CC77AC9C65ULL, 0x2DE92C6F592B0275ULL,
+
177  0x4A7484AA6EA6E483ULL, 0x5CB0A9DCBD41FBD4ULL, 0x76F988DA831153B5ULL,
+
178  0x983E5152EE66DFABULL, 0xA831C66D2DB43210ULL, 0xB00327C898FB213FULL,
+
179  0xBF597FC7BEEF0EE4ULL, 0xC6E00BF33DA88FC2ULL, 0xD5A79147930AA725ULL,
+
180  0x06CA6351E003826FULL, 0x142929670A0E6E70ULL, 0x27B70A8546D22FFCULL,
+
181  0x2E1B21385C26C926ULL, 0x4D2C6DFC5AC42AEDULL, 0x53380D139D95B3DFULL,
+
182  0x650A73548BAF63DEULL, 0x766A0ABB3C77B2A8ULL, 0x81C2C92E47EDAEE6ULL,
+
183  0x92722C851482353BULL, 0xA2BFE8A14CF10364ULL, 0xA81A664BBC423001ULL,
+
184  0xC24B8B70D0F89791ULL, 0xC76C51A30654BE30ULL, 0xD192E819D6EF5218ULL,
+
185  0xD69906245565A910ULL, 0xF40E35855771202AULL, 0x106AA07032BBD1B8ULL,
+
186  0x19A4C116B8D2D0C8ULL, 0x1E376C085141AB53ULL, 0x2748774CDF8EEB99ULL,
+
187  0x34B0BCB5E19B48A8ULL, 0x391C0CB3C5C95A63ULL, 0x4ED8AA4AE3418ACBULL,
+
188  0x5B9CCA4F7763E373ULL, 0x682E6FF3D6B2B8A3ULL, 0x748F82EE5DEFB2FCULL,
+
189  0x78A5636F43172F60ULL, 0x84C87814A1F0AB72ULL, 0x8CC702081A6439ECULL,
+
190  0x90BEFFFA23631E28ULL, 0xA4506CEBDE82BDE9ULL, 0xBEF9A3F7B2C67915ULL,
+
191  0xC67178F2E372532BULL, 0xCA273ECEEA26619CULL, 0xD186B8C721C0C207ULL,
+
192  0xEADA7DD6CDE0EB1EULL, 0xF57D4F7FEE6ED178ULL, 0x06F067AA72176FBAULL,
+
193  0x0A637DC5A2C898A6ULL, 0x113F9804BEF90DAEULL, 0x1B710B35131C471BULL,
+
194  0x28DB77F523047D84ULL, 0x32CAAB7B40C72493ULL, 0x3C9EBE0A15C9BEBCULL,
+
195  0x431D67C49C100D4CULL, 0x4CC5D4BECB3E42B6ULL, 0x597F299CFC657E2AULL,
+
196  0x5FCB6FAB3AD6FAECULL, 0x6C44198C4A475817ULL
+
197  };
+
198 
+
199  // Convert the first 16 words from big endian to host byte order.
+
200  uint8_t index;
+
201  for (index = 0; index < 16; ++index)
+
202  state.w[index] = be64toh(state.w[index]);
+
203 
+
204  // Initialise working variables to the current hash value.
+
205  uint64_t a = state.h[0];
+
206  uint64_t b = state.h[1];
+
207  uint64_t c = state.h[2];
+
208  uint64_t d = state.h[3];
+
209  uint64_t e = state.h[4];
+
210  uint64_t f = state.h[5];
+
211  uint64_t g = state.h[6];
+
212  uint64_t h = state.h[7];
+
213 
+
214  // Perform the first 16 rounds of the compression function main loop.
+
215  uint64_t temp1, temp2;
+
216  for (index = 0; index < 16; ++index) {
+
217  temp1 = h + pgm_read_qword(k + index) + state.w[index] +
+
218  (rightRotate14_64(e) ^ rightRotate18_64(e) ^
+
219  rightRotate41_64(e)) + ((e & f) ^ ((~e) & g));
+
220  temp2 = (rightRotate28_64(a) ^ rightRotate34_64(a) ^
+
221  rightRotate39_64(a)) + ((a & b) ^ (a & c) ^ (b & c));
+
222  h = g;
+
223  g = f;
+
224  f = e;
+
225  e = d + temp1;
+
226  d = c;
+
227  c = b;
+
228  b = a;
+
229  a = temp1 + temp2;
+
230  }
+
231 
+
232  // Perform the 64 remaining rounds. We expand the first 16 words to
+
233  // 80 in-place in the "w" array. This saves 512 bytes of memory
+
234  // that would have otherwise need to be allocated to the "w" array.
+
235  for (; index < 80; ++index) {
+
236  // Expand the next word.
+
237  temp1 = state.w[(index - 15) & 0x0F];
+
238  temp2 = state.w[(index - 2) & 0x0F];
+
239  temp1 = state.w[index & 0x0F] =
+
240  state.w[(index - 16) & 0x0F] + state.w[(index - 7) & 0x0F] +
+
241  (rightRotate1_64(temp1) ^ rightRotate8_64(temp1) ^
+
242  (temp1 >> 7)) +
+
243  (rightRotate19_64(temp2) ^ rightRotate61_64(temp2) ^
+
244  (temp2 >> 6));
+
245 
+
246  // Perform the round.
+
247  temp1 = h + pgm_read_qword(k + index) + temp1 +
+
248  (rightRotate14_64(e) ^ rightRotate18_64(e) ^
+
249  rightRotate41_64(e)) + ((e & f) ^ ((~e) & g));
+
250  temp2 = (rightRotate28_64(a) ^ rightRotate34_64(a) ^
+
251  rightRotate39_64(a)) + ((a & b) ^ (a & c) ^ (b & c));
+
252  h = g;
+
253  g = f;
+
254  f = e;
+
255  e = d + temp1;
+
256  d = c;
+
257  c = b;
+
258  b = a;
+
259  a = temp1 + temp2;
+
260  }
+
261 
+
262  // Add the compressed chunk to the current hash value.
+
263  state.h[0] += a;
+
264  state.h[1] += b;
+
265  state.h[2] += c;
+
266  state.h[3] += d;
+
267  state.h[4] += e;
+
268  state.h[5] += f;
+
269  state.h[6] += g;
+
270  state.h[7] += h;
+
271 
+
272  // Attempt to clean up the stack.
+
273  a = b = c = d = e = f = g = h = temp1 = temp2 = 0;
+
274 }
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA512.cpp:56
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA512.cpp:61
+
virtual ~SHA512()
Destroys this SHA-512 hash object after clearing sensitive information.
Definition: SHA512.cpp:51
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA512.cpp:136
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA512.cpp:66
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA512.cpp:79
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA512.cpp:105
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA512.cpp:149
+
SHA512()
Constructs a SHA-512 hash object.
Definition: SHA512.cpp:42
+
void formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)
Formats a HMAC key into a block.
Definition: Hash.cpp:162
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA512.cpp:142
+
+ + + + diff --git a/html/SHA512_8h_source.html b/html/SHA512_8h_source.html new file mode 100644 index 00000000..44f66d0f --- /dev/null +++ b/html/SHA512_8h_source.html @@ -0,0 +1,169 @@ + + + + + + +ArduinoLibs: SHA512.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SHA512.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_SHA512_h
+
24 #define CRYPTO_SHA512_h
+
25 
+
26 #include "Hash.h"
+
27 
+
28 class SHA512 : public Hash
+
29 {
+
30 public:
+
31  SHA512();
+
32  virtual ~SHA512();
+
33 
+
34  size_t hashSize() const;
+
35  size_t blockSize() const;
+
36 
+
37  void reset();
+
38  void update(const void *data, size_t len);
+
39  void finalize(void *hash, size_t len);
+
40 
+
41  void clear();
+
42 
+
43  void resetHMAC(const void *key, size_t keyLen);
+
44  void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen);
+
45 
+
46 private:
+
47  struct {
+
48  uint64_t h[8];
+
49  uint64_t w[16];
+
50  uint64_t lengthLow;
+
51  uint64_t lengthHigh;
+
52  uint8_t chunkSize;
+
53  } state;
+
54 
+
55  void processChunk();
+
56 };
+
57 
+
58 #endif
+
size_t hashSize() const
Size of the hash result from finalize().
Definition: SHA512.cpp:56
+
size_t blockSize() const
Size of the internal block used by the hash algorithm.
Definition: SHA512.cpp:61
+
virtual ~SHA512()
Destroys this SHA-512 hash object after clearing sensitive information.
Definition: SHA512.cpp:51
+
Abstract base class for cryptographic hash algorithms.
Definition: Hash.h:29
+
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA512.cpp:136
+
SHA-512 hash algorithm.
Definition: SHA512.h:28
+
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA512.cpp:66
+
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA512.cpp:79
+
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA512.cpp:105
+
void finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)
Finalizes the HMAC hashing process and returns the hash.
Definition: SHA512.cpp:149
+
SHA512()
Constructs a SHA-512 hash object.
Definition: SHA512.cpp:42
+
void resetHMAC(const void *key, size_t keyLen)
Resets the hash ready for a new HMAC hashing process.
Definition: SHA512.cpp:142
+
+ + + + diff --git a/html/SoftI2C_8cpp_source.html b/html/SoftI2C_8cpp_source.html new file mode 100644 index 00000000..d94fe127 --- /dev/null +++ b/html/SoftI2C_8cpp_source.html @@ -0,0 +1,291 @@ + + + + + + +ArduinoLibs: SoftI2C.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SoftI2C.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SoftI2C.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
45 #define i2cDelay() delayMicroseconds(5)
+
46 
+
50 SoftI2C::SoftI2C(uint8_t dataPin, uint8_t clockPin)
+
51  : _dataPin(dataPin)
+
52  , _clockPin(clockPin)
+
53  , started(false)
+
54  , acked(true)
+
55  , inWrite(false)
+
56  , readCount(0)
+
57 {
+
58  // Initially set the CLOCK and DATA lines to be outputs in the high state.
+
59  pinMode(_clockPin, OUTPUT);
+
60  pinMode(_dataPin, OUTPUT);
+
61  digitalWrite(_clockPin, HIGH);
+
62  digitalWrite(_dataPin, HIGH);
+
63 }
+
64 
+
65 unsigned int SoftI2C::maxTransferSize() const
+
66 {
+
67  return 0xFFFF;
+
68 }
+
69 
+
70 void SoftI2C::start()
+
71 {
+
72  pinMode(_dataPin, OUTPUT);
+
73  if (started) {
+
74  // Already started, so send a restart condition.
+
75  digitalWrite(_dataPin, HIGH);
+
76  digitalWrite(_clockPin, HIGH);
+
77  i2cDelay();
+
78  }
+
79  digitalWrite(_dataPin, LOW);
+
80  i2cDelay();
+
81  digitalWrite(_clockPin, LOW);
+
82  i2cDelay();
+
83  started = true;
+
84  acked = true;
+
85 }
+
86 
+
87 void SoftI2C::stop()
+
88 {
+
89  pinMode(_dataPin, OUTPUT);
+
90  digitalWrite(_dataPin, LOW);
+
91  digitalWrite(_clockPin, HIGH);
+
92  i2cDelay();
+
93  digitalWrite(_dataPin, HIGH);
+
94  i2cDelay();
+
95  started = false;
+
96  inWrite = false;
+
97 }
+
98 
+
99 #define I2C_WRITE 0x00
+
100 #define I2C_WRITE10 0xF0
+
101 #define I2C_READ 0x01
+
102 #define I2C_READ10 0xF1
+
103 
+
104 void SoftI2C::startWrite(unsigned int address)
+
105 {
+
106  start();
+
107  inWrite = true;
+
108  if (address < 0x80) {
+
109  // 7-bit address.
+
110  write((uint8_t)((address << 1) | I2C_WRITE));
+
111  } else {
+
112  // 10-bit address.
+
113  write((uint8_t)(((address >> 7) & 0x06)) | I2C_WRITE10);
+
114  write((uint8_t)address);
+
115  }
+
116 }
+
117 
+
118 void SoftI2C::write(uint8_t value)
+
119 {
+
120  uint8_t mask = 0x80;
+
121  while (mask != 0) {
+
122  writeBit((value & mask) != 0);
+
123  mask >>= 1;
+
124  }
+
125  if (readBit()) // 0: ACK, 1: NACK
+
126  acked = false;
+
127 }
+
128 
+ +
130 {
+
131  stop();
+
132  return acked;
+
133 }
+
134 
+
135 bool SoftI2C::startRead(unsigned int address, unsigned int count)
+
136 {
+
137  start();
+
138  inWrite = false;
+
139  if (address < 0x80) {
+
140  // 7-bit address.
+
141  write((uint8_t)((address << 1) | I2C_READ));
+
142  } else {
+
143  // 10-bit address.
+
144  write((uint8_t)(((address >> 7) & 0x06)) | I2C_READ10);
+
145  write((uint8_t)address);
+
146  }
+
147  if (!acked) {
+
148  readCount = 0;
+
149  return false;
+
150  }
+
151  readCount = count;
+
152  return true;
+
153 }
+
154 
+
155 unsigned int SoftI2C::available()
+
156 {
+
157  return readCount;
+
158 }
+
159 
+
160 uint8_t SoftI2C::read()
+
161 {
+
162  uint8_t value = 0;
+
163  for (uint8_t bit = 0; bit < 8; ++bit)
+
164  value = (value << 1) | readBit();
+
165  if (readCount > 1) {
+
166  // More bytes left to read - send an ACK.
+
167  writeBit(false);
+
168  --readCount;
+
169  } else {
+
170  // Last byte - send the NACK and a stop condition.
+
171  writeBit(true);
+
172  stop();
+
173  readCount = 0;
+
174  }
+
175  return value;
+
176 }
+
177 
+
178 void SoftI2C::writeBit(bool bit)
+
179 {
+
180  pinMode(_dataPin, OUTPUT);
+
181  if (bit)
+
182  digitalWrite(_dataPin, HIGH);
+
183  else
+
184  digitalWrite(_dataPin, LOW);
+
185  i2cDelay();
+
186  digitalWrite(_clockPin, HIGH);
+
187  i2cDelay();
+
188  digitalWrite(_clockPin, LOW);
+
189  i2cDelay();
+
190 }
+
191 
+
192 bool SoftI2C::readBit()
+
193 {
+
194  pinMode(_dataPin, INPUT);
+
195  digitalWrite(_dataPin, HIGH);
+
196  digitalWrite(_clockPin, HIGH);
+
197  bool bit = digitalRead(_dataPin);
+
198  i2cDelay();
+
199  digitalWrite(_clockPin, LOW);
+
200  i2cDelay();
+
201  return bit;
+
202 }
+
bool startRead(unsigned int address, unsigned int count)
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
Definition: SoftI2C.cpp:135
+
bool endWrite()
Ends the current write operation.
Definition: SoftI2C.cpp:129
+
SoftI2C(uint8_t dataPin, uint8_t clockPin)
Constructs a new software I2C master on dataPin and clockPin.
Definition: SoftI2C.cpp:50
+
unsigned int available()
Returns the number of bytes that are still available for reading.
Definition: SoftI2C.cpp:155
+
uint8_t read()
Reads a single byte from the I2C bus.
Definition: SoftI2C.cpp:160
+
void write(uint8_t value)
Writes a single byte value on the I2C bus.
Definition: SoftI2C.cpp:118
+
unsigned int maxTransferSize() const
Returns the maximum number of bytes that can be read or written in a single request by this bus maste...
Definition: SoftI2C.cpp:65
+
void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
Definition: SoftI2C.cpp:104
+
+ + + + diff --git a/html/SoftI2C_8h_source.html b/html/SoftI2C_8h_source.html new file mode 100644 index 00000000..ea12fc27 --- /dev/null +++ b/html/SoftI2C_8h_source.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: SoftI2C.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
SoftI2C.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef SoftI2C_h
+
24 #define SoftI2C_h
+
25 
+
26 #include "I2CMaster.h"
+
27 
+
28 class SoftI2C : public I2CMaster {
+
29 public:
+
30  SoftI2C(uint8_t dataPin, uint8_t clockPin);
+
31 
+
32  unsigned int maxTransferSize() const;
+
33 
+
34  void startWrite(unsigned int address);
+
35  void write(uint8_t value);
+
36  bool endWrite();
+
37 
+
38  bool startRead(unsigned int address, unsigned int count);
+
39  unsigned int available();
+
40  uint8_t read();
+
41 
+
42 private:
+
43  uint8_t _dataPin;
+
44  uint8_t _clockPin;
+
45  bool started;
+
46  bool acked;
+
47  bool inWrite;
+
48  unsigned int readCount;
+
49 
+
50  void start();
+
51  void stop();
+
52  void writeBit(bool bit);
+
53  bool readBit();
+
54 };
+
55 
+
56 #endif
+
Bit-banged implementation of an I2C master.
Definition: SoftI2C.h:28
+
bool startRead(unsigned int address, unsigned int count)
Starts a read operation for count bytes by sending the start condition and the I2C control byte...
Definition: SoftI2C.cpp:135
+
bool endWrite()
Ends the current write operation.
Definition: SoftI2C.cpp:129
+
SoftI2C(uint8_t dataPin, uint8_t clockPin)
Constructs a new software I2C master on dataPin and clockPin.
Definition: SoftI2C.cpp:50
+
unsigned int available()
Returns the number of bytes that are still available for reading.
Definition: SoftI2C.cpp:155
+
uint8_t read()
Reads a single byte from the I2C bus.
Definition: SoftI2C.cpp:160
+
void write(uint8_t value)
Writes a single byte value on the I2C bus.
Definition: SoftI2C.cpp:118
+
unsigned int maxTransferSize() const
Returns the maximum number of bytes that can be read or written in a single request by this bus maste...
Definition: SoftI2C.cpp:65
+
Abstract base class for I2C master implementations.
Definition: I2CMaster.h:28
+
void startWrite(unsigned int address)
Starts a write operation by sending a start condition and the I2C control byte.
Definition: SoftI2C.cpp:104
+
+ + + + diff --git a/html/StarTrek.png b/html/StarTrek.png new file mode 100644 index 00000000..9588a9b2 Binary files /dev/null and b/html/StarTrek.png differ diff --git a/html/StarTrekBreadboard.png b/html/StarTrekBreadboard.png new file mode 100644 index 00000000..8a14f8eb Binary files /dev/null and b/html/StarTrekBreadboard.png differ diff --git a/html/StarTrekShield.png b/html/StarTrekShield.png new file mode 100644 index 00000000..1ab21738 Binary files /dev/null and b/html/StarTrekShield.png differ diff --git a/html/TextField_8cpp_source.html b/html/TextField_8cpp_source.html new file mode 100644 index 00000000..a8c03bf2 --- /dev/null +++ b/html/TextField_8cpp_source.html @@ -0,0 +1,164 @@ + + + + + + +ArduinoLibs: TextField.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TextField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "TextField.h"
+
24 
+
66 TextField::TextField(const String &label)
+
67  : Field(label)
+
68 {
+
69 }
+
70 
+
77 TextField::TextField(Form &form, const String &label, const String &value)
+
78  : Field(form, label)
+
79  , _value(value)
+
80 {
+
81 }
+
82 
+
83 void TextField::enterField(bool reverse)
+
84 {
+
85  Field::enterField(reverse);
+
86  lcd()->setCursor(0, 1);
+
87  lcd()->print(_value);
+
88 }
+
89 
+
102 void TextField::setValue(const String &value)
+
103 {
+
104  if (isCurrent()) {
+
105  unsigned int prevLen = _value.length();
+
106  unsigned int newLen = value.length();
+
107  _value = value;
+
108  lcd()->setCursor(0, 1);
+
109  lcd()->print(value);
+
110  while (newLen++ < prevLen)
+
111  lcd()->write(' ');
+
112  } else {
+
113  _value = value;
+
114  }
+
115 }
+
void setValue(const String &value)
Sets the text value that is displayed by this field.
Definition: TextField.cpp:102
+
TextField(const String &label)
Constructs a new text field with a specific label.
Definition: TextField.cpp:66
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: TextField.cpp:83
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
const String & value() const
Returns the text value that is currently displayed by this field.
Definition: TextField.h:35
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
+ + + + diff --git a/html/TextField_8h_source.html b/html/TextField_8h_source.html new file mode 100644 index 00000000..b25fcb45 --- /dev/null +++ b/html/TextField_8h_source.html @@ -0,0 +1,150 @@ + + + + + + +ArduinoLibs: TextField.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TextField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef TextField_h
+
24 #define TextField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class TextField : public Field {
+
29 public:
+
30  explicit TextField(const String &label);
+
31  TextField(Form &form, const String &label, const String &value);
+
32 
+
33  void enterField(bool reverse);
+
34 
+
35  const String &value() const { return _value; }
+
36  void setValue(const String &value);
+
37 
+
38 private:
+
39  String _value;
+
40 };
+
41 
+
42 #endif
+
void setValue(const String &value)
Sets the text value that is displayed by this field.
Definition: TextField.cpp:102
+
TextField(const String &label)
Constructs a new text field with a specific label.
Definition: TextField.cpp:66
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: TextField.cpp:83
+
const String & value() const
Returns the text value that is currently displayed by this field.
Definition: TextField.h:35
+
Field that displays a read-only text value.
Definition: TextField.h:28
+
+ + + + diff --git a/html/ThreeChase.png b/html/ThreeChase.png new file mode 100644 index 00000000..c460598c Binary files /dev/null and b/html/ThreeChase.png differ diff --git a/html/TimeField_8cpp_source.html b/html/TimeField_8cpp_source.html new file mode 100644 index 00000000..1b866f48 --- /dev/null +++ b/html/TimeField_8cpp_source.html @@ -0,0 +1,333 @@ + + + + + + +ArduinoLibs: TimeField.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TimeField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "TimeField.h"
+
24 
+
65 #define EDIT_HOUR 0
+
66 #define EDIT_MINUTE_TENS 1
+
67 #define EDIT_MINUTE 2
+
68 #define EDIT_SECOND_TENS 3
+
69 #define EDIT_SECOND 4
+
70 
+
82 TimeField::TimeField(const String &label)
+
83  : Field(label)
+
84  , _value(0)
+
85  , _maxHours(24)
+
86  , _printLen(0)
+
87  , _readOnly(false)
+
88  , editField(EDIT_HOUR)
+
89 {
+
90 }
+
91 
+
105 TimeField::TimeField(Form &form, const String &label, int maxHours, bool readOnly)
+
106  : Field(form, label)
+
107  , _value(0)
+
108  , _maxHours(maxHours)
+
109  , _printLen(0)
+
110  , _readOnly(readOnly)
+
111  , editField(EDIT_HOUR)
+
112 {
+
113 }
+
114 
+
115 int TimeField::dispatch(int event)
+
116 {
+
117  unsigned long newValue;
+
118  if (_readOnly)
+
119  return -1;
+
120  if (event == LCD_BUTTON_UP) {
+
121  newValue = _value;
+
122  if (editField == EDIT_HOUR) {
+
123  newValue += 60 * 60;
+
124  } else if (editField == EDIT_MINUTE_TENS) {
+
125  if (((newValue / 60) % 60) >= 50)
+
126  newValue -= 50 * 60;
+
127  else
+
128  newValue += 10 * 60;
+
129  } else if (editField == EDIT_MINUTE) {
+
130  if (((newValue / 60) % 60) == 59)
+
131  newValue -= 59 * 60;
+
132  else
+
133  newValue += 60;
+
134  } else if (editField == EDIT_SECOND_TENS) {
+
135  if ((newValue % 60) >= 50)
+
136  newValue -= 50;
+
137  else
+
138  newValue += 10;
+
139  } else {
+
140  if ((newValue % 60) == 59)
+
141  newValue -= 59;
+
142  else
+
143  newValue += 1;
+
144  }
+
145  setValue(newValue);
+
146  return FORM_CHANGED;
+
147  } else if (event == LCD_BUTTON_DOWN) {
+
148  newValue = _value;
+
149  if (editField == EDIT_HOUR) {
+
150  if (newValue < 60 * 60)
+
151  newValue += ((unsigned long)(_maxHours - 1)) * 60 * 60;
+
152  else
+
153  newValue -= 60 * 60;
+
154  } else if (editField == EDIT_MINUTE_TENS) {
+
155  if (((newValue / 60) % 60) < 10)
+
156  newValue += 50 * 60;
+
157  else
+
158  newValue -= 10 * 60;
+
159  } else if (editField == EDIT_MINUTE) {
+
160  if (((newValue / 60) % 60) == 0)
+
161  newValue += 59 * 60;
+
162  else
+
163  newValue -= 60;
+
164  } else if (editField == EDIT_SECOND_TENS) {
+
165  if ((newValue % 60) < 10)
+
166  newValue += 50;
+
167  else
+
168  newValue -= 10;
+
169  } else {
+
170  if ((newValue % 60) == 0)
+
171  newValue += 59;
+
172  else
+
173  newValue -= 1;
+
174  }
+
175  setValue(newValue);
+
176  return FORM_CHANGED;
+
177  } else if (event == LCD_BUTTON_LEFT) {
+
178  if (editField != EDIT_HOUR) {
+
179  --editField;
+
180  printTime();
+
181  return 0;
+
182  }
+
183  } else if (event == LCD_BUTTON_RIGHT) {
+
184  if (editField != EDIT_SECOND) {
+
185  ++editField;
+
186  printTime();
+
187  return 0;
+
188  }
+
189  }
+
190  return -1;
+
191 }
+
192 
+
193 void TimeField::enterField(bool reverse)
+
194 {
+
195  Field::enterField(reverse);
+
196  if (reverse)
+
197  editField = EDIT_SECOND;
+
198  else
+
199  editField = EDIT_HOUR;
+
200  printTime();
+
201  if (!_readOnly)
+
202  lcd()->cursor();
+
203 }
+
204 
+ +
206 {
+
207  if (!_readOnly)
+
208  lcd()->noCursor();
+ +
210 }
+
211 
+
227 void TimeField::setValue(unsigned long value)
+
228 {
+
229  unsigned long maxSecs = ((unsigned long)_maxHours) * 60 * 60;
+
230  value %= maxSecs;
+
231  if (value != _value) {
+
232  _value = value;
+
233  if (isCurrent())
+
234  printTime();
+
235  }
+
236 }
+
237 
+
268 void TimeField::setReadOnly(bool value)
+
269 {
+
270  if (_readOnly != value) {
+
271  _readOnly = value;
+
272  printTime();
+
273  if (isCurrent()) {
+
274  if (value)
+
275  lcd()->cursor();
+
276  else
+
277  lcd()->noCursor();
+
278  }
+
279  }
+
280 }
+
281 
+
282 void TimeField::printTime()
+
283 {
+
284  lcd()->setCursor(0, 1);
+
285  int col = printField(_value / (60 * 60));
+
286  int hourCol = col - 1;
+
287  lcd()->write(':');
+
288  ++col;
+
289  col += printField((_value / 60) % 60);
+
290  int minuteCol = col - 1;
+
291  lcd()->write(':');
+
292  ++col;
+
293  col += printField(_value % 60);
+
294  int secondCol = col - 1;
+
295  int tempCol = col;
+
296  while (tempCol++ < _printLen)
+
297  lcd()->write(' ');
+
298  _printLen = col;
+
299  if (!_readOnly) {
+
300  if (editField == EDIT_HOUR)
+
301  lcd()->setCursor(hourCol, 1);
+
302  else if (editField == EDIT_MINUTE_TENS)
+
303  lcd()->setCursor(minuteCol - 1, 1);
+
304  else if (editField == EDIT_MINUTE)
+
305  lcd()->setCursor(minuteCol, 1);
+
306  else if (editField == EDIT_SECOND_TENS)
+
307  lcd()->setCursor(secondCol - 1, 1);
+
308  else
+
309  lcd()->setCursor(secondCol, 1);
+
310  }
+
311 }
+
312 
+
313 int TimeField::printField(unsigned long value)
+
314 {
+
315  if (value < 100) {
+
316  lcd()->write('0' + (int)(value / 10));
+
317  lcd()->write('0' + (int)(value % 10));
+
318  return 2;
+
319  }
+
320  unsigned long divisor = 100;
+
321  while ((value / divisor) >= 10)
+
322  divisor *= 10;
+
323  int digits = 0;
+
324  while (divisor > 0) {
+
325  lcd()->write('0' + (int)((value / divisor) % 10));
+
326  divisor /= 10;
+
327  ++digits;
+
328  }
+
329  return digits;
+
330 }
+
unsigned long value() const
Returns the current value of this time field, in seconds.
Definition: TimeField.h:41
+
void setReadOnly(bool value)
Sets the read-only state of this field to value.
Definition: TimeField.cpp:268
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
virtual void enterField(bool reverse)
Enters the field due to form navigation.
Definition: Field.cpp:116
+
LiquidCrystal * lcd() const
Returns the LCD that this field is being drawn on.
Definition: Field.h:47
+
int dispatch(int event)
Dispatches event via this field.
Definition: TimeField.cpp:115
+
virtual void exitField()
Exits the field due to form navigation.
Definition: Field.cpp:129
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: TimeField.cpp:193
+
TimeField(const String &label)
Constructs a new time field with a specific label.
Definition: TimeField.cpp:82
+
bool isCurrent() const
Returns true if this field is the currently-displayed field in its owning form; false otherwise...
Definition: Field.cpp:169
+
void exitField()
Exits the field due to form navigation.
Definition: TimeField.cpp:205
+
void setValue(unsigned long value)
Sets the value of this time field, in seconds.
Definition: TimeField.cpp:227
+
+ + + + diff --git a/html/TimeField_8h_source.html b/html/TimeField_8h_source.html new file mode 100644 index 00000000..44b0b131 --- /dev/null +++ b/html/TimeField_8h_source.html @@ -0,0 +1,175 @@ + + + + + + +ArduinoLibs: TimeField.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TimeField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef TimeField_h
+
24 #define TimeField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 #define TIMEFIELD_READ_ONLY true
+
29 #define TIMEFIELD_READ_WRITE false
+
30 
+
31 class TimeField : public Field {
+
32 public:
+
33  explicit TimeField(const String &label);
+
34  TimeField(Form &form, const String &label, int maxHours, bool readOnly);
+
35 
+
36  int dispatch(int event);
+
37 
+
38  void enterField(bool reverse);
+
39  void exitField();
+
40 
+
41  unsigned long value() const { return _value; }
+
42  void setValue(unsigned long value);
+
43 
+
44  int maxHours() const { return _maxHours; }
+
45  void setMaxHours(int maxHours) { _maxHours = maxHours; }
+
46 
+
47  bool readOnly() const { return _readOnly; }
+
48  void setReadOnly(bool value);
+
49 
+
50 private:
+
51  unsigned long _value;
+
52  int _maxHours;
+
53  int _printLen;
+
54  bool _readOnly;
+
55  uint8_t editField;
+
56 
+
57  void printTime();
+
58  int printField(unsigned long value);
+
59 };
+
60 
+
61 #endif
+
void setMaxHours(int maxHours)
Sets the maximum number of hours before the field wraps around to maxHours.
Definition: TimeField.h:45
+
unsigned long value() const
Returns the current value of this time field, in seconds.
Definition: TimeField.h:41
+
void setReadOnly(bool value)
Sets the read-only state of this field to value.
Definition: TimeField.cpp:268
+
Manages a single data input/output field within a Form.
Definition: Field.h:28
+
Manager for a form containing data input/output fields.
Definition: Form.h:32
+
Form * form() const
Returns the Form that owns this field; null if not associated with a Form.
Definition: Field.h:34
+
int maxHours() const
Returns the maximum number of hours before the field wraps around.
Definition: TimeField.h:44
+
const String & label() const
Returns the label to display in the first line of this field.
Definition: Field.h:41
+
int dispatch(int event)
Dispatches event via this field.
Definition: TimeField.cpp:115
+
Field that manages the display and editing of a time value.
Definition: TimeField.h:31
+
bool readOnly() const
Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).
Definition: TimeField.h:47
+
void enterField(bool reverse)
Enters the field due to form navigation.
Definition: TimeField.cpp:193
+
TimeField(const String &label)
Constructs a new time field with a specific label.
Definition: TimeField.cpp:82
+
void exitField()
Exits the field due to form navigation.
Definition: TimeField.cpp:205
+
void setValue(unsigned long value)
Sets the value of this time field, in seconds.
Definition: TimeField.cpp:227
+
+ + + + diff --git a/html/TransistorNoiseSource_8cpp_source.html b/html/TransistorNoiseSource_8cpp_source.html new file mode 100644 index 00000000..ff4d01f1 --- /dev/null +++ b/html/TransistorNoiseSource_8cpp_source.html @@ -0,0 +1,303 @@ + + + + + + +ArduinoLibs: TransistorNoiseSource.cpp Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TransistorNoiseSource.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "TransistorNoiseSource.h"
+
24 #include "RNG.h"
+
25 #include "Crypto.h"
+
26 #include <Arduino.h>
+
27 
+
78 /*
+
79 
+
80 Theory of operation:
+
81 
+
82 From Rob Seward's original design we need to find the median of the input
+
83 signal. That is, the threshold at which half the signal is below the
+
84 threshold (a zero) and the other half is above the threshold (a one).
+
85 Rob used a histogram table to find the median which is memory-intensive.
+
86 We cannot afford to spend that much memory finding the median.
+
87 
+
88 In this implementation we divide the signal up into "buckets" of 1024
+
89 samples. We pick a starting threshold and count the number of ones
+
90 within the bucket. If the number of ones is between 45% to 55% of the
+
91 total number of samples, then we use that threshold to convert the
+
92 bucket into output bits. Otherwise we adjust the threshold up or down,
+
93 discard the bucket, and try again.
+
94 
+
95 After a few buckets, the threshold naturally settles at the median without
+
96 needing a histogram. The rest of the bucket processing can be done online
+
97 with storage needed only for the debiased output bits.
+
98 
+
99 If the input voltage to the noise source is too low to generate noise,
+
100 then the delta between the minimum and maximum samples in the bucket will
+
101 be quite small. This is used to detect disconnection of the noise source.
+
102 No output is generated when the noise source is disconnected.
+
103 
+
104 With 1024 raw input samples we get roughly 256 output bits after
+
105 Von Neumann debiasing. As a further check, the output will be discarded
+
106 if less than 192 bits are generated. This can happen when the noise source
+
107 is connected or disconnected: only part of the bucket is valid.
+
108 
+
109 One of the properties of Rob's circuit design is that over time the median
+
110 changes due to environmental factors and component wear. Because we adjust
+
111 the threshold from bucket to bucket, it should naturally float up or down
+
112 to the new median level as the circuit's properties change.
+
113 
+
114 */
+
115 
+
116 // Number of ADC values that can be generated by analogRead().
+
117 #define ADC_NUM 1024
+
118 
+
119 // Number of samples to collect for a single noise "bucket".
+
120 #define SAMPLES_NUM 1024
+
121 
+
122 // Calculate a percentage of the sample bucket size.
+
123 #define SAMPLES_PCT(num) ((int)(((long)SAMPLES_NUM) * (num) / 100L))
+
124 
+
125 // Expected spread between the minimum and maximum ADC readings for
+
126 // the noise source to be considered as operating correctly.
+
127 #define NOISE_SPREAD (ADC_NUM / 8)
+
128 
+
129 // Calibration states.
+
130 #define NOISE_NOT_CALIBRATING 0
+
131 #define NOISE_CALIBRATING 1
+
132 
+ +
139  : threshold(ADC_NUM / 2)
+
140  , _pin(pin)
+
141  , calState(NOISE_CALIBRATING)
+
142 {
+
143  // Configure the pin as an analog input with no pull-up.
+
144  pinMode(pin, INPUT);
+
145  digitalWrite(pin, LOW);
+
146 
+
147  // Start the bit collection routines.
+
148  restart();
+
149 }
+
150 
+
151 TransistorNoiseSource::~TransistorNoiseSource()
+
152 {
+
153  restart();
+
154 }
+
155 
+ +
157 {
+
158  return calState != NOISE_NOT_CALIBRATING;
+
159 }
+
160 
+ +
162 {
+
163  // Keep track of the minimum and maximum while generating data
+
164  // so that we can detect when the input voltage falls too low
+
165  // for the circuit to generate noise.
+
166  int value = analogRead(_pin);
+
167  if (value < minValue)
+
168  minValue = value;
+
169  if (value > maxValue)
+
170  maxValue = value;
+
171 
+
172  // Collect two bits of input and remove bias using the Von Neumann method.
+
173  // If both bits are the same, then discard both. Otherwise choose one
+
174  // of the bits and output that one. We have to do this carefully so that
+
175  // instruction timing does not reveal the value of the bit that is chosen.
+
176  uint8_t bit = ((threshold - value) >> 15) & 1; // Subtract and extract sign.
+
177  if (count & 1) {
+
178  if (prevBit ^ bit) {
+
179  // The bits are different: add the new bit to the buffer.
+
180  if (posn < sizeof(buffer)) {
+
181  buffer[posn] = (buffer[posn] << 1) | bit;
+
182  if (++bitNum >= 8) {
+
183  ++posn;
+
184  bitNum = 0;
+
185  }
+
186  }
+
187  }
+
188  } else {
+
189  prevBit = bit;
+
190  }
+
191 
+
192  // Keep a count of the number of raw 1 bits.
+
193  ones += bit;
+
194 
+
195  // Bail out if we haven't collected enough samples for a full bucket yet.
+
196  if (++count < SAMPLES_NUM)
+
197  return;
+
198 
+
199  // If the maximum minus the minimum is too small, then there probably
+
200  // is no signal or the input voltage is insufficient to generate noise.
+
201  // Discard the entire bucket and return to calibration.
+
202  if ((maxValue - minValue) < NOISE_SPREAD) {
+
203  restart();
+
204  calState = NOISE_CALIBRATING;
+
205  threshold = ADC_NUM / 2; // Reacquire threshold when the signal returns.
+
206  return;
+
207  }
+
208 
+
209  // If the number of 1's is between 45% and 55% of the total count,
+
210  // then we have a good bucket. The threshold is at an appropriate level.
+
211  if (ones >= SAMPLES_PCT(45) && ones <= SAMPLES_PCT(55)) {
+
212  if (posn >= (sizeof(buffer) * 3 / 4)) {
+
213  // The buffer is at least three-quarters full of debiased bits
+
214  // so pass them onto output(). There may be less bits if we
+
215  // lost or gained the signal half-way through the bucket.
+
216  // Credit 4 bits of entropy for every 8 bits of output.
+
217  output(buffer, posn, posn * 4);
+
218  }
+
219  restart();
+
220  calState = NOISE_NOT_CALIBRATING;
+
221  return;
+
222  }
+
223 
+
224  // The threshold is not close enough to the mid-point of the signal.
+
225  // Adjust the threshold, discard the bucket, and try again.
+
226  if (ones < SAMPLES_PCT(25) || ones > SAMPLES_PCT(75)) {
+
227  // We are a long way away from the mid-point, so move the threshold
+
228  // by a large amount based on the delta to get closer quicker.
+
229  threshold -= (SAMPLES_PCT(50) - ones) / 8;
+
230  } else if (ones < SAMPLES_PCT(50)) {
+
231  // Not enough ones so move the threshold down a bit.
+
232  --threshold;
+
233  } else {
+
234  // Too many ones so move the threshold up a bit.
+
235  ++threshold;
+
236  }
+
237  if (threshold < 0)
+
238  threshold = 0;
+
239  else if (threshold >= ADC_NUM)
+
240  threshold = ADC_NUM - 1;
+
241  restart();
+
242  calState = NOISE_CALIBRATING;
+
243 }
+
244 
+
248 void TransistorNoiseSource::restart()
+
249 {
+
250  clean(buffer);
+
251  prevBit = 0;
+
252  posn = 0;
+
253  bitNum = 0;
+
254  minValue = ADC_NUM - 1;
+
255  maxValue = 0;
+
256  count = 0;
+
257  ones = 0;
+
258 }
+
bool calibrating() const
Determine if the noise source is still calibrating itself.
+
virtual void output(const uint8_t *data, size_t len, unsigned int credit)
Called from subclasses to output noise to the global random number pool.
+
TransistorNoiseSource(uint8_t pin)
Constructs a new transitor-based noise source handler.
+
void stir()
Stirs entropy from this noise source into the global random number pool.
+
+ + + + diff --git a/html/TransistorNoiseSource_8h_source.html b/html/TransistorNoiseSource_8h_source.html new file mode 100644 index 00000000..c0bf95ac --- /dev/null +++ b/html/TransistorNoiseSource_8h_source.html @@ -0,0 +1,159 @@ + + + + + + +ArduinoLibs: TransistorNoiseSource.h Source File + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
TransistorNoiseSource.h
+
+
+
1 /*
+
2  * Copyright (C) 2015 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef CRYPTO_TRANSISTORNOISESOURCE_H
+
24 #define CRYPTO_TRANSISTORNOISESOURCE_H
+
25 
+
26 #include <inttypes.h>
+
27 #include "NoiseSource.h"
+
28 
+ +
30 {
+
31 public:
+
32  explicit TransistorNoiseSource(uint8_t pin);
+
33  virtual ~TransistorNoiseSource();
+
34 
+
35  bool calibrating() const;
+
36 
+
37  void stir();
+
38 
+
39 private:
+
40  int threshold;
+
41  uint8_t _pin;
+
42  uint8_t prevBit;
+
43  uint8_t posn;
+
44  uint8_t bitNum;
+
45  uint8_t calState;
+
46  uint8_t buffer[32];
+
47  int minValue;
+
48  int maxValue;
+
49  int count;
+
50  int ones;
+
51 
+
52  void restart();
+
53 };
+
54 
+
55 #endif
+
bool calibrating() const
Determine if the noise source is still calibrating itself.
+
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
+
Processes the signal from a transistor-based noise source.
+
TransistorNoiseSource(uint8_t pin)
Constructs a new transitor-based noise source handler.
+
void stir()
Stirs entropy from this noise source into the global random number pool.
+
+ + + + diff --git a/html/alarm-clock_8dox.html b/html/alarm-clock_8dox.html new file mode 100644 index 00000000..00c51ea8 --- /dev/null +++ b/html/alarm-clock_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: alarm-clock.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
alarm-clock.dox File Reference
+
+
+
+ + + + diff --git a/html/alarm_circuit.png b/html/alarm_circuit.png new file mode 100644 index 00000000..1a277032 Binary files /dev/null and b/html/alarm_circuit.png differ diff --git a/html/alarm_clock.html b/html/alarm_clock.html new file mode 100644 index 00000000..6834f30b --- /dev/null +++ b/html/alarm_clock.html @@ -0,0 +1,148 @@ + + + + + + +ArduinoLibs: Alarm Clock + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Alarm Clock
+
+
+

+Features

+

The alarm clock described on this page is a large example application that uses many of the classes in the provided libraries: LCD, Form, Field, SoftI2C, DS1307RTC (or DS3232RTC), Melody and PowerSave. The clock has the following features:

+ +

+Main circuit

+

The main clock circuit consists of an Arduino Uno compatible board, a 16x2 LCD module, a realtime clock chip, a piezo buzzer for the alarm, and a MOSFET for controlling the radio:

+
+alarm_circuit.png +
+

Some of the components can be purchased ready-made as the Freetronics 16x2 LCD Shield and the SparkFun Realtime Clock Module. I used the ready-made realtime clock module, but made my own equivalent to the LCD shield from parts to aid in spacing out the LCD and pushbuttons on the exterior of the box. The value of the 33R resistor may need to be adjusted for different types of back light LED's. See below for information on using a DS3232-based clock module instead of a DS1307-based module.

+

The whole circuit is built on a prototyping shield, with ribbon cables connecting to the LCD. The Stop Alarm button, piezo buzzer, and radio controller are not shown in this picture and some of the components are soldered to the bottom of the shield:

+
+clock_shield.jpg +
+

The clock module is based on the DS1307 chip and has an on-board coin battery to keep the time and date ticking over even if the main circuit loses power. The chip is I2C-based and has an auxillary SQW output that can be configured to provide a 1 Hz squarewave signal. This signal is used by the software running on the Arduino to detect when a new time or date is available for display on the LCD. The DS1307RTC class takes care of the details of talking to the chip via I2C.

+

+Arduino board

+

To keep power consumption low, say for being powered by batteries, we don't need a full Arduino Uno or similar board. The USB interface is unnecessary, as is the on-board power supply if there is an external source of 5 volt power. We also don't want the power and D13 status LED's to be draining power. Therefore, a cut-down version of the Arduino is recommended. We used the KitTen kit from Freetronics, and didn't solder up anything that wasn't strictly necessary. A 5v FTDI USB-to-Serial cable is necessary for programming. Similar minimalistic built-it-yourself Arduino designs should also work.

+
+kitten_minimal.jpg +
+

+Controlling a radio

+

The MOSFET connected to D11 can be used to control the power supply to a separate radio circuit so that the radio can be used as an alarm. In the following circuit, RadioV+ is the radio's power supply voltage (which may be the Arduino's 5V supply if the radio can run off 5V):

+
+radio_controller.png +
+

The output of the MOSFET can be used to control almost any kind of circuit; for example an extremely loud mechanical alarm bell. It doesn't have to be a radio. A 2N7000 or equivalent MOSFET is suitable for light loads up to 200mA. For larger currents, a higher-rated MOSFET should be used instead.

+

Double-tapping the Stop Alarm button will turn the radio on. Single-tapping the Stop Alarm button will turn the radio off. A settings field can also be used to turn the radio on and off.

+

+Using DS3232 instead of DS1307

+

For clock modules based on the DS3232 chip, such as the Freetronics Real Time Clock Module, change the Clock typedef in Clock.h to the following:

+
typedef DS3232RTC Clock;
+

The pads on the Freetronics module should be connected to the Arduino as follows:

+ +

+Completed Clock

+

The following picture shows the completed clock prototype, built into a UB1 jiffy box with the radio. Being the prototype, it is a little rough and ready, but rugged enough to take a pounding each morning as a bedside alarm clock:

+
+alarm_clock.jpg +
+
+ + + + diff --git a/html/alarm_clock.jpg b/html/alarm_clock.jpg new file mode 100644 index 00000000..721c7174 Binary files /dev/null and b/html/alarm_clock.jpg differ diff --git a/html/annotated.html b/html/annotated.html new file mode 100644 index 00000000..5613cb36 --- /dev/null +++ b/html/annotated.html @@ -0,0 +1,156 @@ + + + + + + +ArduinoLibs: Class List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
oCAES128AES block cipher with 128-bit keys
oCAES192AES block cipher with 192-bit keys
oCAES256AES block cipher with 256-bit keys
oCAESCommonAbstract base class for AES block ciphers
oCBitmapRepresents a monochrome bitmap within main memory
oCBLAKE2bBLAKE2b hash algorithm
oCBLAKE2sBLAKE2s hash algorithm
oCBlinkLEDBlink a LED on a digital output pin
oCBlockCipherAbstract base class for block ciphers
oCBoolFieldField that manages the input of a boolean value
oCCBCImplementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers
oCCBCCommonConcrete base class to assist with implementing CBC for 128-bit block ciphers
oCCFBImplementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers
oCCFBCommonConcrete base class to assist with implementing CFB for 128-bit block ciphers
oCChaChaChaCha stream cipher
oCCharlieplexManage an array of LED's in a charlieplexed arrangement
oCChaseLEDsChase LED's on output pins in a defined sequence
oCCipherAbstract base class for stream ciphers
oCCTRImplementation of the Counter (CTR) mode for 128-bit block ciphers
oCCTRCommonConcrete base class to assist with implementing CTR mode for 128-bit block ciphers
oCCurve25519Diffie-Hellman key agreement based on the elliptic curve modulo 2^255 - 19
oCDMDHandle large dot matrix displays composed of LED's
oCDS1307RTCCommunicates with a DS1307 realtime clock chip via I2C
oCDS3231RTCCommunicates with a DS3231 realtime clock chip via I2C
oCDS3232RTCCommunicates with a DS3232 realtime clock chip via I2C
oCEEPROM24Reading and writing EEPROM's from the 24LCXX family
oCFieldManages a single data input/output field within a Form
oCFormManager for a form containing data input/output fields
oCHashAbstract base class for cryptographic hash algorithms
oCI2CMasterAbstract base class for I2C master implementations
oCIntFieldField that manages the input of an integer value
oCIRreceiverManages the reception of RC-5 commands from an infrared remote control
oCKeccakCoreKeccak core sponge function
oCLCDEnhanced library for Freetronics 16x2 LCD shields
oCListFieldField that manages selection from a static list of items
oCMelodyPlays a melody on a digital output pin using tone()
oCNoiseSourceAbstract base class for random noise sources
oCOFBImplementation of the Output Feedback (OFB) mode for 128-bit block ciphers
oCOFBCommonConcrete base class to assist with implementing OFB for 128-bit block ciphers
oCRingOscillatorNoiseSourceProcesses the signal from a ring oscillator based noise source
oCRNGClassPseudo random number generator suitable for cryptography
oCRTCBase class for realtime clock handlers
oCRTCAlarmStores alarm information from a realtime clock chip
oCRTCDateStores date information from a realtime clock chip
oCRTCTimeStores time information from a realtime clock chip
oCSHA1SHA-1 hash algorithm
oCSHA256SHA-256 hash algorithm
oCSHA3_256SHA3-256 hash algorithm
oCSHA3_512SHA3-512 hash algorithm
oCSHA512SHA-512 hash algorithm
oCSoftI2CBit-banged implementation of an I2C master
oCTextFieldField that displays a read-only text value
oCTimeFieldField that manages the display and editing of a time value
\CTransistorNoiseSourceProcesses the signal from a transistor-based noise source
+
+
+ + + + diff --git a/html/bc_s.png b/html/bc_s.png new file mode 100644 index 00000000..224b29aa Binary files /dev/null and b/html/bc_s.png differ diff --git a/html/bdwn.png b/html/bdwn.png new file mode 100644 index 00000000..940a0b95 Binary files /dev/null and b/html/bdwn.png differ diff --git a/html/blink-blink_8dox.html b/html/blink-blink_8dox.html new file mode 100644 index 00000000..01c3a7b8 --- /dev/null +++ b/html/blink-blink_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: blink-blink.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
blink-blink.dox File Reference
+
+
+
+ + + + diff --git a/html/blink-charlieplex_8dox.html b/html/blink-charlieplex_8dox.html new file mode 100644 index 00000000..377150de --- /dev/null +++ b/html/blink-charlieplex_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: blink-charlieplex.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
blink-charlieplex.dox File Reference
+
+
+
+ + + + diff --git a/html/blink-cylon_8dox.html b/html/blink-cylon_8dox.html new file mode 100644 index 00000000..90953799 --- /dev/null +++ b/html/blink-cylon_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: blink-cylon.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
blink-cylon.dox File Reference
+
+
+
+ + + + diff --git a/html/blink-startrek_8dox.html b/html/blink-startrek_8dox.html new file mode 100644 index 00000000..03a3d125 --- /dev/null +++ b/html/blink-startrek_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: blink-startrek.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
blink-startrek.dox File Reference
+
+
+
+ + + + diff --git a/html/blink_blink.html b/html/blink_blink.html new file mode 100644 index 00000000..5f79d6ce --- /dev/null +++ b/html/blink_blink.html @@ -0,0 +1,128 @@ + + + + + + +ArduinoLibs: Blinking LED Example + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Blinking LED Example
+
+
+

The BlinkLED class provides support logic for blinking a LED connected to an output pin. The traditional way to blink a LED uses a delay loop:

+
void loop() {
+
digitalWrite(13, HIGH);
+
delay(1000);
+
digitalWrite(13, LOW);
+
delay(1000);
+
}
+

The problem with this code is that the entire application is blocked during the delay(). No other activities can be serviced. BlinkLED provides a re-entrant timer-based implementation that is simple to use in any application and which won't block other activities.

+

We start this example by including the BlinkLED class and instantiating an object instance:

+
#include <BlinkLED.h>
+
+
BlinkLED statusBlink(13, 70, 930);
+

+

In this example we have specified that the LED is on pin D13, the LED should be on for 70 milliseconds, and off for 930 milliseconds. This will cause the status LED to "strobe" once per second. The LED will be initially off for 930 milliseconds after device reset. To start with the LED on, use the following initialization code instead:

+
BlinkLED statusBlink(13, 70, 930, true);
+

The remaining code we need is a call to BlinkLED::loop() every time around the main application loop:

+
void loop() {
+
statusBlink.loop();
+
}
+

+

As can be seen, BlinkLED simplifies the process of blinking a LED quite considerably. It is also possible to pause() and resume() the blinking. This is useful in applications where a blinking LED indicates a certain state such as an error condition or a long-running operation that is in progress; with the LED off at other times. The on/off blink rate can be modified at runtime using BlinkLED::setBlinkRate(), and the LED can be set to a specific value using BlinkLED::setState().

+

The full source code for the example follows:

+
/*
+
Blink the status LED using the BlinkLED utility class.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <BlinkLED.h>
+
+
BlinkLED statusBlink(13, 70, 930);
+
+
void setup() {}
+
+
void loop() {
+
statusBlink.loop();
+
}
+
+
+ + + + diff --git a/html/blink_charlieplex.html b/html/blink_charlieplex.html new file mode 100644 index 00000000..57177cd1 --- /dev/null +++ b/html/blink_charlieplex.html @@ -0,0 +1,168 @@ + + + + + + +ArduinoLibs: Charlieplexing Example + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Charlieplexing Example
+
+
+

Charlieplexing is a technique for multiplexing large numbers of LED's on a small number of microcontroller output pins. LED's are arranged in complementary pairs and managed by the Charlieplex class. For this example we are going to use 3 output pins to drive 6 LED's:

+
+charlieplexeg.png +
+

The technique can be expanded to even larger numbers of LED's. See the documentation for the Charlieplex class for a description of how to connect up larger numbers of pins in a Charlieplexed arrangement.

+

The first step is to initialize a Charlieplex object with the output pins it needs to drive:

+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+

+

Then in setup() we use Charlieplex::setLed() and Charlieplex::setPwmLed() to set three of the six LED's to the desired output values:

+
void setup() {
+
charlie.setLed(0, true); // Turn on LED1
+
charlie.setLed(3, true); // Turn on LED4
+
charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
+
}
+

+

Charlieplexing can only light a single LED at a time. It is therefore necessary to constantly scan the entire LED array, alternatively turning LED's on and off. The user's peristence of vision fills in the gaps. To do this, we call Charlieplex::loop():

+
void loop() {
+
charlie.loop();
+
}
+

+

The downside of Charlieplexing is that when multiple LED's are lit, each LED will appear to be dimmer than if only a single LED was lit. This can be counteracted by using brighter LED's or smaller resistors. The danger with smaller resistors is that if the program crashes or locks up for some reason, a large amount of continuous current could be fed through a single LED and cause it to exceed its maximum rating and burn out.

+

The full source code for the example follows:

+
/* This example is placed into the public domain */
+
+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+
+
void setup() {
+
charlie.setLed(0, true); // Turn on LED1
+
charlie.setLed(3, true); // Turn on LED4
+
charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
+
}
+
+
void loop() {
+
charlie.loop();
+
}
+

A more complex example that performs a LED chase over the 6 LED's follows:

+
/* This example is placed into the public domain */
+
+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+
+
int previous = 1;
+
int current = 0;
+
int step = 1;
+
unsigned long lastTime;
+
+
void setup() {
+
lastTime = millis();
+
charlie.setLed(current, true);
+
charlie.setPwmLed(previous, 64);
+
}
+
+
void loop() {
+
if ((millis() - lastTime) >= 100) {
+
charlie.setLed(previous, false);
+
charlie.setPwmLed(current, 64);
+
previous = current;
+
current += step;
+
if (current < 0) {
+
current = 1;
+
step = 1;
+
} else if (current >= charlie.count()) {
+
current = charlie.count() - 2;
+
step = -1;
+
}
+
charlie.setLed(current, true);
+
lastTime += 100;
+
}
+
charlie.loop();
+
}
+
+ + + + diff --git a/html/blink_cylon.html b/html/blink_cylon.html new file mode 100644 index 00000000..849d1bfb --- /dev/null +++ b/html/blink_cylon.html @@ -0,0 +1,179 @@ + + + + + + +ArduinoLibs: Cylon Eyes Example + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Cylon Eyes Example
+
+
+

This example shows how to use the ChaseLEDs class to simulate the Cylon eye effect from Battlestar Galactica. Digital outputs are used to drive six LED's in a back and forth motion, using the following schematic:

+
+Cylon.png +
+

We start by including the ChaseLEDs class:

+
#include <ChaseLEDs.h>
+

+

The next step is to define the pins that the chase will run over:

+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
ChaseLEDs cylonEyes(pins, sizeof(pins), 100);
+

+

The chase runs from the first pin to the sixth pin and back again, with each LED lit for 100 milliseconds before moving onto the next one. To complete the example, we need to call ChaseLEDs::loop() each time around our main loop to cause the chase to run:

+
void loop() {
+
cylonEyes.loop();
+
}
+

+

While this example uses only six pins, it can be easily extended to any number of pins by modifying the pins array and altering the schematic accordingly.

+

So far we are chasing only a single LED. We could change this to chase two adjacent LED's instead by defining a new CylonChase class that inherits from ChaseLEDs:

+
class CylonChase : public ChaseLEDs
+
{
+
public:
+
CylonChase(const byte *pins, int num, unsigned long advanceTime)
+
: ChaseLEDs(pins, num, advanceTime) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
digitalWrite(prevPin, HIGH);
+
digitalWrite(nextPin, HIGH);
+
}
+
};
+

+

The important part is the implementation of the advance() method, which overrides ChaseLEDs::advance() to provide our own scheme for lighting the LED's each time the chase advances. We use ChaseLEDs::previousPin() to get the pin that is 2 steps back in the sequence, set it to LOW, and then set the previous pin (1 step back) and the next pin to HIGH. All that remains is to change our chase initialization to use the new class:

+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
CylonChase cylonEyes(pins, sizeof(pins), 100);
+

+

We can do even better than this. Instead of fully lighting both LED's, we could instead use the PWM outputs to dim the previous pin, creating a kind of "trailing flame" effect:

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
}
+

+

The current chase is fixed at 100 milliseconds per LED, which takes a full second to run the sequence. An alternative to hard-wiring the chase rate is to hook up a 10K potentiometer to the A0 analog input:

+
+Cylon4.png +
+

We then modify the advance() method to read the new chase rate from the potentiometer each time the LED advances:

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
+
}
+

+

The full source code for the final version of the example follows:

+
/*
+
Sketch that manipulates Arduino outputs to create the "Cylon Eyes" effect from
+
Battlestar Galactica. It uses the ChaseLEDs utility class.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <ChaseLEDs.h>
+
+
class CylonChase : public ChaseLEDs
+
{
+
public:
+
CylonChase(const byte *pins, int num, unsigned long advanceTime)
+
: ChaseLEDs(pins, num, advanceTime) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
+
}
+
};
+
+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
CylonChase cylonEyes(pins, sizeof(pins), 100);
+
+
void setup() {}
+
+
void loop() {
+
cylonEyes.loop();
+
}
+
+
+ + + + diff --git a/html/blink_startrek.html b/html/blink_startrek.html new file mode 100644 index 00000000..0fe407fd --- /dev/null +++ b/html/blink_startrek.html @@ -0,0 +1,245 @@ + + + + + + +ArduinoLibs: Star Trek Example + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Star Trek Example
+
+
+

This example shows how to use the BlinkLED and ChaseLEDs classes to simulate the running lights on the starship Enterprise from Star Trek. This can be used as the basis for lighting a model kit. It is recommended that you read the Blink and Cylon tutorials first.

+

There are four categories of lights on the Enterprise:

+ +

Different models of the Enterprise have the lights in different places, and the period of flashing can vary from TV show to show, and sometimes from episode to episode. There isn't a definitive set of blink timings or number of LED's in the nacelle chase. The sketch has a number of configurable parameters that gives the user the freedom to choose which show and/or episode they wish to treat as "canonical" for their model.

+

We start by building a test circuit with a small number of LED's for each of the three categories (navigation, strobe, and nacelles):

+
+StarTrek.png +
+

This won't be the final circuit for the model, but building it on a breadboard will help with the initial prototyping stages and choosing the appropriate blink timings:

+
+StarTrekBreadboard.png +
+

Alternatively, the test circuit can be built on a prototyping shield with the chase LED's in a circular arrangement to simulate how they will look when placed in the front of the model's warp nacelles:

+
+StarTrekShield.png +
+

Now that we have a circuit, let's configure the red navigation LED on AOUT2 using the BlinkLED class, to blink with a period of 1000 milliseconds on, 1000 milliseconds off:

+
#include <BlinkLED.h>
+
#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights
+
#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)
+
#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)
+
BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
+

+

We repeat the process for the strobe LED on AOUT3, with a period of 70 milliseconds on, and 830 milliseconds off:

+
#define STROBE_LIGHT A3 // Output pin for controlling the strobe
+
#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)
+
#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)
+
BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
+

+

We also need to arrange for BlinkLED::loop() to be called from the application's main loop() function:

+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
}
+

If you run the sketch at this point, you should see the navigation and strobe LED's blink with the selected rates.

+

Next is the twirl effect in the warp nacelles, using the ChaseLEDs class. We are actually going to inherit from ChaseLEDs to create a custom LED chaser that reads the chase rate from AIN0 and uses PWM outputs to create a trailing flame effect. See the Cylon example for more information on creating custom effects with ChaseLEDs.

+
#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6
+
#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255
+
+
// Output pins to use for the nacelle chase
+
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
+
+
class NacelleChaseLEDs : public ChaseLEDs
+
{
+
public:
+
NacelleChaseLEDs(const byte *pins, int num)
+
: ChaseLEDs(pins, num, 0) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+
};
+
+
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
+

+

We also need to add a call to ChaseLEDs::loop() to the application's main loop:

+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
nacelleChase.loop();
+
}
+

+

Running the sketch now should cause the six LED's in the nacelle sequence to chase, in addition to the navigation and strobe LED's. The 10K potentiometer can be used to select the desired chase rate. This completes the test circuit, and will allow you to fiddle with the blink timings and chase rate until you are happy with the result.

+

We've made provision in this sketch for six outputs in the chase, but some models may only use three or five. The NACELLE_CHASE_LEN parameter controls the length of the chase.

+

With three outputs, the LED's can be arranged in opposite pairs, lighting two LED's at a time. The following circuit demonstrates how three outputs can be used to drive six LED's:

+
+ThreeChase.png +
+

You will need two of these circuits, for the left and right warp nacelles. The transistor drivers reduce the current load on the Arduino CPU and provide the option to drive the LED's from 12V instead of 5V.

+

It is recommended that you use transistor drivers for the navigation and strobe lights as well as there will be multiple LED's on each output in a real model. For example, there will be at least three each of the red and green navigation lights: the top of the saucer section, the bottom of the saucer section, and the top of the warp nacelle. Using a 12V supply will make it easier to string lots of LED's together in series.

+

Other nacelle effects are possible by modifying the advance() method in the sketch. For example, the "opposite pairs" effect with 3 outputs can also be done with 6 outputs and the following modification to the sketch:

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(5), LOW);
+
analogWrite(previousPin(4), NACELLE_DIM_VALUE);
+
digitalWrite(previousPin(3), HIGH);
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+

+

The full source code for the example, including the "opposite pairs" effect, follows:

+
/*
+
Sketch that manipulates Arduino outputs to create Star Trek Enterprise style
+
running lights and LED chasers.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <BlinkLED.h>
+
#include <ChaseLEDs.h>
+
+
#define NACELLE_RATE A0 // Analog input for reading the nacelle chase rate
+
#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights
+
#define STROBE_LIGHT A3 // Output pin for controlling the strobe
+
+
// Configurable parameters.
+
#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)
+
#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)
+
#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)
+
#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)
+
#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6
+
#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255
+
+
// Output pins to use for the nacelle chase
+
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
+
+
class NacelleChaseLEDs : public ChaseLEDs
+
{
+
public:
+
NacelleChaseLEDs(const byte *pins, int num)
+
: ChaseLEDs(pins, num, 0) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(5), LOW);
+
analogWrite(previousPin(4), NACELLE_DIM_VALUE);
+
digitalWrite(previousPin(3), HIGH);
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+
};
+
+
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
+
+
BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
+
BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
+
+
void setup() {
+
// Turn off the status LED on the Arduino board (we don't need it).
+
pinMode(13, OUTPUT);
+
digitalWrite(13, LOW);
+
}
+
+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
nacelleChase.loop();
+
}
+
+
+ + + + diff --git a/html/charlieplex2pin.png b/html/charlieplex2pin.png new file mode 100644 index 00000000..838b30a3 Binary files /dev/null and b/html/charlieplex2pin.png differ diff --git a/html/charlieplex3pin.png b/html/charlieplex3pin.png new file mode 100644 index 00000000..4b0391b3 Binary files /dev/null and b/html/charlieplex3pin.png differ diff --git a/html/charlieplex4pin.png b/html/charlieplex4pin.png new file mode 100644 index 00000000..9bbaa264 Binary files /dev/null and b/html/charlieplex4pin.png differ diff --git a/html/charlieplex5pin.png b/html/charlieplex5pin.png new file mode 100644 index 00000000..05bc4bd1 Binary files /dev/null and b/html/charlieplex5pin.png differ diff --git a/html/charlieplexeg.png b/html/charlieplexeg.png new file mode 100644 index 00000000..48772ac8 Binary files /dev/null and b/html/charlieplexeg.png differ diff --git a/html/classAES128-members.html b/html/classAES128-members.html new file mode 100644 index 00000000..28f256cd --- /dev/null +++ b/html/classAES128-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
AES128 Member List
+
+
+ +

This is the complete list of members for AES128, including all inherited members.

+ + + + + + + + + + + + + +
AES128()AES128
AESCommon()AESCommonprotected
BlockCipher()BlockCipher
blockSize() const AESCommonvirtual
clear()AESCommonvirtual
decryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
encryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
keySize() const AES128virtual
setKey(const uint8_t *key, size_t len)AES128virtual
~AES128() (defined in AES128)AES128virtual
~AESCommon()AESCommonvirtual
~BlockCipher()BlockCiphervirtual
+ + + + diff --git a/html/classAES128.html b/html/classAES128.html new file mode 100644 index 00000000..cc8ec213 --- /dev/null +++ b/html/classAES128.html @@ -0,0 +1,273 @@ + + + + + + +ArduinoLibs: AES128 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
AES128 Class Reference
+
+
+ +

AES block cipher with 128-bit keys. + More...

+ +

#include <AES.h>

+
+Inheritance diagram for AES128:
+
+
+ + +AESCommon +BlockCipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 AES128 ()
 Constructs an AES 128-bit block cipher with no initial key. More...
 
size_t keySize () const
 Size of a 128-bit AES key in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
- Public Member Functions inherited from AESCommon
+virtual ~AESCommon ()
 Destroys this AES block cipher object after clearing sensitive information.
 
size_t blockSize () const
 Size of an AES block in bytes. More...
 
void encryptBlock (uint8_t *output, const uint8_t *input)
 Encrypts a single block using this cipher. More...
 
void decryptBlock (uint8_t *output, const uint8_t *input)
 Decrypts a single block using this cipher. More...
 
void clear ()
 Clears all security-sensitive state from this block cipher. More...
 
- Public Member Functions inherited from BlockCipher
BlockCipher ()
 Constructs a block cipher.
 
virtual ~BlockCipher ()
 Destroys this block cipher object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from AESCommon
AESCommon ()
 Constructs an AES block cipher object.
 
+

Detailed Description

+

AES block cipher with 128-bit keys.

+
See Also
AES192, AES256
+ +

Definition at line 56 of file AES.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
AES128::AES128 ()
+
+ +

Constructs an AES 128-bit block cipher with no initial key.

+

This constructor must be followed by a call to setKey() before the block cipher can be used for encryption or decryption.

+ +

Definition at line 40 of file AES128.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t AES128::keySize () const
+
+virtual
+
+ +

Size of a 128-bit AES key in bytes.

+
Returns
Always returns 16.
+ +

Implements BlockCipher.

+ +

Definition at line 55 of file AES128.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool AES128::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+
See Also
keySize(), clear()
+ +

Implements BlockCipher.

+ +

Definition at line 60 of file AES128.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classAES128.png b/html/classAES128.png new file mode 100644 index 00000000..c158a9d1 Binary files /dev/null and b/html/classAES128.png differ diff --git a/html/classAES192-members.html b/html/classAES192-members.html new file mode 100644 index 00000000..fbfd8edb --- /dev/null +++ b/html/classAES192-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
AES192 Member List
+
+
+ +

This is the complete list of members for AES192, including all inherited members.

+ + + + + + + + + + + + + +
AES192()AES192
AESCommon()AESCommonprotected
BlockCipher()BlockCipher
blockSize() const AESCommonvirtual
clear()AESCommonvirtual
decryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
encryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
keySize() const AES192virtual
setKey(const uint8_t *key, size_t len)AES192virtual
~AES192() (defined in AES192)AES192virtual
~AESCommon()AESCommonvirtual
~BlockCipher()BlockCiphervirtual
+ + + + diff --git a/html/classAES192.html b/html/classAES192.html new file mode 100644 index 00000000..d53b18a3 --- /dev/null +++ b/html/classAES192.html @@ -0,0 +1,273 @@ + + + + + + +ArduinoLibs: AES192 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
AES192 Class Reference
+
+
+ +

AES block cipher with 192-bit keys. + More...

+ +

#include <AES.h>

+
+Inheritance diagram for AES192:
+
+
+ + +AESCommon +BlockCipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 AES192 ()
 Constructs an AES 192-bit block cipher with no initial key. More...
 
size_t keySize () const
 Size of a 192-bit AES key in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
- Public Member Functions inherited from AESCommon
+virtual ~AESCommon ()
 Destroys this AES block cipher object after clearing sensitive information.
 
size_t blockSize () const
 Size of an AES block in bytes. More...
 
void encryptBlock (uint8_t *output, const uint8_t *input)
 Encrypts a single block using this cipher. More...
 
void decryptBlock (uint8_t *output, const uint8_t *input)
 Decrypts a single block using this cipher. More...
 
void clear ()
 Clears all security-sensitive state from this block cipher. More...
 
- Public Member Functions inherited from BlockCipher
BlockCipher ()
 Constructs a block cipher.
 
virtual ~BlockCipher ()
 Destroys this block cipher object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from AESCommon
AESCommon ()
 Constructs an AES block cipher object.
 
+

Detailed Description

+

AES block cipher with 192-bit keys.

+
See Also
AES128, AES256
+ +

Definition at line 70 of file AES.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
AES192::AES192 ()
+
+ +

Constructs an AES 192-bit block cipher with no initial key.

+

This constructor must be followed by a call to setKey() before the block cipher can be used for encryption or decryption.

+ +

Definition at line 40 of file AES192.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t AES192::keySize () const
+
+virtual
+
+ +

Size of a 192-bit AES key in bytes.

+
Returns
Always returns 24.
+ +

Implements BlockCipher.

+ +

Definition at line 55 of file AES192.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool AES192::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+
See Also
keySize(), clear()
+ +

Implements BlockCipher.

+ +

Definition at line 60 of file AES192.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classAES192.png b/html/classAES192.png new file mode 100644 index 00000000..23ac333b Binary files /dev/null and b/html/classAES192.png differ diff --git a/html/classAES256-members.html b/html/classAES256-members.html new file mode 100644 index 00000000..8431b8de --- /dev/null +++ b/html/classAES256-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
AES256 Member List
+
+
+ +

This is the complete list of members for AES256, including all inherited members.

+ + + + + + + + + + + + + +
AES256()AES256
AESCommon()AESCommonprotected
BlockCipher()BlockCipher
blockSize() const AESCommonvirtual
clear()AESCommonvirtual
decryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
encryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
keySize() const AES256virtual
setKey(const uint8_t *key, size_t len)AES256virtual
~AES256() (defined in AES256)AES256virtual
~AESCommon()AESCommonvirtual
~BlockCipher()BlockCiphervirtual
+ + + + diff --git a/html/classAES256.html b/html/classAES256.html new file mode 100644 index 00000000..4e246bea --- /dev/null +++ b/html/classAES256.html @@ -0,0 +1,273 @@ + + + + + + +ArduinoLibs: AES256 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
AES256 Class Reference
+
+
+ +

AES block cipher with 256-bit keys. + More...

+ +

#include <AES.h>

+
+Inheritance diagram for AES256:
+
+
+ + +AESCommon +BlockCipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 AES256 ()
 Constructs an AES 256-bit block cipher with no initial key. More...
 
size_t keySize () const
 Size of a 256-bit AES key in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
- Public Member Functions inherited from AESCommon
+virtual ~AESCommon ()
 Destroys this AES block cipher object after clearing sensitive information.
 
size_t blockSize () const
 Size of an AES block in bytes. More...
 
void encryptBlock (uint8_t *output, const uint8_t *input)
 Encrypts a single block using this cipher. More...
 
void decryptBlock (uint8_t *output, const uint8_t *input)
 Decrypts a single block using this cipher. More...
 
void clear ()
 Clears all security-sensitive state from this block cipher. More...
 
- Public Member Functions inherited from BlockCipher
BlockCipher ()
 Constructs a block cipher.
 
virtual ~BlockCipher ()
 Destroys this block cipher object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from AESCommon
AESCommon ()
 Constructs an AES block cipher object.
 
+

Detailed Description

+

AES block cipher with 256-bit keys.

+
See Also
AES128, AES192
+ +

Definition at line 84 of file AES.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
AES256::AES256 ()
+
+ +

Constructs an AES 256-bit block cipher with no initial key.

+

This constructor must be followed by a call to setKey() before the block cipher can be used for encryption or decryption.

+ +

Definition at line 40 of file AES256.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t AES256::keySize () const
+
+virtual
+
+ +

Size of a 256-bit AES key in bytes.

+
Returns
Always returns 32.
+ +

Implements BlockCipher.

+ +

Definition at line 55 of file AES256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool AES256::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+
See Also
keySize(), clear()
+ +

Implements BlockCipher.

+ +

Definition at line 60 of file AES256.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classAES256.png b/html/classAES256.png new file mode 100644 index 00000000..52d33d16 Binary files /dev/null and b/html/classAES256.png differ diff --git a/html/classAESCommon-members.html b/html/classAESCommon-members.html new file mode 100644 index 00000000..63999532 --- /dev/null +++ b/html/classAESCommon-members.html @@ -0,0 +1,111 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
AESCommon Member List
+
+
+ +

This is the complete list of members for AESCommon, including all inherited members.

+ + + + + + + + + + + +
AESCommon()AESCommonprotected
BlockCipher()BlockCipher
blockSize() const AESCommonvirtual
clear()AESCommonvirtual
decryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
encryptBlock(uint8_t *output, const uint8_t *input)AESCommonvirtual
keySize() const =0BlockCipherpure virtual
setKey(const uint8_t *key, size_t len)=0BlockCipherpure virtual
~AESCommon()AESCommonvirtual
~BlockCipher()BlockCiphervirtual
+ + + + diff --git a/html/classAESCommon.html b/html/classAESCommon.html new file mode 100644 index 00000000..4632aeb5 --- /dev/null +++ b/html/classAESCommon.html @@ -0,0 +1,330 @@ + + + + + + +ArduinoLibs: AESCommon Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
AESCommon Class Reference
+
+
+ +

Abstract base class for AES block ciphers. + More...

+ +

#include <AES.h>

+
+Inheritance diagram for AESCommon:
+
+
+ + +BlockCipher +AES128 +AES192 +AES256 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual ~AESCommon ()
 Destroys this AES block cipher object after clearing sensitive information.
 
size_t blockSize () const
 Size of an AES block in bytes. More...
 
void encryptBlock (uint8_t *output, const uint8_t *input)
 Encrypts a single block using this cipher. More...
 
void decryptBlock (uint8_t *output, const uint8_t *input)
 Decrypts a single block using this cipher. More...
 
void clear ()
 Clears all security-sensitive state from this block cipher. More...
 
- Public Member Functions inherited from BlockCipher
BlockCipher ()
 Constructs a block cipher.
 
virtual ~BlockCipher ()
 Destroys this block cipher object. More...
 
virtual size_t keySize () const =0
 Default size of the key for this block cipher, in bytes. More...
 
virtual bool setKey (const uint8_t *key, size_t len)=0
 Sets the key to use for future encryption and decryption operations. More...
 
+ + + + +

+Protected Member Functions

AESCommon ()
 Constructs an AES block cipher object.
 
+

Detailed Description

+

Abstract base class for AES block ciphers.

+

This class is abstract. The caller should instantiate AES128, AES192, or AES256 to create an AES block cipher with a specific key size.

+
Note
This AES implementation does not have constant cache behaviour due to the use of table lookups. It may not be safe to use this implementation in an environment where the attacker can observe the timing of encryption and decryption operations. Unless AES compatibility is required, it is recommended that the ChaCha stream cipher be used instead.
+

Reference: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

+
See Also
ChaCha, AES128, AES192, AES256
+ +

Definition at line 28 of file AES.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t AESCommon::blockSize () const
+
+virtual
+
+ +

Size of an AES block in bytes.

+
Returns
Always returns 16.
+ +

Implements BlockCipher.

+ +

Definition at line 144 of file AESCommon.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void AESCommon::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this block cipher.

+

Security-sensitive information includes key schedules and any temporary state that is used by encryptBlock() or decryptBlock() which is stored in the object itself.

+
See Also
setKey(), encryptBlock(), decryptBlock()
+ +

Implements BlockCipher.

+ +

Definition at line 324 of file AESCommon.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void AESCommon::decryptBlock (uint8_t * output,
const uint8_t * input 
)
+
+virtual
+
+ +

Decrypts a single block using this cipher.

+
Parameters
+ + + +
outputThe output buffer to put the plaintext into. Must be at least blockSize() bytes in length.
inputThe input buffer to read the ciphertext from which is allowed to overlap with output. Must be at least blockSize() bytes in length.
+
+
+
See Also
encryptBlock(), blockSize()
+ +

Implements BlockCipher.

+ +

Definition at line 295 of file AESCommon.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void AESCommon::encryptBlock (uint8_t * output,
const uint8_t * input 
)
+
+virtual
+
+ +

Encrypts a single block using this cipher.

+
Parameters
+ + + +
outputThe output buffer to put the ciphertext into. Must be at least blockSize() bytes in length.
inputThe input buffer to read the plaintext from which is allowed to overlap with output. Must be at least blockSize() bytes in length.
+
+
+
See Also
decryptBlock(), blockSize()
+ +

Implements BlockCipher.

+ +

Definition at line 266 of file AESCommon.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classAESCommon.png b/html/classAESCommon.png new file mode 100644 index 00000000..043e2f5d Binary files /dev/null and b/html/classAESCommon.png differ diff --git a/html/classBLAKE2b-members.html b/html/classBLAKE2b-members.html new file mode 100644 index 00000000..2245aae3 --- /dev/null +++ b/html/classBLAKE2b-members.html @@ -0,0 +1,121 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
BLAKE2b Member List
+
+
+ +

This is the complete list of members for BLAKE2b, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
BLAKE2b()BLAKE2b
blockSize() const BLAKE2bvirtual
chunkSize (defined in BLAKE2b)BLAKE2b
clear()BLAKE2bvirtual
finalize(void *hash, size_t len)BLAKE2bvirtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)BLAKE2bvirtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
h (defined in BLAKE2b)BLAKE2b
Hash()Hash
hashSize() const BLAKE2bvirtual
lengthHigh (defined in BLAKE2b)BLAKE2b
lengthLow (defined in BLAKE2b)BLAKE2b
m (defined in BLAKE2b)BLAKE2b
reset()BLAKE2bvirtual
reset(uint8_t outputLength)BLAKE2b
resetHMAC(const void *key, size_t keyLen)BLAKE2bvirtual
update(const void *data, size_t len)BLAKE2bvirtual
v (defined in BLAKE2b)BLAKE2b
~BLAKE2b()BLAKE2bvirtual
~Hash()Hashvirtual
+ + + + diff --git a/html/classBLAKE2b.html b/html/classBLAKE2b.html new file mode 100644 index 00000000..01d9746c --- /dev/null +++ b/html/classBLAKE2b.html @@ -0,0 +1,544 @@ + + + + + + +ArduinoLibs: BLAKE2b Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
BLAKE2b Class Reference
+
+
+ +

BLAKE2b hash algorithm. + More...

+ +

#include <BLAKE2b.h>

+
+Inheritance diagram for BLAKE2b:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

BLAKE2b ()
 Constructs a BLAKE2b hash object.
 
+virtual ~BLAKE2b ()
 Destroys this BLAKE2b hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void reset (uint8_t outputLength)
 Resets the hash ready for a new hashing process with a specified output length. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

BLAKE2b hash algorithm.

+

BLAKE2b is a variation on the ChaCha stream cipher, designed for hashing, with a 512-bit hash output. It is intended as a high performance replacement for SHA512 for when speed is critical but exact SHA512 compatibility is not.

+

Reference: https://blake2.net/

+
See Also
BLAKE2s, SHA512
+ +

Definition at line 28 of file BLAKE2b.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t BLAKE2b::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 66 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BLAKE2b::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 159 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2b::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 143 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void BLAKE2b::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 172 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t BLAKE2b::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 61 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BLAKE2b::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 81 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void BLAKE2b::reset (uint8_t outputLength)
+
+ +

Resets the hash ready for a new hashing process with a specified output length.

+
Parameters
+ + +
outputLengthThe output length to use for the final hash in bytes, between 1 and 64.
+
+
+ +

Definition at line 103 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2b::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 165 of file BLAKE2b.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2b::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 118 of file BLAKE2b.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBLAKE2b.png b/html/classBLAKE2b.png new file mode 100644 index 00000000..36e374b9 Binary files /dev/null and b/html/classBLAKE2b.png differ diff --git a/html/classBLAKE2s-members.html b/html/classBLAKE2s-members.html new file mode 100644 index 00000000..29370c11 --- /dev/null +++ b/html/classBLAKE2s-members.html @@ -0,0 +1,120 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
BLAKE2s Member List
+
+
+ +

This is the complete list of members for BLAKE2s, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
BLAKE2s()BLAKE2s
blockSize() const BLAKE2svirtual
chunkSize (defined in BLAKE2s)BLAKE2s
clear()BLAKE2svirtual
finalize(void *hash, size_t len)BLAKE2svirtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)BLAKE2svirtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
h (defined in BLAKE2s)BLAKE2s
Hash()Hash
hashSize() const BLAKE2svirtual
length (defined in BLAKE2s)BLAKE2s
m (defined in BLAKE2s)BLAKE2s
reset()BLAKE2svirtual
reset(uint8_t outputLength)BLAKE2s
resetHMAC(const void *key, size_t keyLen)BLAKE2svirtual
update(const void *data, size_t len)BLAKE2svirtual
v (defined in BLAKE2s)BLAKE2s
~BLAKE2s()BLAKE2svirtual
~Hash()Hashvirtual
+ + + + diff --git a/html/classBLAKE2s.html b/html/classBLAKE2s.html new file mode 100644 index 00000000..e99bcd40 --- /dev/null +++ b/html/classBLAKE2s.html @@ -0,0 +1,544 @@ + + + + + + +ArduinoLibs: BLAKE2s Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
BLAKE2s Class Reference
+
+
+ +

BLAKE2s hash algorithm. + More...

+ +

#include <BLAKE2s.h>

+
+Inheritance diagram for BLAKE2s:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

BLAKE2s ()
 Constructs a BLAKE2s hash object.
 
+virtual ~BLAKE2s ()
 Destroys this BLAKE2s hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void reset (uint8_t outputLength)
 Resets the hash ready for a new hashing process with a specified output length. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

BLAKE2s hash algorithm.

+

BLAKE2s is a variation on the ChaCha stream cipher, designed for hashing, with a 256-bit hash output. It is intended as a high performance replacement for SHA256 for when speed is critical but exact SHA256 compatibility is not.

+

Reference: https://blake2.net/

+
See Also
SHA256
+ +

Definition at line 28 of file BLAKE2s.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t BLAKE2s::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 66 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BLAKE2s::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 154 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2s::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 138 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void BLAKE2s::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 167 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t BLAKE2s::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 61 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BLAKE2s::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 81 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void BLAKE2s::reset (uint8_t outputLength)
+
+ +

Resets the hash ready for a new hashing process with a specified output length.

+
Parameters
+ + +
outputLengthThe output length to use for the final hash in bytes, between 1 and 32.
+
+
+ +

Definition at line 102 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2s::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 160 of file BLAKE2s.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BLAKE2s::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 116 of file BLAKE2s.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBLAKE2s.png b/html/classBLAKE2s.png new file mode 100644 index 00000000..e9b75459 Binary files /dev/null and b/html/classBLAKE2s.png differ diff --git a/html/classBitmap-members.html b/html/classBitmap-members.html new file mode 100644 index 00000000..35e337b1 --- /dev/null +++ b/html/classBitmap-members.html @@ -0,0 +1,146 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Bitmap Member List
+
+
+ +

This is the complete list of members for Bitmap, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bitmap(int width, int height)Bitmap
bitsPerPixel() const Bitmapinline
BlackBitmapstatic
charWidth(char ch) const Bitmap
clear(Color color=Black)Bitmap
Color typedefBitmap
copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
data()Bitmapinline
data() const Bitmapinline
DMD (defined in Bitmap)Bitmapfriend
drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)Bitmap
drawChar(int x, int y, char ch)Bitmap
drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmapinline
drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmapinline
drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmapinline
drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)Bitmapinline
drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawText(int x, int y, const char *str, int len=-1)Bitmap
drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
fill(int x, int y, int width, int height, Color color)Bitmap
fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)Bitmap
font() const Bitmapinline
Font typedefBitmap
height() const Bitmapinline
invert(int x, int y, int width, int height)Bitmap
isValid() const Bitmapinline
NoFillBitmapstatic
pixel(int x, int y) const Bitmap
ProgMem typedefBitmap
scroll(int dx, int dy, Color fillColor=Black)Bitmapinline
scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
setFont(Font font)Bitmapinline
setPixel(int x, int y, Color color)Bitmap
setTextColor(Color color)Bitmapinline
stride() const Bitmapinline
textColor() const Bitmapinline
textHeight() const Bitmap
textWidth(const char *str, int len=-1) const Bitmap
textWidth(const String &str, int start=0, int len=-1) const Bitmap
WhiteBitmapstatic
width() const Bitmapinline
~Bitmap()Bitmap
+ + + + diff --git a/html/classBitmap.html b/html/classBitmap.html new file mode 100644 index 00000000..5bade799 --- /dev/null +++ b/html/classBitmap.html @@ -0,0 +1,1753 @@ + + + + + + +ArduinoLibs: Bitmap Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Types | +Public Member Functions | +Static Public Attributes | +Friends | +List of all members
+
+
Bitmap Class Reference
+
+
+ +

Represents a monochrome bitmap within main memory. + More...

+ +

#include <Bitmap.h>

+
+Inheritance diagram for Bitmap:
+
+
+ + +DMD + +
+ + + + + + + + + + + +

+Public Types

typedef uint8_t Color
 Type that represents the color of a pixel in a bitmap. More...
 
+typedef PGM_VOID_P ProgMem
 Type that represents a bitmap within program memory.
 
+typedef PGM_VOID_P Font
 Type that represents a font within program memory.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Bitmap (int width, int height)
 Constructs a new in-memory bitmap that is width x height pixels in size. More...
 
~Bitmap ()
 Destroys this bitmap.
 
bool isValid () const
 Returns true if the memory for this bitmap is valid; false otherwise. More...
 
int width () const
 Returns the width of the bitmap in pixels. More...
 
int height () const
 Returns the height of the bitmap in pixels. More...
 
int stride () const
 Returns the number of bytes in each line of the bitmap's data() buffer. More...
 
int bitsPerPixel () const
 Returns the number of bits per pixel for the bitmap; always 1. More...
 
uint8_t * data ()
 Returns a pointer to the start of the bitmap's data buffer. More...
 
+const uint8_t * data () const
 Returns a constant pointer to the start of the bitmap's data buffer. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void clear (Color color=Black)
 Clears the entire bitmap to the specified color. More...
 
Color pixel (int x, int y) const
 Returns the color of the pixel at (x, y); either Black or White. More...
 
void setPixel (int x, int y, Color color)
 Sets the pixel at (x, y) to color. More...
 
void drawLine (int x1, int y1, int x2, int y2, Color color=White)
 Draws a line from (x1, y1) to (x2, y2) in color. More...
 
void drawRect (int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
 Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor. More...
 
void drawFilledRect (int x1, int y1, int x2, int y2, Color color=White)
 Draws a filled rectangle from (x1, y1) to (x2, y2) in color. More...
 
void drawCircle (int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
 Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor. More...
 
void drawFilledCircle (int centerX, int centerY, int radius, Color color=White)
 Draws a filled circle with a specific center (centerX, centerY) and radius in color. More...
 
void drawBitmap (int x, int y, const Bitmap &bitmap, Color color=White)
 Draws bitmap at (x, y) in color. More...
 
void drawBitmap (int x, int y, Bitmap::ProgMem bitmap, Color color=White)
 Draws bitmap at (x, y) in color. More...
 
void drawInvertedBitmap (int x, int y, const Bitmap &bitmap)
 Draws bitmap at (x, y) in inverted colors. More...
 
void drawInvertedBitmap (int x, int y, Bitmap::ProgMem bitmap)
 Draws bitmap at (x, y) in inverted colors. More...
 
Font font () const
 Returns the currently selected font, or null if none selected. More...
 
void setFont (Font font)
 Sets the font for use with drawText() and drawChar(). More...
 
Color textColor () const
 Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White. More...
 
void setTextColor (Color color)
 Sets the color that will be used for drawing text with drawText() and drawChar(). More...
 
void drawText (int x, int y, const char *str, int len=-1)
 Draws the len characters of str at (x, y). More...
 
void drawText (int x, int y, const String &str, int start=0, int len=-1)
 Draws len characters starting at start from str to the screen at (x, y). More...
 
int drawChar (int x, int y, char ch)
 Draws a single character ch at (x, y). More...
 
int charWidth (char ch) const
 Returns the width in pixels of ch in the current font(). More...
 
int textWidth (const char *str, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing. More...
 
int textWidth (const String &str, int start=0, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing. More...
 
int textHeight () const
 Returns the height in pixels of the current text drawing font(); or zero if font() is not set. More...
 
void copy (int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
 Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest. More...
 
void fill (int x, int y, int width, int height, Color color)
 Fills the width x height pixels starting at top-left corner (x, y) with color. More...
 
void fill (int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)
 Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern. More...
 
void scroll (int dx, int dy, Color fillColor=Black)
 Scrolls the entire contents of the bitmap by dx and dy. More...
 
void scroll (int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)
 Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy. More...
 
void invert (int x, int y, int width, int height)
 Inverts the width x height pixels starting at top-left corner (x, y). More...
 
+ + + + + + + + + + +

+Static Public Attributes

+static const Color Black = 0
 Color value corresponding to "black".
 
static const Color White = 1
 Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color. More...
 
+static const Color NoFill = 2
 Special color value that is used with drawRect() and drawCircle() to indicate that the interior of the shape should not be filled. For all other uses, NoFill is equivalent to White.
 
+ + + +

+Friends

+class DMD
 
+

Detailed Description

+

Represents a monochrome bitmap within main memory.

+

Bitmaps are a rectangular arrangement of width() x height() pixels, with each pixel set to either Black or White. The co-ordinate system has origin (0, 0) at the top-left of the bitmap.

+

Functions within this class can be used to draw various shapes into the bitmap's data() buffer; e.g. drawLine(), drawRect(), drawBitmap(), drawText(), clear(), fill(), etc.

+
See Also
DMD
+ +

Definition at line 32 of file Bitmap.h.

+

Member Typedef Documentation

+ +
+
+ + + + +
Bitmap::Color
+
+ +

Type that represents the color of a pixel in a bitmap.

+
See Also
Black, White
+ +

Definition at line 40 of file Bitmap.h.

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
Bitmap::Bitmap (int width,
int height 
)
+
+ +

Constructs a new in-memory bitmap that is width x height pixels in size.

+
See Also
width(), height(), isValid()
+ +

Definition at line 88 of file Bitmap.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
int Bitmap::bitsPerPixel () const
+
+inline
+
+ +

Returns the number of bits per pixel for the bitmap; always 1.

+
See Also
width(), height()
+ +

Definition at line 51 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + +
int Bitmap::charWidth (char ch) const
+
+ +

Returns the width in pixels of ch in the current font().

+

Returns zero if font() is not set, or ch is not present in font().

+
See Also
drawChar(), font(), textWidth(), textHeight()
+ +

Definition at line 650 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void Bitmap::clear (Color color = Black)
+
+ +

Clears the entire bitmap to the specified color.

+
See Also
fill()
+ +

Definition at line 174 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::copy (int x,
int y,
int width,
int height,
Bitmapdest,
int destX,
int destY 
)
+
+ +

Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest.

+

The dest bitmap can be the same as this object, in which case the copy will be performed in a manner that correctly handles overlapping regions.

+

If some part of the source region is outside the bounds of this object, then the value Black will be copied to dest for those pixels. This can be used to produce a behaviour similar to scroll() when bitmap is the same as this object.

+
See Also
drawBitmap(), fill(), scroll()
+ +

Definition at line 738 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
uint8_t * Bitmap::data ()
+
+inline
+
+ +

Returns a pointer to the start of the bitmap's data buffer.

+

The data is organized as height() lines of stride() bytes, laid out horizontally across the extent of width() pixels. The most significant bit in each byte has the lowest x value.

+

Note: bits within the data are 1 for Black and 0 for White, which is the reverse of the constant values. This differs from pixel() which returns the correct constant.

+
See Also
pixel(), stride()
+ +

Definition at line 53 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawBitmap (int x,
int y,
const Bitmapbitmap,
Color color = White 
)
+
+ +

Draws bitmap at (x, y) in color.

+

Bits that are set to White in the bitmap are drawn with color. Bits that are set to Black in the bitmap are drawn with the inverse of color. The pixel at (x, y) will be the top-left corner of the drawn image.

+

Note: bitmap must not be the same as this object or the behaviour will be undefined. To copy a region of a bitmap to elsewhere within the same bitmap, use copy() instead.

+
See Also
drawInvertedBitmap(), copy()
+ +

Definition at line 388 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawBitmap (int x,
int y,
Bitmap::ProgMem bitmap,
Color color = White 
)
+
+ +

Draws bitmap at (x, y) in color.

+

The bitmap must point to program memory. The first two bytes are the width and height of the bitmap in pixels. The rest of the data contains the pixels for the bitmap, with lines byte-aligned.

+

Bits that are 1 in the bitmap are drawn with color. Bits that are 0 in the bitmap are drawn with the inverse of color. The pixel at (x, y) will be the top-left corner of the drawn image.

+
See Also
drawInvertedBitmap(), fill()
+ +

Definition at line 425 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int Bitmap::drawChar (int x,
int y,
char ch 
)
+
+ +

Draws a single character ch at (x, y).

+

Returns the width of the character in pixels so that higher-order functions like drawText() can advance x to the location of the next character to be drawn. The width does not include inter-character spacing.

+

The position (x, y) will be the upper-left pixel of the drawn character.

+
See Also
drawText(), textColor(), font(), charWidth()
+ +

Definition at line 585 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawCircle (int centerX,
int centerY,
int radius,
Color borderColor = White,
Color fillColor = NoFill 
)
+
+ +

Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor.

+

If fillColor is NoFill, then the interior is not filled.

+
See Also
drawFilledCircle(), drawLine(), drawRect()
+ +

Definition at line 334 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawFilledCircle (int centerX,
int centerY,
int radius,
Color color = White 
)
+
+inline
+
+ +

Draws a filled circle with a specific center (centerX, centerY) and radius in color.

+

This is a convenience function that is equivalent to drawCircle(centerX, centerY, radius, color, color).

+
See Also
drawCircle(), drawFilledRect()
+ +

Definition at line 120 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawFilledRect (int x1,
int y1,
int x2,
int y2,
Color color = White 
)
+
+inline
+
+ +

Draws a filled rectangle from (x1, y1) to (x2, y2) in color.

+

This is a convenience function that is equivalent to drawRect(x1, y1, x2, y2, color, color).

+
See Also
drawRect(), drawFilledCircle()
+ +

Definition at line 115 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawInvertedBitmap (int x,
int y,
const Bitmapbitmap 
)
+
+inline
+
+ +

Draws bitmap at (x, y) in inverted colors.

+

This is a convenience function that is equivalent to drawBitmap(x, y, bitmap, Black).

+
See Also
drawBitmap()
+ +

Definition at line 125 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawInvertedBitmap (int x,
int y,
Bitmap::ProgMem bitmap 
)
+
+inline
+
+ +

Draws bitmap at (x, y) in inverted colors.

+

This is a convenience function that is equivalent to drawBitmap(x, y, bitmap, Black).

+
See Also
drawBitmap()
+ +

Definition at line 130 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawLine (int x1,
int y1,
int x2,
int y2,
Color color = White 
)
+
+ +

Draws a line from (x1, y1) to (x2, y2) in color.

+
See Also
drawRect(), drawCircle()
+ +

Definition at line 225 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawRect (int x1,
int y1,
int x2,
int y2,
Color borderColor = White,
Color fillColor = NoFill 
)
+
+ +

Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor.

+

If fillColor is NoFill, then the interior is not filled.

+
See Also
drawFilledRect(), drawLine(), drawCircle(), fill()
+ +

Definition at line 286 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawText (int x,
int y,
const char * str,
int len = -1 
)
+
+ +

Draws the len characters of str at (x, y).

+

If len is less than zero, then the actual length of str will be used.

+

The position (x, y) will be the upper-left pixel of the first character that is drawn.

+
See Also
drawChar(), textColor(), font()
+ +

Definition at line 526 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::drawText (int x,
int y,
const String & str,
int start = 0,
int len = -1 
)
+
+ +

Draws len characters starting at start from str to the screen at (x, y).

+

If len is less than zero, then the actual length of str will be used.

+

The position (x, y) will be the upper-left pixel of the first character that is drawn.

+
See Also
drawChar(), textColor(), font()
+ +

Definition at line 555 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::fill (int x,
int y,
int width,
int height,
Color color 
)
+
+ +

Fills the width x height pixels starting at top-left corner (x, y) with color.

+
See Also
copy(), clear(), invert(), drawRect()
+ +

Definition at line 762 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::fill (int x,
int y,
int width,
int height,
Bitmap::ProgMem pattern,
Color color = White 
)
+
+ +

Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern.

+

The pattern must point to program memory. The first two bytes are the width and height of the pattern in pixels. The rest of the data contains the pixels for the pattern, with lines byte-aligned.

+

Bits that are 1 in the pattern are drawn with color. Bits that are 0 in the pattern are drawn with the inverse of color.

+
See Also
drawBitmap(), clear(), invert()
+ +

Definition at line 785 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
Font Bitmap::font () const
+
+inline
+
+ +

Returns the currently selected font, or null if none selected.

+
See Also
setFont(), drawText(), drawChar(), charWidth()
+ +

Definition at line 72 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int Bitmap::height () const
+
+inline
+
+ +

Returns the height of the bitmap in pixels.

+
See Also
width(), bitsPerPixel()
+ +

Definition at line 49 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::invert (int x,
int y,
int width,
int height 
)
+
+ +

Inverts the width x height pixels starting at top-left corner (x, y).

+
See Also
fill()
+ +

Definition at line 902 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool Bitmap::isValid () const
+
+inline
+
+ +

Returns true if the memory for this bitmap is valid; false otherwise.

+

This function can be called just after the constructor to determine if the memory for the bitmap was allocated successfully.

+ +

Definition at line 38 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
Bitmap::Color Bitmap::pixel (int x,
int y 
) const
+
+ +

Returns the color of the pixel at (x, y); either Black or White.

+

Returns Black if x or y is out of range.

+
See Also
setPixel(), data()
+ +

Definition at line 191 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::scroll (int dx,
int dy,
Color fillColor = Black 
)
+
+inline
+
+ +

Scrolls the entire contents of the bitmap by dx and dy.

+

If dx is 2 and dy is -1, then the region will be scrolled two pixels to the right and one pixel up. Pixels that are uncovered by the scroll are filled with fillColor.

+
See Also
copy(), fill()
+ +

Definition at line 135 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::scroll (int x,
int y,
int width,
int height,
int dx,
int dy,
Color fillColor = Black 
)
+
+ +

Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy.

+

If dx is 2 and dy is -1, then the region will be scrolled two pixels to the right and one pixel up. Pixels that are uncovered by the scroll are filled with fillColor.

+
See Also
copy(), fill()
+ +

Definition at line 841 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void Bitmap::setFont (Font font)
+
+inline
+
+ +

Sets the font for use with drawText() and drawChar().

+
#include <DejaVuSans9.h>
+
+
display.setFont(DejaVuSans9);
+
display.drawText(0, 0, "Hello");
+

New fonts can be generated with GLCDFontCreator2.

+
See Also
font(), drawText(), drawChar()
+ +

Definition at line 73 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Bitmap::setPixel (int x,
int y,
Color color 
)
+
+ +

Sets the pixel at (x, y) to color.

+
See Also
pixel()
+ +

Definition at line 208 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void Bitmap::setTextColor (Color textColor)
+
+inline
+
+ +

Sets the color that will be used for drawing text with drawText() and drawChar().

+
See Also
textColor(), drawText(), drawChar()
+ +

Definition at line 76 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int Bitmap::stride () const
+
+inline
+
+ +

Returns the number of bytes in each line of the bitmap's data() buffer.

+
See Also
width(), bitsPerPixel(), data()
+ +

Definition at line 50 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
Color Bitmap::textColor () const
+
+inline
+
+ +

Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.

+
See Also
setTextColor(), drawText(), drawChar()
+ +

Definition at line 75 of file Bitmap.h.

+ +
+
+ +
+
+ + + + + + + +
int Bitmap::textHeight () const
+
+ +

Returns the height in pixels of the current text drawing font(); or zero if font() is not set.

+
See Also
font(), charWidth(), textWidth()
+ +

Definition at line 716 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int Bitmap::textWidth (const char * str,
int len = -1 
) const
+
+ +

Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.

+

If len is less than zero, then the actual length of str will be used.

+
See Also
drawText(), charWidth(), textHeight()
+ +

Definition at line 675 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int Bitmap::textWidth (const String & str,
int start = 0,
int len = -1 
) const
+
+ +

Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.

+

If len is less than zero, then the actual length of str will be used.

+
See Also
drawText(), charWidth(), textHeight()
+ +

Definition at line 697 of file Bitmap.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int Bitmap::width () const
+
+inline
+
+ +

Returns the width of the bitmap in pixels.

+
See Also
height(), stride(), bitsPerPixel()
+ +

Definition at line 48 of file Bitmap.h.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + + +
+ + + + +
Bitmap::White = 1
+
+static
+
+ +

Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color.

+

Note: while the value of this constant is 1, the bitmap itself stores white pixels as 0 and black as 1 because the DMD display uses 1 to indicate a pixel being off.

+ +

Definition at line 45 of file Bitmap.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBitmap.png b/html/classBitmap.png new file mode 100644 index 00000000..73ac3b30 Binary files /dev/null and b/html/classBitmap.png differ diff --git a/html/classBlinkLED-members.html b/html/classBlinkLED-members.html new file mode 100644 index 00000000..5ff2078b --- /dev/null +++ b/html/classBlinkLED-members.html @@ -0,0 +1,111 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
BlinkLED Member List
+
+
+ +

This is the complete list of members for BlinkLED, including all inherited members.

+ + + + + + + + + + + +
BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)BlinkLED
isPaused() const BlinkLEDinline
loop()BlinkLED
offTime() const BlinkLEDinline
onTime() const BlinkLEDinline
pause()BlinkLEDinline
resume()BlinkLED
setBlinkRate(unsigned long onTime, unsigned long offTime)BlinkLED
setState(bool state)BlinkLED
state() const BlinkLEDinline
+ + + + diff --git a/html/classBlinkLED.html b/html/classBlinkLED.html new file mode 100644 index 00000000..53e8adbd --- /dev/null +++ b/html/classBlinkLED.html @@ -0,0 +1,436 @@ + + + + + + +ArduinoLibs: BlinkLED Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
BlinkLED Class Reference
+
+
+ +

Blink a LED on a digital output pin. + More...

+ +

#include <BlinkLED.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 BlinkLED (uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)
 Initialize a blinking LED on the specified pin. More...
 
void loop ()
 
unsigned long onTime () const
 Returns the number of milliseconds the LED will be on. More...
 
unsigned long offTime () const
 Returns the number of milliseconds the LED will be off. More...
 
void setBlinkRate (unsigned long onTime, unsigned long offTime)
 Sets the onTime and offTime (in milliseconds). More...
 
bool state () const
 Returns the current state of the LED; true is on, false is off. More...
 
void setState (bool state)
 Sets the current state of the LED, where true is on, false is off. More...
 
void pause ()
 Pauses the LED blink cycle in its current state(). More...
 
void resume ()
 Resumes the LED blink cycle after a pause(). More...
 
bool isPaused () const
 Returns true if the LED blink cycle is paused; false otherwise. More...
 
+

Detailed Description

+

Blink a LED on a digital output pin.

+

BlinkLED simplies the process of blinking a LED by encapsulating the control logic into a single class. The following example strobes the status LED on D13 with a period of 70 milliseconds on, 930 milliseconds off (the LED is initially off):

+
#include <BlinkLED.h>
+
+
BlinkLED statusBlink(13, 70, 930);
+
+
void setup() {}
+
+
void loop() {
+
statusBlink.loop();
+
}
+

The current state() of the LED can be changed immediately by calling setState(). The blink rate can be modified with setBlinkRate(). And the blink cycle can be suspended and restarted with pause() and resume().

+ +

Definition at line 28 of file BlinkLED.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BlinkLED::BlinkLED (uint8_t pin,
unsigned long onTime,
unsigned long offTime,
bool initialState = false 
)
+
+ +

Initialize a blinking LED on the specified pin.

+

The LED will blink with a rate defined by onTime and offTime (in milliseconds). Initially the LED's state is given by initialState, where true means initially on and false means initially off.

+ +

Definition at line 64 of file BlinkLED.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool BlinkLED::isPaused () const
+
+inline
+
+ +

Returns true if the LED blink cycle is paused; false otherwise.

+
See Also
pause(), resume()
+ +

Definition at line 44 of file BlinkLED.h.

+ +
+
+ +
+
+ + + + + + + +
void BlinkLED::loop ()
+
+

Perform a single iteration of the blink loop for this LED.

+ +

Definition at line 79 of file BlinkLED.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long BlinkLED::offTime () const
+
+inline
+
+ +

Returns the number of milliseconds the LED will be off.

+
See Also
onTime(), setBlinkRate()
+ +

Definition at line 36 of file BlinkLED.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long BlinkLED::onTime () const
+
+inline
+
+ +

Returns the number of milliseconds the LED will be on.

+
See Also
offTime(), setBlinkRate()
+ +

Definition at line 35 of file BlinkLED.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BlinkLED::pause ()
+
+inline
+
+ +

Pauses the LED blink cycle in its current state().

+
See Also
resume(), isPaused()
+ +

Definition at line 42 of file BlinkLED.h.

+ +
+
+ +
+
+ + + + + + + +
void BlinkLED::resume ()
+
+ +

Resumes the LED blink cycle after a pause().

+

The LED will complete its current onTime() or offTime() and then will switch to the opposite state(). If onTime() or offTime() has already expired, then the LED will immediately switch state.

+
See Also
pause(), isPaused()
+ +

Definition at line 170 of file BlinkLED.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void BlinkLED::setBlinkRate (unsigned long onTime,
unsigned long offTime 
)
+
+ +

Sets the onTime and offTime (in milliseconds).

+

The change takes effect immediately. If the current onTime() or offTime() has now expired, then the LED will immediately switch to the opposite state().

+
See Also
onTime(), offTime()
+ +

Definition at line 122 of file BlinkLED.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void BlinkLED::setState (bool state)
+
+ +

Sets the current state of the LED, where true is on, false is off.

+

If the LED is already set to state, then it will complete its current cycle of onTime() or offTime(). Otherwise the LED is immediately set to state and a new cycle begins.

+
See Also
state()
+ +

Definition at line 145 of file BlinkLED.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool BlinkLED::state () const
+
+inline
+
+ +

Returns the current state of the LED; true is on, false is off.

+
See Also
setState()
+ +

Definition at line 39 of file BlinkLED.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBlockCipher-members.html b/html/classBlockCipher-members.html new file mode 100644 index 00000000..6e6d95c2 --- /dev/null +++ b/html/classBlockCipher-members.html @@ -0,0 +1,109 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
BlockCipher Member List
+
+
+ +

This is the complete list of members for BlockCipher, including all inherited members.

+ + + + + + + + + +
BlockCipher()BlockCipher
blockSize() const =0BlockCipherpure virtual
clear()=0BlockCipherpure virtual
decryptBlock(uint8_t *output, const uint8_t *input)=0BlockCipherpure virtual
encryptBlock(uint8_t *output, const uint8_t *input)=0BlockCipherpure virtual
keySize() const =0BlockCipherpure virtual
setKey(const uint8_t *key, size_t len)=0BlockCipherpure virtual
~BlockCipher()BlockCiphervirtual
+ + + + diff --git a/html/classBlockCipher.html b/html/classBlockCipher.html new file mode 100644 index 00000000..ae86fe50 --- /dev/null +++ b/html/classBlockCipher.html @@ -0,0 +1,415 @@ + + + + + + +ArduinoLibs: BlockCipher Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
BlockCipher Class Referenceabstract
+
+
+ +

Abstract base class for block ciphers. + More...

+ +

#include <BlockCipher.h>

+
+Inheritance diagram for BlockCipher:
+
+
+ + +AESCommon +AES128 +AES192 +AES256 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

BlockCipher ()
 Constructs a block cipher.
 
virtual ~BlockCipher ()
 Destroys this block cipher object. More...
 
virtual size_t blockSize () const =0
 Size of a single block processed by this cipher, in bytes. More...
 
virtual size_t keySize () const =0
 Default size of the key for this block cipher, in bytes. More...
 
virtual bool setKey (const uint8_t *key, size_t len)=0
 Sets the key to use for future encryption and decryption operations. More...
 
virtual void encryptBlock (uint8_t *output, const uint8_t *input)=0
 Encrypts a single block using this cipher. More...
 
virtual void decryptBlock (uint8_t *output, const uint8_t *input)=0
 Decrypts a single block using this cipher. More...
 
virtual void clear ()=0
 Clears all security-sensitive state from this block cipher. More...
 
+

Detailed Description

+

Abstract base class for block ciphers.

+

Block ciphers always operate in electronic codebook (ECB) mode. Higher-level classes such as CFB128 and CTR128 wrap the block cipher to create more useful classes for encryption and decryption of bulk data.

+

References: http://en.wikipedia.org/wiki/Block_cipher, http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29

+ +

Definition at line 29 of file BlockCipher.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
BlockCipher::~BlockCipher ()
+
+virtual
+
+ +

Destroys this block cipher object.

+

Subclasses are responsible for clearing temporary key schedules and other buffers so as to avoid leaking sensitive information.

+
See Also
clear()
+ +

Definition at line 52 of file BlockCipher.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t BlockCipher::blockSize () const
+
+pure virtual
+
+ +

Size of a single block processed by this cipher, in bytes.

+
Returns
Returns the size of a block in bytes.
+
See Also
keySize(), encryptBlock()
+ +

Implemented in AESCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void BlockCipher::clear ()
+
+pure virtual
+
+ +

Clears all security-sensitive state from this block cipher.

+

Security-sensitive information includes key schedules and any temporary state that is used by encryptBlock() or decryptBlock() which is stored in the object itself.

+
See Also
setKey(), encryptBlock(), decryptBlock()
+ +

Implemented in AESCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BlockCipher::decryptBlock (uint8_t * output,
const uint8_t * input 
)
+
+pure virtual
+
+ +

Decrypts a single block using this cipher.

+
Parameters
+ + + +
outputThe output buffer to put the plaintext into. Must be at least blockSize() bytes in length.
inputThe input buffer to read the ciphertext from which is allowed to overlap with output. Must be at least blockSize() bytes in length.
+
+
+
See Also
encryptBlock(), blockSize()
+ +

Implemented in AESCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void BlockCipher::encryptBlock (uint8_t * output,
const uint8_t * input 
)
+
+pure virtual
+
+ +

Encrypts a single block using this cipher.

+
Parameters
+ + + +
outputThe output buffer to put the ciphertext into. Must be at least blockSize() bytes in length.
inputThe input buffer to read the plaintext from which is allowed to overlap with output. Must be at least blockSize() bytes in length.
+
+
+
See Also
decryptBlock(), blockSize()
+ +

Implemented in AESCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t BlockCipher::keySize () const
+
+pure virtual
+
+ +

Default size of the key for this block cipher, in bytes.

+

This value indicates the default, or recommended, size for the key.

+
See Also
setKey(), blockSize()
+ +

Implemented in AES256, AES192, and AES128.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool BlockCipher::setKey (const uint8_t * key,
size_t len 
)
+
+pure virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+
See Also
keySize(), clear()
+ +

Implemented in AES256, AES192, and AES128.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBlockCipher.png b/html/classBlockCipher.png new file mode 100644 index 00000000..ca1eceba Binary files /dev/null and b/html/classBlockCipher.png differ diff --git a/html/classBoolField-members.html b/html/classBoolField-members.html new file mode 100644 index 00000000..f91603c4 --- /dev/null +++ b/html/classBoolField-members.html @@ -0,0 +1,121 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
BoolField Member List
+
+
+ +

This is the complete list of members for BoolField, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
BoolField(const String &label)BoolFieldexplicit
BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)BoolField
dispatch(int event)BoolFieldvirtual
enterField(bool reverse)BoolFieldvirtual
exitField()Fieldvirtual
falseLabel() const BoolFieldinline
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
isCurrent() const Field
label() const Fieldinline
lcd() const Fieldinlineprotected
setFalseLabel(const String &falseLabel)BoolField
setLabel(const String &label)Field
setTrueLabel(const String &trueLabel)BoolField
setValue(bool value)BoolField
trueLabel() const BoolFieldinline
updateCursor()Fieldprotectedvirtual
value() const BoolFieldinline
~Field()Field
+ + + + diff --git a/html/classBoolField.html b/html/classBoolField.html new file mode 100644 index 00000000..85f6e781 --- /dev/null +++ b/html/classBoolField.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: BoolField Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
BoolField Class Reference
+
+
+ +

Field that manages the input of a boolean value. + More...

+ +

#include <BoolField.h>

+
+Inheritance diagram for BoolField:
+
+
+ + +Field + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 BoolField (const String &label)
 Constructs a new boolean field with a specific label. More...
 
 BoolField (Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
 Constructs a new boolean field with a specific label and attaches it to a form. More...
 
int dispatch (int event)
 Dispatches event via this field. More...
 
void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
bool value () const
 Returns the current value of this field, true or false. More...
 
void setValue (bool value)
 Sets the current value of this field to value. More...
 
const String & trueLabel () const
 Returns the string that is displayed when value() is true. More...
 
void setTrueLabel (const String &trueLabel)
 Sets the string that is displayed when value() is true to trueLabel. More...
 
const String & falseLabel () const
 Returns the string that is displayed when value() is false. More...
 
void setFalseLabel (const String &falseLabel)
 Sets the string that is displayed when value() is false to falseLabel. More...
 
- Public Member Functions inherited from Field
 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
virtual void exitField ()
 Exits the field due to form navigation. More...
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Field
+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+

Detailed Description

+

Field that manages the input of a boolean value.

+

BoolField is intended for field values that are modifiable by the user. Pressing one of Up or Down will toggle the field's current value.

+

The following example creates a boolean field that shows the state of the status LED on D13. When the LED is on (the default), the string "On" will be displayed on the LCD screen. When the LED is off, the string "Off" will be displayed instead.

+
Form mainForm(lcd);
+
BoolField ledField(mainForm, "Status LED", "On", "Off", true);
+
+FormBool.png +
+

To actually toggle the LED, the application's main loop() function should contain the following code:

+
int event = lcd.getButton();
+
if (mainForm.dispatch(event) == FORM_CHANGED) {
+
if (mainForm.isCurrent(ledField)) {
+
if (ledField.value())
+
digitalWrite(STATUS_LED, HIGH);
+
else
+
digitalWrite(STATUS_LED, LOW);
+
}
+
}
+

Use TextField for read-only fields that report boolean values but which are not modifiable by the user.

+

ListField can be used to select between more than two items.

+
See Also
Field, ListField, TextField
+ +

Definition at line 28 of file BoolField.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
BoolField::BoolField (const String & label)
+
+explicit
+
+ +

Constructs a new boolean field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+

The initial value() will be false.

+
See Also
Form::addField()
+ +

Definition at line 77 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BoolField::BoolField (Formform,
const String & label,
const String & trueLabel,
const String & falseLabel,
bool value 
)
+
+ +

Constructs a new boolean field with a specific label and attaches it to a form.

+

The initial value() of the field is set to the parameter value. When value() is true, trueLabel will be displayed on the screen. When value() is false, falseLabel will be displayed on the screen.

+
See Also
value()
+ +

Definition at line 94 of file BoolField.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
int BoolField::dispatch (int event)
+
+virtual
+
+ +

Dispatches event via this field.

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

+

Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

+
See Also
Form::dispatch(), LCD::getButton()
+ +

Reimplemented from Field.

+ +

Definition at line 103 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void BoolField::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented from Field.

+ +

Definition at line 113 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
const String & BoolField::falseLabel () const
+
+inline
+
+ +

Returns the string that is displayed when value() is false.

+
See Also
setFalseLabel(), trueLabel()
+ +

Definition at line 43 of file BoolField.h.

+ +
+
+ +
+
+ + + + + + + + +
void BoolField::setFalseLabel (const String & falseLabel)
+
+ +

Sets the string that is displayed when value() is false to falseLabel.

+
See Also
falseLabel(), setTrueLabel()
+ +

Definition at line 173 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void BoolField::setTrueLabel (const String & trueLabel)
+
+ +

Sets the string that is displayed when value() is true to trueLabel.

+
See Also
trueLabel(), setFalseLabel()
+ +

Definition at line 153 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void BoolField::setValue (bool value)
+
+ +

Sets the current value of this field to value.

+
See Also
value()
+ +

Definition at line 131 of file BoolField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
const String & BoolField::trueLabel () const
+
+inline
+
+ +

Returns the string that is displayed when value() is true.

+
See Also
setTrueLabel(), falseLabel()
+ +

Definition at line 40 of file BoolField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool BoolField::value () const
+
+inline
+
+ +

Returns the current value of this field, true or false.

+
See Also
setValue()
+ +

Definition at line 37 of file BoolField.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classBoolField.png b/html/classBoolField.png new file mode 100644 index 00000000..4f5281de Binary files /dev/null and b/html/classBoolField.png differ diff --git a/html/classCBC-members.html b/html/classCBC-members.html new file mode 100644 index 00000000..77d1a70f --- /dev/null +++ b/html/classCBC-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CBC< T > Member List
+
+
+ +

This is the complete list of members for CBC< T >, including all inherited members.

+ + + + + + + + + + + + + + +
CBC()CBC< T >inline
CBCCommon()CBCCommonprotected
Cipher()Cipher
clear()CBCCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)CBCCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CBCCommonvirtual
ivSize() const CBCCommonvirtual
keySize() const CBCCommonvirtual
setBlockCipher(BlockCipher *cipher)CBCCommoninlineprotected
setIV(const uint8_t *iv, size_t len)CBCCommonvirtual
setKey(const uint8_t *key, size_t len)CBCCommonvirtual
~CBCCommon()CBCCommonvirtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classCBC.html b/html/classCBC.html new file mode 100644 index 00000000..a4ab5aef --- /dev/null +++ b/html/classCBC.html @@ -0,0 +1,193 @@ + + + + + + +ArduinoLibs: CBC< T > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
CBC< T > Class Template Reference
+
+
+ +

Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers. + More...

+ +

#include <CBC.h>

+
+Inheritance diagram for CBC< T >:
+
+
+ + +CBCCommon +Cipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CBC ()
 Constructs a new CBC object for the block cipher T.
 
- Public Member Functions inherited from CBCCommon
+virtual ~CBCCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from CBCCommon
 CBCCommon ()
 Constructs a new cipher in CBC mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CBC object. More...
 
+

Detailed Description

+

template<typename T>
+class CBC< T >

+ +

Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers.

+

The template parameter T must be a concrete subclass of BlockCipher indicating the specific block cipher to use. T must have a block size of 16 bytes (128 bits).

+

For example, the following creates a CBC object using AES192 as the underlying cipher:

+
+
cbc.setKey(key, 24);
+
cbc.setIV(iv, 16);
+
cbc.encrypt(output, input, len);
+

Decryption is similar:

+
+
cbc.setKey(key, 24);
+
cbc.setIV(iv, 16);
+
cbc.decrypt(output, input, len);
+

The size of the ciphertext will always be the same as the size of the plaintext. Also, the length of the plaintext/ciphertext must be a multiple of 16. Extra bytes are ignored and not encrypted. The caller is responsible for padding the underlying data to a multiple of 16 using an appropriate padding scheme for the application.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CTR, CFB, OFB
+ +

Definition at line 57 of file CBC.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCBC.png b/html/classCBC.png new file mode 100644 index 00000000..3d582b6d Binary files /dev/null and b/html/classCBC.png differ diff --git a/html/classCBCCommon-members.html b/html/classCBCCommon-members.html new file mode 100644 index 00000000..45410fdf --- /dev/null +++ b/html/classCBCCommon-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CBCCommon Member List
+
+
+ +

This is the complete list of members for CBCCommon, including all inherited members.

+ + + + + + + + + + + + + +
CBCCommon()CBCCommonprotected
Cipher()Cipher
clear()CBCCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)CBCCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CBCCommonvirtual
ivSize() const CBCCommonvirtual
keySize() const CBCCommonvirtual
setBlockCipher(BlockCipher *cipher)CBCCommoninlineprotected
setIV(const uint8_t *iv, size_t len)CBCCommonvirtual
setKey(const uint8_t *key, size_t len)CBCCommonvirtual
~CBCCommon()CBCCommonvirtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classCBCCommon.html b/html/classCBCCommon.html new file mode 100644 index 00000000..591ecffb --- /dev/null +++ b/html/classCBCCommon.html @@ -0,0 +1,542 @@ + + + + + + +ArduinoLibs: CBCCommon Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
CBCCommon Class Reference
+
+
+ +

Concrete base class to assist with implementing CBC for 128-bit block ciphers. + More...

+ +

#include <CBC.h>

+
+Inheritance diagram for CBCCommon:
+
+
+ + +Cipher +CBC< T > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual ~CBCCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + +

+Protected Member Functions

 CBCCommon ()
 Constructs a new cipher in CBC mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CBC object. More...
 
+

Detailed Description

+

Concrete base class to assist with implementing CBC for 128-bit block ciphers.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CBC
+ +

Definition at line 29 of file CBC.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
CBCCommon::CBCCommon ()
+
+protected
+
+ +

Constructs a new cipher in CBC mode.

+

This constructor should be followed by a call to setBlockCipher().

+ +

Definition at line 42 of file CBC.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void CBCCommon::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implements Cipher.

+ +

Definition at line 113 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CBCCommon::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implements Cipher.

+ +

Definition at line 99 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CBCCommon::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implements Cipher.

+ +

Definition at line 86 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CBCCommon::ivSize () const
+
+virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implements Cipher.

+ +

Definition at line 62 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CBCCommon::keySize () const
+
+virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implements Cipher.

+ +

Definition at line 57 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CBCCommon::setBlockCipher (BlockCiphercipher)
+
+inlineprotected
+
+ +

Sets the block cipher to use for this CBC object.

+
Parameters
+ + +
cipherThe block cipher to use to implement CBC mode, which must have a block size of 16 bytes (128 bits).
+
+
+ +

Definition at line 47 of file CBC.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CBCCommon::setIV (const uint8_t * iv,
size_t len 
)
+
+virtual
+
+ +

Sets the initialization vector to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initialization vector to use.
lenThe length of the initialization vector in bytes.
+
+
+
Returns
Returns false if the length is not supported.
+

Initialization vectors should be set before the first call to encrypt() or decrypt() after a setKey() call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.

+
Note
The IV is not encoded into the output stream by encrypt(). The caller is responsible for communicating the IV to the other party.
+
See Also
ivSize()
+ +

Implements Cipher.

+ +

Definition at line 77 of file CBC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CBCCommon::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implements Cipher.

+ +

Definition at line 67 of file CBC.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCBCCommon.png b/html/classCBCCommon.png new file mode 100644 index 00000000..fe4e7c65 Binary files /dev/null and b/html/classCBCCommon.png differ diff --git a/html/classCFB-members.html b/html/classCFB-members.html new file mode 100644 index 00000000..15c7c77c --- /dev/null +++ b/html/classCFB-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CFB< T > Member List
+
+
+ +

This is the complete list of members for CFB< T >, including all inherited members.

+ + + + + + + + + + + + + + +
CFB()CFB< T >inline
CFBCommon()CFBCommonprotected
Cipher()Cipher
clear()CFBCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)CFBCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CFBCommonvirtual
ivSize() const CFBCommonvirtual
keySize() const CFBCommonvirtual
setBlockCipher(BlockCipher *cipher)CFBCommoninlineprotected
setIV(const uint8_t *iv, size_t len)CFBCommonvirtual
setKey(const uint8_t *key, size_t len)CFBCommonvirtual
~CFBCommon()CFBCommonvirtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classCFB.html b/html/classCFB.html new file mode 100644 index 00000000..42e6c942 --- /dev/null +++ b/html/classCFB.html @@ -0,0 +1,193 @@ + + + + + + +ArduinoLibs: CFB< T > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
CFB< T > Class Template Reference
+
+
+ +

Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers. + More...

+ +

#include <CFB.h>

+
+Inheritance diagram for CFB< T >:
+
+
+ + +CFBCommon +Cipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CFB ()
 Constructs a new CFB object for the block cipher T.
 
- Public Member Functions inherited from CFBCommon
+virtual ~CFBCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from CFBCommon
 CFBCommon ()
 Constructs a new cipher in CFB mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CFB object. More...
 
+

Detailed Description

+

template<typename T>
+class CFB< T >

+ +

Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers.

+

The template parameter T must be a concrete subclass of BlockCipher indicating the specific block cipher to use. T must have a block size of 16 bytes (128 bits). The size of the CFB shift register is the same as the block size.

+

For example, the following creates a CFB object using AES192 as the underlying cipher:

+
+
cfb.setKey(key, 24);
+
cfb.setIV(iv, 16);
+
cfb.encrypt(output, input, len);
+

Decryption is similar:

+
+
cfb.setKey(key, 24);
+
cfb.setIV(iv, 16);
+
cfb.decrypt(output, input, len);
+

The size of the ciphertext will always be the same as the size of the plaintext.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CTR, OFB, CBC
+ +

Definition at line 56 of file CFB.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCFB.png b/html/classCFB.png new file mode 100644 index 00000000..fa4a4b50 Binary files /dev/null and b/html/classCFB.png differ diff --git a/html/classCFBCommon-members.html b/html/classCFBCommon-members.html new file mode 100644 index 00000000..6ecf5eaf --- /dev/null +++ b/html/classCFBCommon-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CFBCommon Member List
+
+
+ +

This is the complete list of members for CFBCommon, including all inherited members.

+ + + + + + + + + + + + + +
CFBCommon()CFBCommonprotected
Cipher()Cipher
clear()CFBCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)CFBCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CFBCommonvirtual
ivSize() const CFBCommonvirtual
keySize() const CFBCommonvirtual
setBlockCipher(BlockCipher *cipher)CFBCommoninlineprotected
setIV(const uint8_t *iv, size_t len)CFBCommonvirtual
setKey(const uint8_t *key, size_t len)CFBCommonvirtual
~CFBCommon()CFBCommonvirtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classCFBCommon.html b/html/classCFBCommon.html new file mode 100644 index 00000000..8e80da1e --- /dev/null +++ b/html/classCFBCommon.html @@ -0,0 +1,542 @@ + + + + + + +ArduinoLibs: CFBCommon Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
CFBCommon Class Reference
+
+
+ +

Concrete base class to assist with implementing CFB for 128-bit block ciphers. + More...

+ +

#include <CFB.h>

+
+Inheritance diagram for CFBCommon:
+
+
+ + +Cipher +CFB< T > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual ~CFBCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + +

+Protected Member Functions

 CFBCommon ()
 Constructs a new cipher in CFB mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CFB object. More...
 
+

Detailed Description

+

Concrete base class to assist with implementing CFB for 128-bit block ciphers.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CFB
+ +

Definition at line 29 of file CFB.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
CFBCommon::CFBCommon ()
+
+protected
+
+ +

Constructs a new cipher in CFB mode.

+

This constructor should be followed by a call to setBlockCipher().

+ +

Definition at line 42 of file CFB.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void CFBCommon::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implements Cipher.

+ +

Definition at line 140 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CFBCommon::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implements Cipher.

+ +

Definition at line 112 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CFBCommon::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implements Cipher.

+ +

Definition at line 85 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CFBCommon::ivSize () const
+
+virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implements Cipher.

+ +

Definition at line 61 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CFBCommon::keySize () const
+
+virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implements Cipher.

+ +

Definition at line 56 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CFBCommon::setBlockCipher (BlockCiphercipher)
+
+inlineprotected
+
+ +

Sets the block cipher to use for this CFB object.

+
Parameters
+ + +
cipherThe block cipher to use to implement CFB mode, which must have a block size of 16 bytes (128 bits).
+
+
+ +

Definition at line 47 of file CFB.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CFBCommon::setIV (const uint8_t * iv,
size_t len 
)
+
+virtual
+
+ +

Sets the initialization vector to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initialization vector to use.
lenThe length of the initialization vector in bytes.
+
+
+
Returns
Returns false if the length is not supported.
+

Initialization vectors should be set before the first call to encrypt() or decrypt() after a setKey() call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.

+
Note
The IV is not encoded into the output stream by encrypt(). The caller is responsible for communicating the IV to the other party.
+
See Also
ivSize()
+ +

Implements Cipher.

+ +

Definition at line 76 of file CFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CFBCommon::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implements Cipher.

+ +

Definition at line 66 of file CFB.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCFBCommon.png b/html/classCFBCommon.png new file mode 100644 index 00000000..25f7ce1e Binary files /dev/null and b/html/classCFBCommon.png differ diff --git a/html/classCTR-members.html b/html/classCTR-members.html new file mode 100644 index 00000000..e34c4a11 --- /dev/null +++ b/html/classCTR-members.html @@ -0,0 +1,115 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CTR< T > Member List
+
+
+ +

This is the complete list of members for CTR< T >, including all inherited members.

+ + + + + + + + + + + + + + + +
Cipher()Cipher
clear()CTRCommonvirtual
CTR()CTR< T >inline
CTRCommon()CTRCommonprotected
decrypt(uint8_t *output, const uint8_t *input, size_t len)CTRCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CTRCommonvirtual
ivSize() const CTRCommonvirtual
keySize() const CTRCommonvirtual
setBlockCipher(BlockCipher *cipher)CTRCommoninlineprotected
setCounterSize(size_t size)CTRCommon
setIV(const uint8_t *iv, size_t len)CTRCommonvirtual
setKey(const uint8_t *key, size_t len)CTRCommonvirtual
~Cipher()Ciphervirtual
~CTRCommon() (defined in CTRCommon)CTRCommonvirtual
+ + + + diff --git a/html/classCTR.html b/html/classCTR.html new file mode 100644 index 00000000..c2325235 --- /dev/null +++ b/html/classCTR.html @@ -0,0 +1,189 @@ + + + + + + +ArduinoLibs: CTR< T > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
CTR< T > Class Template Reference
+
+
+ +

Implementation of the Counter (CTR) mode for 128-bit block ciphers. + More...

+ +

#include <CTR.h>

+
+Inheritance diagram for CTR< T >:
+
+
+ + +CTRCommon +Cipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

CTR ()
 Constructs a new CTR object for the 128-bit block cipher T.
 
- Public Member Functions inherited from CTRCommon
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setCounterSize (size_t size)
 Sets the counter size for the IV. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initial counter value to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from CTRCommon
 CTRCommon ()
 Constructs a new cipher in CTR mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CTR object. More...
 
+

Detailed Description

+

template<typename T>
+class CTR< T >

+ +

Implementation of the Counter (CTR) mode for 128-bit block ciphers.

+

Counter mode converts a block cipher into a stream cipher. The specific block cipher is passed as the template parameter T and the key is specified via the setKey() function.

+

Keystream blocks are generated by encrypting an increasing counter value and XOR'ing it with each byte of input. The encrypt() and decrypt() operations are identical.

+

The template parameter T must be a concrete subclass of BlockCipher indicating the specific block cipher to use. For example, the following creates a CTR object using AES256 as the underlying cipher:

+
+
ctr.setKey(key, 32);
+
ctr.setIV(iv, 16);
+ +
ctr.encrypt(output, input, len);
+

In this example, the last 4 bytes of the IV are incremented to count blocks. The remaining bytes are left unchanged from block to block.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CFB, OFB, CBC
+ +

Definition at line 60 of file CTR.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCTR.png b/html/classCTR.png new file mode 100644 index 00000000..13dfca43 Binary files /dev/null and b/html/classCTR.png differ diff --git a/html/classCTRCommon-members.html b/html/classCTRCommon-members.html new file mode 100644 index 00000000..434d55bb --- /dev/null +++ b/html/classCTRCommon-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
CTRCommon Member List
+
+
+ +

This is the complete list of members for CTRCommon, including all inherited members.

+ + + + + + + + + + + + + + +
Cipher()Cipher
clear()CTRCommonvirtual
CTRCommon()CTRCommonprotected
decrypt(uint8_t *output, const uint8_t *input, size_t len)CTRCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)CTRCommonvirtual
ivSize() const CTRCommonvirtual
keySize() const CTRCommonvirtual
setBlockCipher(BlockCipher *cipher)CTRCommoninlineprotected
setCounterSize(size_t size)CTRCommon
setIV(const uint8_t *iv, size_t len)CTRCommonvirtual
setKey(const uint8_t *key, size_t len)CTRCommonvirtual
~Cipher()Ciphervirtual
~CTRCommon() (defined in CTRCommon)CTRCommonvirtual
+ + + + diff --git a/html/classCTRCommon.html b/html/classCTRCommon.html new file mode 100644 index 00000000..0f288557 --- /dev/null +++ b/html/classCTRCommon.html @@ -0,0 +1,571 @@ + + + + + + +ArduinoLibs: CTRCommon Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
CTRCommon Class Reference
+
+
+ +

Concrete base class to assist with implementing CTR mode for 128-bit block ciphers. + More...

+ +

#include <CTR.h>

+
+Inheritance diagram for CTRCommon:
+
+
+ + +Cipher +CTR< T > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setCounterSize (size_t size)
 Sets the counter size for the IV. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initial counter value to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + +

+Protected Member Functions

 CTRCommon ()
 Constructs a new cipher in CTR mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this CTR object. More...
 
+

Detailed Description

+

Concrete base class to assist with implementing CTR mode for 128-bit block ciphers.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CTR
+ +

Definition at line 29 of file CTR.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
CTRCommon::CTRCommon ()
+
+protected
+
+ +

Constructs a new cipher in CTR mode.

+

This constructor should be followed by a call to setBlockCipher().

+ +

Definition at line 42 of file CTR.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void CTRCommon::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implements Cipher.

+ +

Definition at line 165 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CTRCommon::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implements Cipher.

+ +

Definition at line 160 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void CTRCommon::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implements Cipher.

+ +

Definition at line 128 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CTRCommon::ivSize () const
+
+virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implements Cipher.

+ +

Definition at line 62 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t CTRCommon::keySize () const
+
+virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implements Cipher.

+ +

Definition at line 57 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void CTRCommon::setBlockCipher (BlockCiphercipher)
+
+inlineprotected
+
+ +

Sets the block cipher to use for this CTR object.

+
Parameters
+ + +
cipherThe block cipher to use to implement CTR mode, which must have a block size of 16 bytes (128 bits).
+
+
+
Note
This class only works with block ciphers whose block size is 16 bytes (128 bits). If the cipher has a different block size, then setKey() will fail and return false.
+ +

Definition at line 49 of file CTR.h.

+ +
+
+ +
+
+ + + + + + + + +
bool CTRCommon::setCounterSize (size_t size)
+
+ +

Sets the counter size for the IV.

+
Parameters
+ + +
sizeThe number of bytes on the end of the counter block that are relevant when incrementing, between 1 and 16.
+
+
+
Returns
Returns false if the size value is not between 1 and 16.
+

When the counter is incremented during encrypt(), only the last size bytes are considered relevant. This can be useful to improve performance when the higher level protocol specifies that only the least significant N bytes "count". The high level protocol should explicitly generate a new initial counter value and key long before the size bytes overflow and wrap around.

+

By default, the counter size is 16 which is the same as the block size of the underlying block cipher.

+
See Also
setIV()
+ +

Definition at line 86 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CTRCommon::setIV (const uint8_t * iv,
size_t len 
)
+
+virtual
+
+ +

Sets the initial counter value to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initial counter value which must contain exactly 16 bytes.
lenThe length of the counter value, which mut be 16.
+
+
+
Returns
Returns false if len is not exactly 16.
+

The precise method to generate the initial counter is not defined by this class. Usually higher level protocols like SSL/TLS and SSH specify how to construct the initial counter value. This class merely increments the counter every time a new block of keystream data is needed.

+
See Also
encrypt(), setCounterSize()
+ +

Implements Cipher.

+ +

Definition at line 119 of file CTR.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool CTRCommon::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implements Cipher.

+ +

Definition at line 94 of file CTR.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCTRCommon.png b/html/classCTRCommon.png new file mode 100644 index 00000000..82065c8d Binary files /dev/null and b/html/classCTRCommon.png differ diff --git a/html/classChaCha-members.html b/html/classChaCha-members.html new file mode 100644 index 00000000..273d030d --- /dev/null +++ b/html/classChaCha-members.html @@ -0,0 +1,116 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
ChaCha Member List
+
+
+ +

This is the complete list of members for ChaCha, including all inherited members.

+ + + + + + + + + + + + + + + + +
ChaCha(uint8_t numRounds=20)ChaChaexplicit
Cipher()Cipher
clear()ChaChavirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)ChaChavirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)ChaChavirtual
hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)ChaChastatic
ivSize() const ChaChavirtual
keySize() const ChaChavirtual
numRounds() const ChaChainline
setCounter(const uint8_t *counter, size_t len)ChaCha
setIV(const uint8_t *iv, size_t len)ChaChavirtual
setKey(const uint8_t *key, size_t len)ChaChavirtual
setNumRounds(uint8_t numRounds)ChaChainline
~ChaCha() (defined in ChaCha)ChaChavirtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classChaCha.html b/html/classChaCha.html new file mode 100644 index 00000000..328ef30d --- /dev/null +++ b/html/classChaCha.html @@ -0,0 +1,674 @@ + + + + + + +ArduinoLibs: ChaCha Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Static Public Member Functions | +List of all members
+
+
ChaCha Class Reference
+
+
+ +

ChaCha stream cipher. + More...

+ +

#include <ChaCha.h>

+
+Inheritance diagram for ChaCha:
+
+
+ + +Cipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ChaCha (uint8_t numRounds=20)
 Constructs a new ChaCha stream cipher. More...
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
uint8_t numRounds () const
 Returns the number of encryption rounds; usually 8, 12, or 20. More...
 
void setNumRounds (uint8_t numRounds)
 Sets the number of encryption rounds. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
bool setCounter (const uint8_t *counter, size_t len)
 Sets the starting counter for encryption. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + +

+Static Public Member Functions

static void hashCore (uint32_t *output, const uint32_t *input, uint8_t rounds)
 Executes the ChaCha hash core on an input memory block. More...
 
+

Detailed Description

+

ChaCha stream cipher.

+

ChaCha is a stream cipher that takes a key, an 8-byte nonce/IV, and a counter and hashes them to generate a keystream to XOR with the plaintext. Variations on the ChaCha cipher use 8, 12, or 20 rounds of hashing operations with either 128-bit or 256-bit keys.

+

Reference: http://cr.yp.to/chacha.html

+ +

Definition at line 28 of file ChaCha.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
ChaCha::ChaCha (uint8_t numRounds = 20)
+
+explicit
+
+ +

Constructs a new ChaCha stream cipher.

+
Parameters
+ + +
numRoundsNumber of encryption rounds to use; usually 8, 12, or 20.
+
+
+ +

Definition at line 47 of file ChaCha.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void ChaCha::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implements Cipher.

+ +

Definition at line 195 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void ChaCha::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implements Cipher.

+ +

Definition at line 190 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void ChaCha::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implements Cipher.

+ +

Definition at line 158 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void ChaCha::hashCore (uint32_t * output,
const uint32_t * input,
uint8_t rounds 
)
+
+static
+
+ +

Executes the ChaCha hash core on an input memory block.

+
Parameters
+ + + + +
outputOutput memory block, must be at least 16 words in length and must not overlap with input.
inputInput memory block, must be at least 16 words in length.
roundsNumber of ChaCha rounds to perform; usually 8, 12, or 20.
+
+
+

This function is provided for the convenience of applications that need access to the ChaCha hash core without the higher-level processing that turns the core into a stream cipher.

+ +

Definition at line 230 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t ChaCha::ivSize () const
+
+virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implements Cipher.

+ +

Definition at line 65 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t ChaCha::keySize () const
+
+virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implements Cipher.

+ +

Definition at line 59 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
uint8_t ChaCha::numRounds () const
+
+inline
+
+ +

Returns the number of encryption rounds; usually 8, 12, or 20.

+
See Also
setNumRounds()
+ +

Definition at line 37 of file ChaCha.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool ChaCha::setCounter (const uint8_t * counter,
size_t len 
)
+
+ +

Sets the starting counter for encryption.

+
Parameters
+ + + +
counterA 4-byte or 8-byte value to use for the starting counter instead of the default value of zero.
lenThe length of the counter, which must be 4 or 8.
+
+
+
Returns
Returns false if len is not 4 or 8.
+

This function must be called after setIV() and before the first call to encrypt(). It is used to specify a different starting value than zero for the counter portion of the hash input.

+
See Also
setIV()
+ +

Definition at line 145 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool ChaCha::setIV (const uint8_t * iv,
size_t len 
)
+
+virtual
+
+ +

Sets the initialization vector to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initialization vector to use.
lenThe length of the initialization vector in bytes.
+
+
+
Returns
Returns false if the length is not supported.
+

Initialization vectors should be set before the first call to encrypt() or decrypt() after a setKey() call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.

+
Note
The IV is not encoded into the output stream by encrypt(). The caller is responsible for communicating the IV to the other party.
+
See Also
ivSize()
+ +

Implements Cipher.

+ +

Definition at line 111 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool ChaCha::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implements Cipher.

+ +

Definition at line 87 of file ChaCha.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void ChaCha::setNumRounds (uint8_t numRounds)
+
+inline
+
+ +

Sets the number of encryption rounds.

+
Parameters
+ + +
numRoundsThe number of encryption rounds; usually 8, 12, or 20.
+
+
+
See Also
numRounds()
+ +

Definition at line 38 of file ChaCha.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classChaCha.png b/html/classChaCha.png new file mode 100644 index 00000000..6b26fef9 Binary files /dev/null and b/html/classChaCha.png differ diff --git a/html/classCharlieplex-members.html b/html/classCharlieplex-members.html new file mode 100644 index 00000000..291ae424 --- /dev/null +++ b/html/classCharlieplex-members.html @@ -0,0 +1,112 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Charlieplex Member List
+
+
+ +

This is the complete list of members for Charlieplex, including all inherited members.

+ + + + + + + + + + + + +
Charlieplex(const uint8_t *pins, uint8_t numPins)Charlieplex
count() const Charlieplexinline
holdTime() const Charlieplexinline
led(int index) const Charlieplexinline
loop()Charlieplex
pwmLed(int index) const Charlieplexinline
refresh()Charlieplex
setHoldTime(unsigned long us)Charlieplexinline
setLed(int index, bool value)Charlieplexinline
setPwmLed(int index, uint8_t value)Charlieplexinline
~Charlieplex()Charlieplex
+ + + + diff --git a/html/classCharlieplex.html b/html/classCharlieplex.html new file mode 100644 index 00000000..d26f5f24 --- /dev/null +++ b/html/classCharlieplex.html @@ -0,0 +1,546 @@ + + + + + + +ArduinoLibs: Charlieplex Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
Charlieplex Class Reference
+
+
+ +

Manage an array of LED's in a charlieplexed arrangement. + More...

+ +

#include <Charlieplex.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Charlieplex (const uint8_t *pins, uint8_t numPins)
 Constructs a new charliexplexing array where the output pins are specified by the numPins entries in pins. More...
 
~Charlieplex ()
 Destroys this charlieplexed array.
 
int count () const
 Returns the number of LED's in this charlieplexed array based on the number of pins. More...
 
bool led (int index) const
 Returns the value of the LED at index in the charplexed array; true if lit; false if not lit. More...
 
void setLed (int index, bool value)
 Sets the value of the LED at index in the charliplexed array. More...
 
uint8_t pwmLed (int index) const
 Returns the PWM value of the LED at index in the charplexed array; between 0 and 255. More...
 
void setPwmLed (int index, uint8_t value)
 Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255. More...
 
unsigned long holdTime () const
 Returns the number of microseconds that each LED should be held on for before moving onto the next in loop(). More...
 
void setHoldTime (unsigned long us)
 Sets the number of microseconds that each LED should be held on for before moving onto the next in loop() to us. More...
 
void loop ()
 Runs the multiplexing loop, to display the LED states on the charlieplexed array. More...
 
void refresh ()
 Refreshes the charlieplexed array by advancing to the next LED that needs to be lit. More...
 
+

Detailed Description

+

Manage an array of LED's in a charlieplexed arrangement.

+

Charlieplexing is a technique for multiplexing large numbers of LED's on a small number of microcontroller output pins. LED's are arranged in complementary pairs; the simplest being for two output pins:

+
+charlieplex2pin.png +
+

When Pin1 is 1 and Pin2 is 0, LED1 will be lit. When Pin1 is 0 and Pin2 is 1, then LED2 will be lit. The technique extends to 3 pins as follows:

+
+charlieplex3pin.png +
+

In this case, LED5 is lit when Pin1 is 1, Pin3 is 0, and Pin2 is set to a high-impedance input to "disconnect" it.

+

Charlieplex presents a simple array of led() values that indicate whether each LED is on, off, or in an intermediate PWM state (if setPwmLed() is used). The application must call loop() or refresh() on a regular basis to ensure that the multiplexed display is kept up to date. The following example drives 6 LED's connected to the output pins D9, D10, and D11:

+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+
+
void setup() {
+
charlie.setLed(0, true); // Turn on LED1
+
charlie.setLed(3, true); // Turn on LED4
+
charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
+
}
+
+
void loop() {
+
charlie.loop();
+
}
+

+

The following diagram extends the circuit for 4 output pins and 12 LED's:

+
+charlieplex4pin.png +
+

The following diagram extends the circuit for 5 output pins and 20 LED's:

+
+charlieplex5pin.png +
+

Circuits for higher numbers of LED's get increasingly complex. For those cases it can be easier to use traditional multiplexing matrix arrangements and shift registers. The DMD class does this for a specific kind of large dot matrix display. Otherwise, use the following pseudocode to determine how to connect the LED's for higher numbers of pins:

+
n = 1
+
for Pass = 1 to NumPins-1:
+
for Pin = 1 to NumPins-Pass:
+
LED[n] is connected between Pin (anode) and Pin+Pass (cathode)
+
LED[n+1] is connected between Pin+Pass (anode) and Pin (cathode)
+
n = n + 2
+

Note: while the above circuit diagrams and psuedocode use 1-based numbering for LED's, Charlieplex uses 0-based numbering in the led(), setLed(), pwmLed(), and setPwmLed() functions.

+

It isn't necessary to wire up all LED's. If you only need 10 LED's, then use the 4-output circuit and omit LED11 and LED12. Charlieplex only drives LED's that are lit; LED's that are unlit or unused will be skipped during the refresh scan. The maximum number of LED's that that can be driven by a specific number of pins is given by the following table:

+ + + + + + + + + + + + + + + + + + + + + + + +
Number of PinsNumber of LED's
22
36
412
520
630
742
856
972
1090
nn * (n - 1)
+ +

Definition at line 28 of file Charlieplex.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
Charlieplex::Charlieplex (const uint8_t * pins,
uint8_t numPins 
)
+
+ +

Constructs a new charliexplexing array where the output pins are specified by the numPins entries in pins.

+

Note: numPins must be 2 or greater for correct operation.

+
See Also
count(), setLed()
+ +

Definition at line 121 of file Charlieplex.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
int Charlieplex::count () const
+
+inline
+
+ +

Returns the number of LED's in this charlieplexed array based on the number of pins.

+ + + + + + + + + + + + + + + + + + + + + + + +
Number of PinsNumber of LED's
22
36
412
520
630
742
856
972
1090
nn * (n - 1)
+
See Also
led()
+ +

Definition at line 34 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long Charlieplex::holdTime () const
+
+inline
+
+ +

Returns the number of microseconds that each LED should be held on for before moving onto the next in loop().

+

The default value is calculated so that all LED's can be refreshed with a rate of at least 200 Hz, which is necessary for handling PWM output on multiple LED's. The less LED's that are lit at once, the faster the display will refresh.

+
See Also
setHoldTime(), loop()
+ +

Definition at line 42 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool Charlieplex::led (int index) const
+
+inline
+
+ +

Returns the value of the LED at index in the charplexed array; true if lit; false if not lit.

+

If the LED is displaying a PWM value, then this function will return true for any non-zero PWM value.

+
See Also
setLed(), pwmLed()
+ +

Definition at line 36 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + + + +
void Charlieplex::loop ()
+
+ +

Runs the multiplexing loop, to display the LED states on the charlieplexed array.

+

If holdTime() microseconds have elapsed since the last call to loop(), then the current LED is turned off and the next LED that needs to be lit is turned on.

+

LED's that do not need to be lit are skipped. The total time for a single pass through all lit LED's may be very short if only a few LED's are lit at once. If all LED's are lit, then the total time for a single pass will be count() * holdTime() microseconds.

+

If the application is using timer interrupts to drive the multiplexing process, then use refresh() instead of loop().

+
See Also
led(), pwmLed(), holdTime(), refresh()
+ +

Definition at line 277 of file Charlieplex.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
uint8_t Charlieplex::pwmLed (int index) const
+
+inline
+
+ +

Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.

+
See Also
setPwmLed(), led()
+ +

Definition at line 39 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + + + +
void Charlieplex::refresh ()
+
+ +

Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.

+

This function is intended to be called from a timer interrupt service routine to advance the multiplexing state without the main application having to explicitly call loop().

+
See Also
loop()
+ +

Definition at line 296 of file Charlieplex.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void Charlieplex::setHoldTime (unsigned long us)
+
+inline
+
+ +

Sets the number of microseconds that each LED should be held on for before moving onto the next in loop() to us.

+
See Also
holdTime(), loop()
+ +

Definition at line 43 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Charlieplex::setLed (int index,
bool value 
)
+
+inline
+
+ +

Sets the value of the LED at index in the charliplexed array.

+

The brightness of the LED will be proportional to the number of LED's that are currently lit, as the holdTime() refresh rate will cause the LED to appear to dim; the more LED's that are lit the less overall time each individual LED is held on. For best results, only a single LED should be lit at once or higher-brightness LED's should be used.

+
See Also
led(), setPwmLed()
+ +

Definition at line 37 of file Charlieplex.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Charlieplex::setPwmLed (int index,
uint8_t value 
)
+
+inline
+
+ +

Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.

+

If this function is used, then it is assumed that the output pins are capable of PWM output.

+

The PWM-specified brightness of the LED will also be affected to the number of LED's that are currently lit, as the holdTime() refresh rate will cause the LED to appear to dim; the more LED's that are lit the less overall time each individual LED is held on. For best results, only a single LED should be lit at once or higher-brightness LED's should be used.

+
See Also
pwmLed(), setLed()
+ +

Definition at line 40 of file Charlieplex.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classChaseLEDs-members.html b/html/classChaseLEDs-members.html new file mode 100644 index 00000000..fc57a0cf --- /dev/null +++ b/html/classChaseLEDs-members.html @@ -0,0 +1,107 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
ChaseLEDs Member List
+
+
+ +

This is the complete list of members for ChaseLEDs, including all inherited members.

+ + + + + + + +
advance(uint8_t prevPin, uint8_t nextPin)ChaseLEDsprotectedvirtual
advanceTime() const ChaseLEDsinline
ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)ChaseLEDs
loop()ChaseLEDs
previousPin(int n) const ChaseLEDsinlineprotected
setAdvanceTime(unsigned long advanceTime)ChaseLEDsinline
+ + + + diff --git a/html/classChaseLEDs.html b/html/classChaseLEDs.html new file mode 100644 index 00000000..491be03f --- /dev/null +++ b/html/classChaseLEDs.html @@ -0,0 +1,355 @@ + + + + + + +ArduinoLibs: ChaseLEDs Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
ChaseLEDs Class Reference
+
+
+ +

Chase LED's on output pins in a defined sequence. + More...

+ +

#include <ChaseLEDs.h>

+ + + + + + + + + + + + + +

+Public Member Functions

 ChaseLEDs (const uint8_t *pins, int num, unsigned long advanceTime)
 Initializes the LED chaser. More...
 
void loop ()
 
unsigned long advanceTime () const
 Returns the number of milliseconds that each LED will be lit in the chase sequence. More...
 
void setAdvanceTime (unsigned long advanceTime)
 Sets the number of milliseconds to advance between LED's to advanceTime. More...
 
+ + + + + + + +

+Protected Member Functions

virtual void advance (uint8_t prevPin, uint8_t nextPin)
 Advances to the next LED in sequence, turning off prevPin, and turning on nextPin. More...
 
uint8_t previousPin (int n) const
 Returns the pin that is n steps back in the sequence. More...
 
+

Detailed Description

+

Chase LED's on output pins in a defined sequence.

+

The following example performs a LED chase over the 6 PWM outputs on the Arduino Uno, with a 150 millisecond delay between each LED:

+
uint8_t pins[] = {3, 5, 6, 9, 10, 11};
+
ChaseLEDs chaser(pins, sizeof(pins), 150);
+
+
void loop() {
+
chaser.loop();
+
}
+

After pin 11 is lit, the pattern will repeat at pin 3. To cause the chase to oscillate back and forth instead, extend the sequence as follows:

+
uint8_t pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
ChaseLEDs chaser(pins, sizeof(pins), 150);
+

See the Cylon example for more information on how to use the ChaseLEDs class in a practical application.

+ +

Definition at line 28 of file ChaseLEDs.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
ChaseLEDs::ChaseLEDs (const uint8_t * pins,
int num,
unsigned long advanceTime 
)
+
+ +

Initializes the LED chaser.

+

The chase sequence consists of num pins, whose names are given by the pins array. Each LED is lit for advanceTime milliseconds before advancing to the next LED.

+

This constructor configures all of the pins for output and sets their state to be LOW. The first LED will be lit when the program first calls loop().

+
See Also
loop()
+ +

Definition at line 71 of file ChaseLEDs.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void ChaseLEDs::advance (uint8_t prevPin,
uint8_t nextPin 
)
+
+protectedvirtual
+
+ +

Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.

+

The default implementation is equivalent to the following code:

+
digitalWrite(prevPin, LOW);
+
digitalWrite(nextPin, HIGH);
+

This method may be overridden in subclasses to provide special effects. See the documentation for previousPin() for some example effects.

+
See Also
previousPin()
+ +

Definition at line 136 of file ChaseLEDs.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long ChaseLEDs::advanceTime () const
+
+inline
+
+ +

Returns the number of milliseconds that each LED will be lit in the chase sequence.

+
See Also
setAdvanceTime(), advance()
+ +

Definition at line 35 of file ChaseLEDs.h.

+ +
+
+ +
+
+ + + + + + + +
void ChaseLEDs::loop ()
+
+

Perform a single iteration of the control loop for this LED chaser.

+ +

Definition at line 87 of file ChaseLEDs.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
uint8_t ChaseLEDs::previousPin (int n) const
+
+inlineprotected
+
+ +

Returns the pin that is n steps back in the sequence.

+

If n is zero, then the current pin is returned; if n is 1, then the previous pin is returned; and so on.

+

This function may be called by subclasses in their advance() method to manipulate pins that are further back in the chase sequence than the immediately previous pin.

+

For example, the following code implements a LED chaser that lights two pins at a time:

+
void DoubleChaser::advance(uint8_t prevPin, uint8_t nextPin)
+
{
+
digitalWrite(previousPin(2), LOW);
+
digitalWrite(prevPin, HIGH);
+
digitalWrite(nextPin, HIGH);
+
}
+

As another exmaple, the following code uses PWM outputs to fade out the previous pin rather than turn it off immediately:

+
void FadingChaser::advance(uint8_t prevPin, uint8_t nextPin)
+
{
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
}
+

Note: it is possible to retrieve the following pin in sequence using previousPin(-1). This could be used to fade in the LED that follows nextPin.

+
See Also
advance()
+ +

Definition at line 40 of file ChaseLEDs.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void ChaseLEDs::setAdvanceTime (unsigned long advanceTime)
+
+inline
+
+ +

Sets the number of milliseconds to advance between LED's to advanceTime.

+
See Also
advanceTime(), advance()
+ +

Definition at line 36 of file ChaseLEDs.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCipher-members.html b/html/classCipher-members.html new file mode 100644 index 00000000..f004bff5 --- /dev/null +++ b/html/classCipher-members.html @@ -0,0 +1,110 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Cipher Member List
+
+
+ +

This is the complete list of members for Cipher, including all inherited members.

+ + + + + + + + + + +
Cipher()Cipher
clear()=0Cipherpure virtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)=0Cipherpure virtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)=0Cipherpure virtual
ivSize() const =0Cipherpure virtual
keySize() const =0Cipherpure virtual
setIV(const uint8_t *iv, size_t len)=0Cipherpure virtual
setKey(const uint8_t *key, size_t len)=0Cipherpure virtual
~Cipher()Ciphervirtual
+ + + + diff --git a/html/classCipher.html b/html/classCipher.html new file mode 100644 index 00000000..167cc853 --- /dev/null +++ b/html/classCipher.html @@ -0,0 +1,487 @@ + + + + + + +ArduinoLibs: Cipher Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
Cipher Class Referenceabstract
+
+
+ +

Abstract base class for stream ciphers. + More...

+ +

#include <Cipher.h>

+
+Inheritance diagram for Cipher:
+
+
+ + +CBCCommon +CFBCommon +ChaCha +CTRCommon +OFBCommon +CBC< T > +CFB< T > +CTR< T > +OFB< T > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
virtual size_t keySize () const =0
 Default size of the key for this cipher, in bytes. More...
 
virtual size_t ivSize () const =0
 Size of the initialization vector for this cipher, in bytes. More...
 
virtual bool setKey (const uint8_t *key, size_t len)=0
 Sets the key to use for future encryption and decryption operations. More...
 
virtual bool setIV (const uint8_t *iv, size_t len)=0
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
virtual void encrypt (uint8_t *output, const uint8_t *input, size_t len)=0
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
virtual void decrypt (uint8_t *output, const uint8_t *input, size_t len)=0
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
virtual void clear ()=0
 Clears all security-sensitive state from this cipher. More...
 
+

Detailed Description

+

Abstract base class for stream ciphers.

+

This class is intended for implementing ciphers that operate on arbitrary amounts of data. In particular, stream ciphers where the number of bytes that are input to encrypt() or decrypt() is exactly the same as the number of bytes that are output.

+

All of the stream ciphers such as ChaCha inherit directly from this class, together with block cipher modes such as CTR and CFB.

+ +

Definition at line 29 of file Cipher.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
Cipher::~Cipher ()
+
+virtual
+
+ +

Destroys this cipher object.

+

Subclasses are responsible for clearing temporary key schedules and other buffers so as to avoid leaking sensitive information.

+
See Also
clear()
+ +

Definition at line 53 of file Cipher.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void Cipher::clear ()
+
+pure virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implemented in ChaCha, CTRCommon, CBCCommon, CFBCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Cipher::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+pure virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implemented in ChaCha, CTRCommon, CBCCommon, CFBCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Cipher::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+pure virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implemented in ChaCha, CTRCommon, CBCCommon, CFBCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t Cipher::ivSize () const
+
+pure virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implemented in CBCCommon, CFBCommon, ChaCha, CTRCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t Cipher::keySize () const
+
+pure virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implemented in CBCCommon, CFBCommon, ChaCha, CTRCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Cipher::setIV (const uint8_t * iv,
size_t len 
)
+
+pure virtual
+
+ +

Sets the initialization vector to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initialization vector to use.
lenThe length of the initialization vector in bytes.
+
+
+
Returns
Returns false if the length is not supported.
+

Initialization vectors should be set before the first call to encrypt() or decrypt() after a setKey() call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.

+
Note
The IV is not encoded into the output stream by encrypt(). The caller is responsible for communicating the IV to the other party.
+
See Also
ivSize()
+ +

Implemented in ChaCha, CTRCommon, CBCCommon, CFBCommon, and OFBCommon.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Cipher::setKey (const uint8_t * key,
size_t len 
)
+
+pure virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implemented in ChaCha, CTRCommon, CBCCommon, CFBCommon, and OFBCommon.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classCipher.png b/html/classCipher.png new file mode 100644 index 00000000..3a1ad03b Binary files /dev/null and b/html/classCipher.png differ diff --git a/html/classCurve25519-members.html b/html/classCurve25519-members.html new file mode 100644 index 00000000..2c3e6bd5 --- /dev/null +++ b/html/classCurve25519-members.html @@ -0,0 +1,104 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Curve25519 Member List
+
+
+ +

This is the complete list of members for Curve25519, including all inherited members.

+ + + + +
dh1(uint8_t k[32], uint8_t f[32])Curve25519static
dh2(uint8_t k[32], uint8_t f[32])Curve25519static
eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32])Curve25519static
+ + + + diff --git a/html/classCurve25519.html b/html/classCurve25519.html new file mode 100644 index 00000000..b37e4611 --- /dev/null +++ b/html/classCurve25519.html @@ -0,0 +1,303 @@ + + + + + + +ArduinoLibs: Curve25519 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Static Public Member Functions | +List of all members
+
+
Curve25519 Class Reference
+
+
+ +

Diffie-Hellman key agreement based on the elliptic curve modulo 2^255 - 19. + More...

+ +

#include <Curve25519.h>

+ + + + + + + + + + + +

+Static Public Member Functions

static bool eval (uint8_t result[32], const uint8_t s[32], const uint8_t x[32])
 Evaluates the raw Curve25519 function. More...
 
static void dh1 (uint8_t k[32], uint8_t f[32])
 Performs phase 1 of a Diffie-Hellman key exchange using Curve25519. More...
 
static bool dh2 (uint8_t k[32], uint8_t f[32])
 Performs phase 2 of a Diffie-Hellman key exchange using Curve25519. More...
 
+

Detailed Description

+

Diffie-Hellman key agreement based on the elliptic curve modulo 2^255 - 19.

+
Note
This public functions in this class need a substantial amount of stack space to store intermediate results while the curve function is being evaluated. About 1k of free stack space is recommended for safety.
+

References: http://cr.yp.to/ecdh.html https://tools.ietf.org/html/draft-irtf-cfrg-curves-02

+ +

Definition at line 35 of file Curve25519.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Curve25519::dh1 (uint8_t k[32],
uint8_t f[32] 
)
+
+static
+
+ +

Performs phase 1 of a Diffie-Hellman key exchange using Curve25519.

+
Parameters
+ + + +
kThe key value to send to the other party as part of the exchange.
fThe generated secret value for this party. This must not be transmitted to any party or stored in permanent storage. It only needs to be kept in memory until dh2() is called.
+
+
+

The f value is generated with RNG.rand(). It is the caller's responsibility to ensure that the global random number pool has sufficient entropy to generate the 32 bytes of f safely before calling this function.

+

The following example demonstrates how to perform a full Diffie-Hellman key exchange using dh1() and dh2():

+
uint8_t f[32];
+
uint8_t k[32];
+
+
// Generate the secret value "f" and the public value "k".
+ +
+
// Send "k" to the other party.
+
...
+
+
// Read the "k" value that the other party sent to us.
+
...
+
+
// Generate the shared secret in "k" using the previous secret value "f".
+
if (!Curve25519::dh2(k, f)) {
+
// The received "k" value was invalid - abort the session.
+
...
+
}
+
+
// The "k" value can now be used to generate session keys for encryption.
+
...
+

Reference: https://tools.ietf.org/html/draft-irtf-cfrg-curves-02

+
See Also
dh2()
+ +

Definition at line 231 of file Curve25519.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Curve25519::dh2 (uint8_t k[32],
uint8_t f[32] 
)
+
+static
+
+ +

Performs phase 2 of a Diffie-Hellman key exchange using Curve25519.

+
Parameters
+ + + +
kOn entry, this is the key value that was received from the other party as part of the exchange. On exit, this will be the shared secret.
fThe secret value for this party that was generated by dh1(). The f value will be destroyed by this function.
+
+
+
Returns
Returns true if the key exchange was successful, or false if the k value is invalid.
+

Reference: https://tools.ietf.org/html/draft-irtf-cfrg-curves-02

+
See Also
dh1()
+ +

Definition at line 269 of file Curve25519.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool Curve25519::eval (uint8_t result[32],
const uint8_t s[32],
const uint8_t x[32] 
)
+
+static
+
+ +

Evaluates the raw Curve25519 function.

+
Parameters
+ + + + +
resultThe result of evaluating the curve function.
sThe S parameter to the curve function.
xThe X(Q) parameter to the curve function. If this pointer is NULL then the value 9 is used for x.
+
+
+

This function is provided to assist with implementating other algorithms with the curve. Normally applications should use dh1() and dh2() directly instead.

+
Returns
Returns true if the function was evaluated; false if x is not a proper member of the field modulo (2^255 - 19).
+

Reference: https://tools.ietf.org/html/draft-irtf-cfrg-curves-02

+
See Also
dh1(), dh2()
+ +

Definition at line 68 of file Curve25519.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classDMD-members.html b/html/classDMD-members.html new file mode 100644 index 00000000..60d9cfa9 --- /dev/null +++ b/html/classDMD-members.html @@ -0,0 +1,158 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
DMD Member List
+
+
+ +

This is the complete list of members for DMD, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bitmap(int width, int height)Bitmap
bitsPerPixel() const Bitmapinline
BlackBitmapstatic
charWidth(char ch) const Bitmap
clear(Color color=Black)Bitmap
Color typedefBitmap
copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
data()Bitmapinline
data() const Bitmapinline
disableTimer1()DMD
disableTimer2()DMD
DMD(int widthPanels=1, int heightPanels=1)DMDexplicit
doubleBuffer() const DMDinline
drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)Bitmap
drawChar(int x, int y, char ch)Bitmap
drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmapinline
drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmapinline
drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmapinline
drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)Bitmapinline
drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawText(int x, int y, const char *str, int len=-1)Bitmap
drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
enableTimer1()DMD
enableTimer2()DMD
fill(int x, int y, int width, int height, Color color)Bitmap
fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)Bitmap
font() const Bitmapinline
Font typedefBitmap
fromRGB(uint8_t r, uint8_t g, uint8_t b)DMDstatic
height() const Bitmapinline
invert(int x, int y, int width, int height)Bitmap
isValid() const Bitmapinline
loop()DMD
NoFillBitmapstatic
pixel(int x, int y) const Bitmap
ProgMem typedefBitmap
refresh()DMD
scroll(int dx, int dy, Color fillColor=Black)Bitmapinline
scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
setDoubleBuffer(bool doubleBuffer)DMD
setFont(Font font)Bitmapinline
setPixel(int x, int y, Color color)Bitmap
setTextColor(Color color)Bitmapinline
stride() const Bitmapinline
swapBuffers()DMD
swapBuffersAndCopy()DMD
textColor() const Bitmapinline
textHeight() const Bitmap
textWidth(const char *str, int len=-1) const Bitmap
textWidth(const String &str, int start=0, int len=-1) const Bitmap
WhiteBitmapstatic
width() const Bitmapinline
~Bitmap()Bitmap
~DMD()DMD
+ + + + diff --git a/html/classDMD.html b/html/classDMD.html new file mode 100644 index 00000000..8d1e3513 --- /dev/null +++ b/html/classDMD.html @@ -0,0 +1,763 @@ + + + + + + +ArduinoLibs: DMD Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Static Public Member Functions | +List of all members
+
+
DMD Class Reference
+
+
+ +

Handle large dot matrix displays composed of LED's. + More...

+ +

#include <DMD.h>

+
+Inheritance diagram for DMD:
+
+
+ + +Bitmap + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 DMD (int widthPanels=1, int heightPanels=1)
 Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size. More...
 
~DMD ()
 Destroys this dot matrix display handler.
 
bool doubleBuffer () const
 Returns true if the display is double-buffered; false if single-buffered. The default is false. More...
 
void setDoubleBuffer (bool doubleBuffer)
 Enables or disables double-buffering according to doubleBuffer. More...
 
void swapBuffers ()
 Swaps the buffers that are used for rendering to the display. More...
 
void swapBuffersAndCopy ()
 Swaps the buffers that are used for rendering to the display and copies the former back buffer contents to the new back buffer. More...
 
void loop ()
 Performs regular display refresh activities from the application's main loop. More...
 
void refresh ()
 Refresh the display. More...
 
void enableTimer1 ()
 Enables Timer1 overflow interrupts for updating this display. More...
 
void disableTimer1 ()
 Disables Timer1 overflow interrupts. More...
 
void enableTimer2 ()
 Enables Timer2 overflow interrupts for updating this display. More...
 
void disableTimer2 ()
 Disables Timer2 overflow interrupts. More...
 
- Public Member Functions inherited from Bitmap
 Bitmap (int width, int height)
 Constructs a new in-memory bitmap that is width x height pixels in size. More...
 
~Bitmap ()
 Destroys this bitmap.
 
bool isValid () const
 Returns true if the memory for this bitmap is valid; false otherwise. More...
 
int width () const
 Returns the width of the bitmap in pixels. More...
 
int height () const
 Returns the height of the bitmap in pixels. More...
 
int stride () const
 Returns the number of bytes in each line of the bitmap's data() buffer. More...
 
int bitsPerPixel () const
 Returns the number of bits per pixel for the bitmap; always 1. More...
 
uint8_t * data ()
 Returns a pointer to the start of the bitmap's data buffer. More...
 
+const uint8_t * data () const
 Returns a constant pointer to the start of the bitmap's data buffer. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void clear (Color color=Black)
 Clears the entire bitmap to the specified color. More...
 
Color pixel (int x, int y) const
 Returns the color of the pixel at (x, y); either Black or White. More...
 
void setPixel (int x, int y, Color color)
 Sets the pixel at (x, y) to color. More...
 
void drawLine (int x1, int y1, int x2, int y2, Color color=White)
 Draws a line from (x1, y1) to (x2, y2) in color. More...
 
void drawRect (int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
 Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor. More...
 
void drawFilledRect (int x1, int y1, int x2, int y2, Color color=White)
 Draws a filled rectangle from (x1, y1) to (x2, y2) in color. More...
 
void drawCircle (int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
 Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor. More...
 
void drawFilledCircle (int centerX, int centerY, int radius, Color color=White)
 Draws a filled circle with a specific center (centerX, centerY) and radius in color. More...
 
void drawBitmap (int x, int y, const Bitmap &bitmap, Color color=White)
 Draws bitmap at (x, y) in color. More...
 
void drawBitmap (int x, int y, Bitmap::ProgMem bitmap, Color color=White)
 Draws bitmap at (x, y) in color. More...
 
void drawInvertedBitmap (int x, int y, const Bitmap &bitmap)
 Draws bitmap at (x, y) in inverted colors. More...
 
void drawInvertedBitmap (int x, int y, Bitmap::ProgMem bitmap)
 Draws bitmap at (x, y) in inverted colors. More...
 
Font font () const
 Returns the currently selected font, or null if none selected. More...
 
void setFont (Font font)
 Sets the font for use with drawText() and drawChar(). More...
 
Color textColor () const
 Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White. More...
 
void setTextColor (Color color)
 Sets the color that will be used for drawing text with drawText() and drawChar(). More...
 
void drawText (int x, int y, const char *str, int len=-1)
 Draws the len characters of str at (x, y). More...
 
void drawText (int x, int y, const String &str, int start=0, int len=-1)
 Draws len characters starting at start from str to the screen at (x, y). More...
 
int drawChar (int x, int y, char ch)
 Draws a single character ch at (x, y). More...
 
int charWidth (char ch) const
 Returns the width in pixels of ch in the current font(). More...
 
int textWidth (const char *str, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing. More...
 
int textWidth (const String &str, int start=0, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing. More...
 
int textHeight () const
 Returns the height in pixels of the current text drawing font(); or zero if font() is not set. More...
 
void copy (int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
 Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest. More...
 
void fill (int x, int y, int width, int height, Color color)
 Fills the width x height pixels starting at top-left corner (x, y) with color. More...
 
void fill (int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)
 Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern. More...
 
void scroll (int dx, int dy, Color fillColor=Black)
 Scrolls the entire contents of the bitmap by dx and dy. More...
 
void scroll (int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)
 Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy. More...
 
void invert (int x, int y, int width, int height)
 Inverts the width x height pixels starting at top-left corner (x, y). More...
 
+ + + + +

+Static Public Member Functions

static Color fromRGB (uint8_t r, uint8_t g, uint8_t b)
 Converts an RGB value into a pixel color value. More...
 
+ + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from Bitmap
typedef uint8_t Color
 Type that represents the color of a pixel in a bitmap. More...
 
+typedef PGM_VOID_P ProgMem
 Type that represents a bitmap within program memory.
 
+typedef PGM_VOID_P Font
 Type that represents a font within program memory.
 
- Static Public Attributes inherited from Bitmap
+static const Color Black = 0
 Color value corresponding to "black".
 
static const Color White = 1
 Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color. More...
 
+static const Color NoFill = 2
 Special color value that is used with drawRect() and drawCircle() to indicate that the interior of the shape should not be filled. For all other uses, NoFill is equivalent to White.
 
+

Detailed Description

+

Handle large dot matrix displays composed of LED's.

+

This class is designed for use with Freetronics Large Dot Matrix Displays. These displays have 512 LED's arranged in a 32x16 matrix and controlled by an SPI interface. The displays are available in red, blue, green, yellow, and white variations (for which this class always uses the constant White regardless of the physical color).

+

+Drawing

+

DMD inherits from Bitmap so that any of the drawing functions in that class can be used to draw directly to dot matrix displays. The following example initializes a single display panel and draws a rectangle and a circle into it at setup time:

+
#include <DMD.h>
+
+
DMD display;
+
+
void setup() {
+
display.drawRect(5, 2, 27, 13);
+
display.drawCircle(16, 8, 4);
+
}
+

The display must be updated frequently from the application's main loop:

+
void loop() {
+
display.loop();
+
}
+

+Interrupt-driven display refresh

+

The loop() method simplifies updating the display from the application's main loop but it can sometimes be inconvenient to arrange for it to be called regularly, especially if the application wishes to use delay() or delayMicroseconds().

+

DMD provides an asynchronous display update mechanism using Timer1 interrupts. The application turns on interrupts using enableTimer1() and then calls refresh() from the interrupt service routine:

+
#include <DMD.h>
+
+
DMD display;
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer1();
+
}
+

If Timer1 is already in use by some other part of your application, then Timer2 can be used as an alternative interrupt source:

+
#include <DMD.h>
+
+
DMD display;
+
+
ISR(TIMER2_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer2();
+
}
+

DMD can also be used with third-party timer libraries such as TimerOne:

+
#include <DMD.h>
+
#include <TimerOne.h>
+
+
DMD display;
+
+
void refreshDisplay()
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
Timer1.initialize(5000);
+
Timer1.attachInterrupt(refreshDisplay);
+
}
+

+Double buffering

+

When using interrupts, the system can sometimes exhibit "tearing" artifacts where half-finished images are displayed because an interrupt fired in the middle of a screen update.

+

This problem can be alleviated using double buffering: all rendering is done to an off-screen buffer that is swapped onto the screen once it is ready for display. Rendering then switches to the other buffer that is now off-screen. The following example demonstrates this:

+
#include <DMD.h>
+
+
DMD display;
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.setDoubleBuffer(true);
+
display.enableTimer1();
+
}
+
+
void loop() {
+
updateDisplay();
+
display.swapBuffers();
+
delay(50); // Delay between frames.
+
}
+
+
void updateDisplay() {
+
// Draw the new display contents into the off-screen buffer.
+
display.clear();
+
...
+
}
+

The downside of double buffering is that it uses twice as much main memory to manage the contents of the screen.

+

+Multiple panels

+

Multiple panels can be daisy-chained together using ribbon cables. If there is a single row of panels, then they must be connected to the Arduino board as follows:

+
+dmd-4x1.png +
+

If there are multiple rows of panels, then alternating rows are flipped upside-down so that the short ribbon cables provided by Freetronics reach (this technique is thanks to Chris Debenham; see http://www.adebenham.com/category/arduino/dmd/ for more details):

+
+dmd-4x2.png +
+

This technique can be repeated for as many rows as required, with the bottom row always right-way-up:

+
+dmd-4x3.png +
+

DMD automatically takes care of flipping the data for panels in the alternating rows. No special action is required by the user except to physically connect the panels as shown and to initialize the DMD class appropriately:

+
#include <DMD.h>
+
+
DMD display(4, 2); // 4 panels wide, 2 panels high
+
+

Definition at line 28 of file DMD.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
DMD::DMD (int widthPanels = 1,
int heightPanels = 1 
)
+
+explicit
+
+ +

Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size.

+

Note: the parameters to this constructor are specified in panels, whereas width() and height() are specified in pixels.

+
See Also
width(), height()
+ +

Definition at line 237 of file DMD.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
void DMD::disableTimer1 ()
+
+ +

Disables Timer1 overflow interrupts.

+
See Also
enableTimer1()
+ +

Definition at line 614 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::disableTimer2 ()
+
+ +

Disables Timer2 overflow interrupts.

+
See Also
enableTimer2()
+ +

Definition at line 674 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool DMD::doubleBuffer () const
+
+inline
+
+ +

Returns true if the display is double-buffered; false if single-buffered. The default is false.

+
See Also
setDoubleBuffer(), swapBuffers(), refresh()
+ +

Definition at line 34 of file DMD.h.

+ +
+
+ +
+
+ + + + + + + +
void DMD::enableTimer1 ()
+
+ +

Enables Timer1 overflow interrupts for updating this display.

+

The application must also provide an interrupt service routine for Timer1 that calls refresh():

+
#include <DMD.h>
+
+
DMD display;
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer1();
+
}
+

If timer interrupts are being used to update the display, then it is unnecessary to call loop().

+
See Also
refresh(), disableTimer1(), enableTimer2(), setDoubleBuffer()
+ +

Definition at line 563 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::enableTimer2 ()
+
+ +

Enables Timer2 overflow interrupts for updating this display.

+

The application must also provide an interrupt service routine for Timer2 that calls refresh():

+
#include <DMD.h>
+
+
DMD display;
+
+
ISR(TIMER2_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer2();
+
}
+

If timer interrupts are being used to update the display, then it is unnecessary to call loop().

+
See Also
refresh(), disableTimer2(), enableTimer1(), setDoubleBuffer()
+ +

Definition at line 646 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
DMD::Color DMD::fromRGB (uint8_t r,
uint8_t g,
uint8_t b 
)
+
+static
+
+ +

Converts an RGB value into a pixel color value.

+

Returns White if any of r, g, or b are non-zero; otherwise returns Black.

+

This function is provided for upwards compatibility with future displays that support full color. Monochrome applications should use the Black and White constants directly.

+ +

Definition at line 690 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::loop ()
+
+ +

Performs regular display refresh activities from the application's main loop.

+
DMD display;
+
+
void loop() {
+
display.loop();
+
}
+

If you are using a timer interrupt service routine, then call refresh() in response to the interrupt instead of calling loop().

+
See Also
refresh()
+ +

Definition at line 420 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::refresh ()
+
+ +

Refresh the display.

+

This function must be called at least once every 5 milliseconds for smooth non-flickering update of the display. It is usually called by loop(), but can also be called in response to a timer interrupt.

+

If this function is called from an interrupt service routine, then it is recommended that double-buffering be enabled with setDoubleBuffer() to prevent "tearing" artifacts that result from simultaneous update of a single shared buffer.

+
See Also
loop(), setDoubleBuffer(), enableTimer1()
+ +

Definition at line 478 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void DMD::setDoubleBuffer (bool doubleBuffer)
+
+ +

Enables or disables double-buffering according to doubleBuffer.

+

When double-buffering is enabled, rendering operations are sent to a memory buffer that isn't currently displayed on-screen. Once the application has completed the screen update, it calls swapBuffers() to display the current buffer and switch rendering to the other now invisible buffer.

+

Double-buffering is recommended if refresh() is being called from an interrupt service routine, to prevent "tearing" artifacts that result from simultaneous update of a single shared buffer.

+

This function will allocate memory for the extra buffer when doubleBuffer is true. If there is insufficient memory for the second screen buffer, then this class will revert to single-buffered mode.

+
See Also
doubleBuffer(), swapBuffers(), refresh()
+ +

Definition at line 314 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::swapBuffers ()
+
+ +

Swaps the buffers that are used for rendering to the display.

+

When doubleBuffer() is false, this function does nothing. Otherwise the front and back rendering buffers are swapped. See the description of setDoubleBuffer() for more information.

+

The new rendering back buffer will have undefined contents and will probably need to be re-inialized with clear() or fill() before drawing to it. The swapBuffersAndCopy() function can be used instead to preserve the screen contents from one frame to the next.

+
See Also
swapBuffersAndCopy(), setDoubleBuffer()
+ +

Definition at line 363 of file DMD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DMD::swapBuffersAndCopy ()
+
+ +

Swaps the buffers that are used for rendering to the display and copies the former back buffer contents to the new back buffer.

+

Normally when swapBuffers() is called, the new rendering back buffer will have undefined contents from two frames prior and must be cleared with clear() or fill() before writing new contents to it. This function instead copies the previous frame into the new rendering buffer so that it can be updated in-place.

+

This function is useful if the screen does not change much from one frame to the next. If the screen changes a lot between frames, then it is usually better to explicitly clear() or fill() the new back buffer.

+
See Also
swapBuffers(), setDoubleBuffer()
+ +

Definition at line 396 of file DMD.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classDMD.png b/html/classDMD.png new file mode 100644 index 00000000..910fc7e4 Binary files /dev/null and b/html/classDMD.png differ diff --git a/html/classDS1307RTC-members.html b/html/classDS1307RTC-members.html new file mode 100644 index 00000000..314d39b7 --- /dev/null +++ b/html/classDS1307RTC-members.html @@ -0,0 +1,133 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
DS1307RTC Member List
+
+
+ +

This is the complete list of members for DS1307RTC, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
adjustDays(RTCDate *date, uint8_t flags)RTCstatic
adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
adjustYears(RTCDate *date, uint8_t flags)RTCstatic
ALARM_COUNTRTCstatic
byteCount() const DS1307RTCvirtual
dayOfWeek(const RTCDate *date)RTCstatic
DayOfWeek enum nameRTC
DECREMENTRTCstatic
DS1307RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS1307RTC
Friday enum value (defined in RTC)RTC
hasUpdates()DS1307RTCvirtual
INCREMENTRTCstatic
isRealTime() const DS1307RTCinline
Monday enum value (defined in RTC)RTC
NO_TEMPERATURERTCstatic
readAlarm(uint8_t alarmNum, RTCAlarm *value)DS1307RTCvirtual
readByte(uint8_t offset)DS1307RTCvirtual
readDate(RTCDate *value)DS1307RTCvirtual
readTemperature()RTCvirtual
readTime(RTCTime *value)DS1307RTCvirtual
RTC()RTC
Saturday enum value (defined in RTC)RTC
Sunday enum value (defined in RTC)RTC
Thursday enum value (defined in RTC)RTC
Tuesday enum value (defined in RTC)RTC
Wednesday enum value (defined in RTC)RTC
WRAPRTCstatic
writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS1307RTCvirtual
writeByte(uint8_t offset, uint8_t value)DS1307RTCvirtual
writeDate(const RTCDate *value)DS1307RTCvirtual
writeTime(const RTCTime *value)DS1307RTCvirtual
~RTC() (defined in RTC)RTC
+ + + + diff --git a/html/classDS1307RTC.html b/html/classDS1307RTC.html new file mode 100644 index 00000000..63fc4f8b --- /dev/null +++ b/html/classDS1307RTC.html @@ -0,0 +1,606 @@ + + + + + + +ArduinoLibs: DS1307RTC Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
DS1307RTC Class Reference
+
+
+ +

Communicates with a DS1307 realtime clock chip via I2C. + More...

+ +

#include <DS1307RTC.h>

+
+Inheritance diagram for DS1307RTC:
+
+
+ + +RTC + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 DS1307RTC (I2CMaster &bus, uint8_t oneHzPin=255)
 Attaches to a realtime clock slave device on bus. More...
 
+bool isRealTime () const
 Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
 
bool hasUpdates ()
 Returns true if the realtime clock has updated since the last call to this function. More...
 
void readTime (RTCTime *value)
 Reads the current time from the realtime clock into value. More...
 
void readDate (RTCDate *value)
 Reads the current date from the realtime clock into value. More...
 
void writeTime (const RTCTime *value)
 Updates the time in the realtime clock to match value. More...
 
void writeDate (const RTCDate *value)
 Updates the date in the realtime clock to match value. More...
 
void readAlarm (uint8_t alarmNum, RTCAlarm *value)
 Reads the details of the alarm with index alarmNum into value. More...
 
void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
 Updates the details of the alarm with index alarmNum from value. More...
 
int byteCount () const
 Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. More...
 
uint8_t readByte (uint8_t offset)
 Reads the byte at offset within the realtime clock's non-volatile memory. More...
 
void writeByte (uint8_t offset, uint8_t value)
 Writes value to offset within the realtime clock's non-volatile memory. More...
 
- Public Member Functions inherited from RTC
 RTC ()
 Constructs a new realtime clock handler. More...
 
virtual int readTemperature ()
 Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from RTC
enum  DayOfWeek {
+  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
+  Friday, +Saturday, +Sunday +
+ }
 Day of the week corresponding to a date. More...
 
- Static Public Member Functions inherited from RTC
static void adjustDays (RTCDate *date, uint8_t flags)
 Adjusts date up or down one day according to flags. More...
 
static void adjustMonths (RTCDate *date, uint8_t flags)
 Adjusts date up or down one month according to flags. More...
 
static void adjustYears (RTCDate *date, uint8_t flags)
 Adjusts date up or down one year according to flags. More...
 
static DayOfWeek dayOfWeek (const RTCDate *date)
 Returns the day of the week corresponding to date. More...
 
- Static Public Attributes inherited from RTC
+static const uint8_t ALARM_COUNT = 4
 Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
 
+static const int NO_TEMPERATURE = 32767
 Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
 
+static const uint8_t INCREMENT = 0x0000
 Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t DECREMENT = 0x0001
 Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t WRAP = 0x0002
 Wrap around to the beginning of the current month/year rather than advance to the next one.
 
+

Detailed Description

+

Communicates with a DS1307 realtime clock chip via I2C.

+

This class simplifies the process of reading and writing the time and date information in a DS1307 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

+

If there is no DS1307 chip on the I2C bus, this class will fall back to the RTC class to simulate the current time and date based on the value of millis().

+

The DS1307 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.

+

Note: if this class has not been used with the DS1307 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.

+
See Also
RTC, DS3232RTC
+ +

Definition at line 30 of file DS1307RTC.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
DS1307RTC::DS1307RTC (I2CMasterbus,
uint8_t oneHzPin = 255 
)
+
+ +

Attaches to a realtime clock slave device on bus.

+

If oneHzPin is not 255, then it indicates a digital input pin that is connected to the 1 Hz square wave output on the realtime clock. This input is used by hasUpdates() to determine if the time information has changed in a non-trivial manner.

+
See Also
hasUpdates()
+ +

Definition at line 83 of file DS1307RTC.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
int DS1307RTC::byteCount () const
+
+virtual
+
+ +

Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

+
See Also
readByte(), writeByte()
+ +

Reimplemented from RTC.

+ +

Definition at line 264 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool DS1307RTC::hasUpdates ()
+
+virtual
+
+ +

Returns true if the realtime clock has updated since the last call to this function.

+

The default implementation returns true, indicating that an update is always available to be read.

+ +

Reimplemented from RTC.

+ +

Definition at line 118 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS1307RTC::readAlarm (uint8_t alarmNum,
RTCAlarmvalue 
)
+
+virtual
+
+ +

Reads the details of the alarm with index alarmNum into value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
writeAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 230 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
uint8_t DS1307RTC::readByte (uint8_t offset)
+
+virtual
+
+ +

Reads the byte at offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
writeByte(), byteCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 269 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS1307RTC::readDate (RTCDatevalue)
+
+virtual
+
+ +

Reads the current date from the realtime clock into value.

+

The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

+
See Also
writeDate(), readTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 177 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS1307RTC::readTime (RTCTimevalue)
+
+virtual
+
+ +

Reads the current time from the realtime clock into value.

+
See Also
writeTime(), readDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 157 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS1307RTC::writeAlarm (uint8_t alarmNum,
const RTCAlarmvalue 
)
+
+virtual
+
+ +

Updates the details of the alarm with index alarmNum from value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
readAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 250 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS1307RTC::writeByte (uint8_t offset,
uint8_t value 
)
+
+virtual
+
+ +

Writes value to offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
readByte(), byteCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 277 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS1307RTC::writeDate (const RTCDatevalue)
+
+virtual
+
+ +

Updates the date in the realtime clock to match value.

+
See Also
readDate(), writeTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 216 of file DS1307RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS1307RTC::writeTime (const RTCTimevalue)
+
+virtual
+
+ +

Updates the time in the realtime clock to match value.

+
See Also
readTime(), writeDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 202 of file DS1307RTC.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classDS1307RTC.png b/html/classDS1307RTC.png new file mode 100644 index 00000000..dcd4436a Binary files /dev/null and b/html/classDS1307RTC.png differ diff --git a/html/classDS3231RTC-members.html b/html/classDS3231RTC-members.html new file mode 100644 index 00000000..13b08c6d --- /dev/null +++ b/html/classDS3231RTC-members.html @@ -0,0 +1,141 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
DS3231RTC Member List
+
+
+ +

This is the complete list of members for DS3231RTC, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
adjustDays(RTCDate *date, uint8_t flags)RTCstatic
adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
adjustYears(RTCDate *date, uint8_t flags)RTCstatic
ALARM_COUNTRTCstatic
byteCount() const RTCvirtual
DayOfWeek enum nameRTC
dayOfWeek(const RTCDate *date)RTCstatic
DECREMENTRTCstatic
disable32kHzOutput()DS3231RTC
disableAlarm(uint8_t alarmNum)DS3231RTC
disableAlarmInterrupts()DS3231RTC
DS3231RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS3231RTC
enable32kHzOutput()DS3231RTC
enableAlarm(uint8_t alarmNum)DS3231RTC
enableAlarmInterrupts()DS3231RTC
firedAlarm()DS3231RTC
Friday enum value (defined in RTC)RTC
hasUpdates()DS3231RTCvirtual
INCREMENTRTCstatic
isRealTime() const DS3231RTCinline
Monday enum value (defined in RTC)RTC
NO_TEMPERATURERTCstatic
readAlarm(uint8_t alarmNum, RTCAlarm *value)DS3231RTCvirtual
readByte(uint8_t offset)RTCvirtual
readDate(RTCDate *value)DS3231RTCvirtual
readTemperature()DS3231RTCvirtual
readTime(RTCTime *value)DS3231RTCvirtual
RTC()RTC
Saturday enum value (defined in RTC)RTC
setAlarm(uint8_t alarmNum, const RTCAlarm *value)DS3231RTC
Sunday enum value (defined in RTC)RTC
Thursday enum value (defined in RTC)RTC
Tuesday enum value (defined in RTC)RTC
Wednesday enum value (defined in RTC)RTC
WRAPRTCstatic
writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS3231RTCvirtual
writeByte(uint8_t offset, uint8_t value)RTCvirtual
writeDate(const RTCDate *value)DS3231RTCvirtual
writeTime(const RTCTime *value)DS3231RTCvirtual
~RTC() (defined in RTC)RTC
+ + + + diff --git a/html/classDS3231RTC.html b/html/classDS3231RTC.html new file mode 100644 index 00000000..0e8d1c34 --- /dev/null +++ b/html/classDS3231RTC.html @@ -0,0 +1,721 @@ + + + + + + +ArduinoLibs: DS3231RTC Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
DS3231RTC Class Reference
+
+
+ +

Communicates with a DS3231 realtime clock chip via I2C. + More...

+ +

#include <DS3231RTC.h>

+
+Inheritance diagram for DS3231RTC:
+
+
+ + +RTC + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 DS3231RTC (I2CMaster &bus, uint8_t oneHzPin=255)
 Attaches to a realtime clock slave device on bus. More...
 
+bool isRealTime () const
 Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
 
+bool hasUpdates ()
 Returns true if there are updates.
 
void readTime (RTCTime *value)
 Reads the current time from the realtime clock into value. More...
 
void readDate (RTCDate *value)
 Reads the current date from the realtime clock into value. More...
 
void writeTime (const RTCTime *value)
 Updates the time in the realtime clock to match value. More...
 
void writeDate (const RTCDate *value)
 Updates the date in the realtime clock to match value. More...
 
void readAlarm (uint8_t alarmNum, RTCAlarm *value)
 Reads the details of the alarm with index alarmNum into value. More...
 
void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
 Updates the details of the alarm with index alarmNum from value. More...
 
bool setAlarm (uint8_t alarmNum, const RTCAlarm *value)
 Sets the alarm with index alarmNum from value. More...
 
int readTemperature ()
 Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius. More...
 
void enableAlarmInterrupts ()
 Enables the generation of interrupts for alarms 0 and 1. More...
 
void disableAlarmInterrupts ()
 Disables the generation of interrupts for alarms 0 and 1. More...
 
int firedAlarm ()
 Determines which of alarms 0 or 1 have fired since the last call. More...
 
void enable32kHzOutput ()
 Enables the 32 kHz output on the DS3231 chip. More...
 
void disable32kHzOutput ()
 Disables the 32 kHz output on the DS3231 chip. More...
 
void enableAlarm (uint8_t alarmNum)
 Enables a specific alarm. More...
 
void disableAlarm (uint8_t alarmNum)
 Disables a specific alarm. More...
 
- Public Member Functions inherited from RTC
 RTC ()
 Constructs a new realtime clock handler. More...
 
virtual int byteCount () const
 Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. More...
 
virtual uint8_t readByte (uint8_t offset)
 Reads the byte at offset within the realtime clock's non-volatile memory. More...
 
virtual void writeByte (uint8_t offset, uint8_t value)
 Writes value to offset within the realtime clock's non-volatile memory. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from RTC
enum  DayOfWeek {
+  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
+  Friday, +Saturday, +Sunday +
+ }
 Day of the week corresponding to a date. More...
 
- Static Public Member Functions inherited from RTC
static void adjustDays (RTCDate *date, uint8_t flags)
 Adjusts date up or down one day according to flags. More...
 
static void adjustMonths (RTCDate *date, uint8_t flags)
 Adjusts date up or down one month according to flags. More...
 
static void adjustYears (RTCDate *date, uint8_t flags)
 Adjusts date up or down one year according to flags. More...
 
static DayOfWeek dayOfWeek (const RTCDate *date)
 Returns the day of the week corresponding to date. More...
 
- Static Public Attributes inherited from RTC
+static const uint8_t ALARM_COUNT = 4
 Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
 
+static const int NO_TEMPERATURE = 32767
 Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
 
+static const uint8_t INCREMENT = 0x0000
 Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t DECREMENT = 0x0001
 Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t WRAP = 0x0002
 Wrap around to the beginning of the current month/year rather than advance to the next one.
 
+

Detailed Description

+

Communicates with a DS3231 realtime clock chip via I2C.

+

This class simplifies the process of reading and writing the time and date information in a DS3231 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

+

If there is no DS3231 chip on the I2C bus, this class will fall back to the RTC class to simulate the current time and date based on the value of millis().

+

Alarms 0 and 1 can be set to generate an interrupt when they fire using enableAlarmInterrupts(). The firedAlarm() function can be used to determine which alarm has fired.

+

The DS3231 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.

+

The structure RTCAlarm is used to read and write the alarms. It has a flags field which is analogous to the alarm mask bits found in the DS3231 manual. Bit 7 signals whether this is an alarm structure with settings for alarm 0 or 1 (as these are different, see manual).

+
See Also
RTC, DS3232RTC, DS1307RTC
+ +

Definition at line 35 of file DS3231RTC.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
DS3231RTC::DS3231RTC (I2CMasterbus,
uint8_t oneHzPin = 255 
)
+
+ +

Attaches to a realtime clock slave device on bus.

+

If oneHzPin is not 255, then it indicates a digital input pin that is connected to the 1 Hz square wave output on the realtime clock. This input is used by hasUpdates() to determine if the time information has changed in a non-trivial manner.

+

If you wish to use enableAlarmInterrupts(), then oneHzPin must be 255.

+
See Also
hasUpdates(), enableAlarmInterrupts()
+ +

Definition at line 125 of file DS3231RTC.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
void DS3231RTC::disable32kHzOutput ()
+
+ +

Disables the 32 kHz output on the DS3231 chip.

+
See Also
enable32kHzOutput()
+ +

Definition at line 575 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void DS3231RTC::disableAlarm (uint8_t alarmNum)
+
+ +

Disables a specific alarm.

+
Parameters
+ + +
alarmNumThe alarm to disable.
+
+
+
See Also
enableAlarm()
+ +

Definition at line 625 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3231RTC::disableAlarmInterrupts ()
+
+ +

Disables the generation of interrupts for alarms 0 and 1.

+
See Also
enableAlarmInterrupts()
+ +

Definition at line 508 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3231RTC::enable32kHzOutput ()
+
+ +

Enables the 32 kHz output on the DS3231 chip.

+
See Also
disable32kHzOutput()
+ +

Definition at line 562 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void DS3231RTC::enableAlarm (uint8_t alarmNum)
+
+ +

Enables a specific alarm.

+
Parameters
+ + +
alarmNumThe alarm to enable.
+
+
+
See Also
disableAlarm()
+ +

Definition at line 606 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3231RTC::enableAlarmInterrupts ()
+
+ +

Enables the generation of interrupts for alarms 0 and 1.

+

When the interrupt occurs, use firedAlarm() to determine which alarm has fired. The application is responsible for implementing the interrupt service routine to watch for the interrupt.

+

Note: this function does nothing if the 1 Hz pin was enabled in the constructor, but firedAlarm() can still be used to determine which alarm has fired when hasUpdates() reports that there is an update available.

+
See Also
disableAlarmInterrupts(), firedAlarm()
+ +

Definition at line 494 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
int DS3231RTC::firedAlarm ()
+
+ +

Determines which of alarms 0 or 1 have fired since the last call.

+

Returns 0 if alarm 0 has fired, 1 if alarm 1 has fired, 2 if both alarms have fired, or -1 if neither alarm has fired.

+

The fired alarm state will be cleared, ready for the next call.

+

This function cannot be used to determine if alarms 2 or 3 have fired as they are stored in NVRAM and are not handled specially by the DS3231.

+
See Also
enableAlarmInterrupts()
+ +

Definition at line 530 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS3231RTC::readAlarm (uint8_t alarmNum,
RTCAlarmvalue 
)
+
+virtual
+
+ +

Reads the details of the alarm with index alarmNum into value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
writeAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 280 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3231RTC::readDate (RTCDatevalue)
+
+virtual
+
+ +

Reads the current date from the realtime clock into value.

+

The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

+
See Also
writeDate(), readTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 228 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int DS3231RTC::readTemperature ()
+
+virtual
+
+ +

Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

+

Returns the value NO_TEMPERATURE if the realtime clock chip cannot determine the temperature.

+ +

Reimplemented from RTC.

+ +

Definition at line 470 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3231RTC::readTime (RTCTimevalue)
+
+virtual
+
+ +

Reads the current time from the realtime clock into value.

+
See Also
writeTime(), readDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 207 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool DS3231RTC::setAlarm (uint8_t alarmNum,
const RTCAlarmvalue 
)
+
+ +

Sets the alarm with index alarmNum from value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+
Returns
Returns true if the alarm was set; false otherwise.
+
See Also
writeAlarm()
+ +

Definition at line 408 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS3231RTC::writeAlarm (uint8_t alarmNum,
const RTCAlarmvalue 
)
+
+virtual
+
+ +

Updates the details of the alarm with index alarmNum from value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
readAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 374 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3231RTC::writeDate (const RTCDatevalue)
+
+virtual
+
+ +

Updates the date in the realtime clock to match value.

+
See Also
readDate(), writeTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 266 of file DS3231RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3231RTC::writeTime (const RTCTimevalue)
+
+virtual
+
+ +

Updates the time in the realtime clock to match value.

+
See Also
readTime(), writeDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 252 of file DS3231RTC.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classDS3231RTC.png b/html/classDS3231RTC.png new file mode 100644 index 00000000..09a5e194 Binary files /dev/null and b/html/classDS3231RTC.png differ diff --git a/html/classDS3232RTC-members.html b/html/classDS3232RTC-members.html new file mode 100644 index 00000000..4567b376 --- /dev/null +++ b/html/classDS3232RTC-members.html @@ -0,0 +1,138 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
DS3232RTC Member List
+
+
+ +

This is the complete list of members for DS3232RTC, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
adjustDays(RTCDate *date, uint8_t flags)RTCstatic
adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
adjustYears(RTCDate *date, uint8_t flags)RTCstatic
ALARM_COUNTRTCstatic
byteCount() const DS3232RTCvirtual
dayOfWeek(const RTCDate *date)RTCstatic
DayOfWeek enum nameRTC
DECREMENTRTCstatic
disable32kHzOutput()DS3232RTC
disableAlarmInterrupts()DS3232RTC
DS3232RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS3232RTC
enable32kHzOutput()DS3232RTC
enableAlarmInterrupts()DS3232RTC
firedAlarm()DS3232RTC
Friday enum value (defined in RTC)RTC
hasUpdates()DS3232RTCvirtual
INCREMENTRTCstatic
isRealTime() const DS3232RTCinline
Monday enum value (defined in RTC)RTC
NO_TEMPERATURERTCstatic
readAlarm(uint8_t alarmNum, RTCAlarm *value)DS3232RTCvirtual
readByte(uint8_t offset)DS3232RTCvirtual
readDate(RTCDate *value)DS3232RTCvirtual
readTemperature()DS3232RTCvirtual
readTime(RTCTime *value)DS3232RTCvirtual
RTC()RTC
Saturday enum value (defined in RTC)RTC
Sunday enum value (defined in RTC)RTC
Thursday enum value (defined in RTC)RTC
Tuesday enum value (defined in RTC)RTC
Wednesday enum value (defined in RTC)RTC
WRAPRTCstatic
writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS3232RTCvirtual
writeByte(uint8_t offset, uint8_t value)DS3232RTCvirtual
writeDate(const RTCDate *value)DS3232RTCvirtual
writeTime(const RTCTime *value)DS3232RTCvirtual
~RTC() (defined in RTC)RTC
+ + + + diff --git a/html/classDS3232RTC.html b/html/classDS3232RTC.html new file mode 100644 index 00000000..9e4a90a7 --- /dev/null +++ b/html/classDS3232RTC.html @@ -0,0 +1,758 @@ + + + + + + +ArduinoLibs: DS3232RTC Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
DS3232RTC Class Reference
+
+
+ +

Communicates with a DS3232 realtime clock chip via I2C. + More...

+ +

#include <DS3232RTC.h>

+
+Inheritance diagram for DS3232RTC:
+
+
+ + +RTC + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 DS3232RTC (I2CMaster &bus, uint8_t oneHzPin=255)
 Attaches to a realtime clock slave device on bus. More...
 
+bool isRealTime () const
 Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
 
bool hasUpdates ()
 Returns true if the realtime clock has updated since the last call to this function. More...
 
void readTime (RTCTime *value)
 Reads the current time from the realtime clock into value. More...
 
void readDate (RTCDate *value)
 Reads the current date from the realtime clock into value. More...
 
void writeTime (const RTCTime *value)
 Updates the time in the realtime clock to match value. More...
 
void writeDate (const RTCDate *value)
 Updates the date in the realtime clock to match value. More...
 
void readAlarm (uint8_t alarmNum, RTCAlarm *value)
 Reads the details of the alarm with index alarmNum into value. More...
 
void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
 Updates the details of the alarm with index alarmNum from value. More...
 
int byteCount () const
 Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. More...
 
uint8_t readByte (uint8_t offset)
 Reads the byte at offset within the realtime clock's non-volatile memory. More...
 
void writeByte (uint8_t offset, uint8_t value)
 Writes value to offset within the realtime clock's non-volatile memory. More...
 
int readTemperature ()
 Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius. More...
 
void enableAlarmInterrupts ()
 Enables the generation of interrupts for alarms 0 and 1. More...
 
void disableAlarmInterrupts ()
 Disables the generation of interrupts for alarms 0 and 1. More...
 
int firedAlarm ()
 Determines which of alarms 0 or 1 have fired since the last call. More...
 
void enable32kHzOutput ()
 Enables the 32 kHz output on the DS3232 chip. More...
 
void disable32kHzOutput ()
 Disables the 32 kHz output on the DS3232 chip. More...
 
- Public Member Functions inherited from RTC
 RTC ()
 Constructs a new realtime clock handler. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from RTC
enum  DayOfWeek {
+  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
+  Friday, +Saturday, +Sunday +
+ }
 Day of the week corresponding to a date. More...
 
- Static Public Member Functions inherited from RTC
static void adjustDays (RTCDate *date, uint8_t flags)
 Adjusts date up or down one day according to flags. More...
 
static void adjustMonths (RTCDate *date, uint8_t flags)
 Adjusts date up or down one month according to flags. More...
 
static void adjustYears (RTCDate *date, uint8_t flags)
 Adjusts date up or down one year according to flags. More...
 
static DayOfWeek dayOfWeek (const RTCDate *date)
 Returns the day of the week corresponding to date. More...
 
- Static Public Attributes inherited from RTC
+static const uint8_t ALARM_COUNT = 4
 Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
 
+static const int NO_TEMPERATURE = 32767
 Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
 
+static const uint8_t INCREMENT = 0x0000
 Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t DECREMENT = 0x0001
 Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t WRAP = 0x0002
 Wrap around to the beginning of the current month/year rather than advance to the next one.
 
+

Detailed Description

+

Communicates with a DS3232 realtime clock chip via I2C.

+

This class simplifies the process of reading and writing the time and date information in a DS3232 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

+

If there is no DS3232 chip on the I2C bus, this class will fall back to the RTC class to simulate the current time and date based on the value of millis().

+

Alarms 0 and 1 can be set to generate an interrupt when they fire using enableAlarmInterrupts(). The firedAlarm() function can be used to determine which alarm has fired. Alarms 2 and 3 cannot be monitored with interrupts.

+

The DS3232 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.

+

Note: if this class has not been used with the DS3232 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.

+
See Also
RTC, DS1307RTC
+ +

Definition at line 30 of file DS3232RTC.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
DS3232RTC::DS3232RTC (I2CMasterbus,
uint8_t oneHzPin = 255 
)
+
+ +

Attaches to a realtime clock slave device on bus.

+

If oneHzPin is not 255, then it indicates a digital input pin that is connected to the 1 Hz square wave output on the realtime clock. This input is used by hasUpdates() to determine if the time information has changed in a non-trivial manner.

+

If you wish to use enableAlarmInterrupts(), then oneHzPin must be 255.

+
See Also
hasUpdates(), enableAlarmInterrupts()
+ +

Definition at line 126 of file DS3232RTC.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
int DS3232RTC::byteCount () const
+
+virtual
+
+ +

Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

+
See Also
readByte(), writeByte()
+ +

Reimplemented from RTC.

+ +

Definition at line 335 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3232RTC::disable32kHzOutput ()
+
+ +

Disables the 32 kHz output on the DS3232 chip.

+
See Also
enable32kHzOutput()
+ +

Definition at line 458 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3232RTC::disableAlarmInterrupts ()
+
+ +

Disables the generation of interrupts for alarms 0 and 1.

+
See Also
enableAlarmInterrupts()
+ +

Definition at line 393 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3232RTC::enable32kHzOutput ()
+
+ +

Enables the 32 kHz output on the DS3232 chip.

+
See Also
disable32kHzOutput()
+ +

Definition at line 444 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
void DS3232RTC::enableAlarmInterrupts ()
+
+ +

Enables the generation of interrupts for alarms 0 and 1.

+

When the interrupt occurs, use firedAlarm() to determine which alarm has fired. The application is responsible for implementing the interrupt service routine to watch for the interrupt.

+

Note: this function does nothing if the 1 Hz pin was enabled in the constructor, but firedAlarm() can still be used to determine which alarm has fired when hasUpdates() reports that there is an update available.

+
See Also
disableAlarmInterrupts(), firedAlarm()
+ +

Definition at line 380 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + + + +
int DS3232RTC::firedAlarm ()
+
+ +

Determines which of alarms 0 or 1 have fired since the last call.

+

Returns 0 if alarm 0 has fired, 1 if alarm 1 has fired, 2 if both alarms have fired, or -1 if neither alarm has fired.

+

The fired alarm state will be cleared, ready for the next call.

+

This function cannot be used to determine if alarms 2 or 3 have fired as they are stored in NVRAM and are not handled specially by the DS3232.

+
See Also
enableAlarmInterrupts()
+ +

Definition at line 416 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool DS3232RTC::hasUpdates ()
+
+virtual
+
+ +

Returns true if the realtime clock has updated since the last call to this function.

+

The default implementation returns true, indicating that an update is always available to be read.

+ +

Reimplemented from RTC.

+ +

Definition at line 166 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS3232RTC::readAlarm (uint8_t alarmNum,
RTCAlarmvalue 
)
+
+virtual
+
+ +

Reads the details of the alarm with index alarmNum into value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
writeAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 278 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
uint8_t DS3232RTC::readByte (uint8_t offset)
+
+virtual
+
+ +

Reads the byte at offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
writeByte(), byteCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 340 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3232RTC::readDate (RTCDatevalue)
+
+virtual
+
+ +

Reads the current date from the realtime clock into value.

+

The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

+
See Also
writeDate(), readTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 225 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int DS3232RTC::readTemperature ()
+
+virtual
+
+ +

Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

+

Returns the value NO_TEMPERATURE if the realtime clock chip cannot determine the temperature.

+ +

Reimplemented from RTC.

+ +

Definition at line 356 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3232RTC::readTime (RTCTimevalue)
+
+virtual
+
+ +

Reads the current time from the realtime clock into value.

+
See Also
writeTime(), readDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 205 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS3232RTC::writeAlarm (uint8_t alarmNum,
const RTCAlarmvalue 
)
+
+virtual
+
+ +

Updates the details of the alarm with index alarmNum from value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
readAlarm(), alarmCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 298 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void DS3232RTC::writeByte (uint8_t offset,
uint8_t value 
)
+
+virtual
+
+ +

Writes value to offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
readByte(), byteCount()
+ +

Reimplemented from RTC.

+ +

Definition at line 348 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3232RTC::writeDate (const RTCDatevalue)
+
+virtual
+
+ +

Updates the date in the realtime clock to match value.

+
See Also
readDate(), writeTime()
+ +

Reimplemented from RTC.

+ +

Definition at line 264 of file DS3232RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void DS3232RTC::writeTime (const RTCTimevalue)
+
+virtual
+
+ +

Updates the time in the realtime clock to match value.

+
See Also
readTime(), writeDate()
+ +

Reimplemented from RTC.

+ +

Definition at line 250 of file DS3232RTC.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classDS3232RTC.png b/html/classDS3232RTC.png new file mode 100644 index 00000000..0dc8cb0d Binary files /dev/null and b/html/classDS3232RTC.png differ diff --git a/html/classEEPROM24-members.html b/html/classEEPROM24-members.html new file mode 100644 index 00000000..935ed035 --- /dev/null +++ b/html/classEEPROM24-members.html @@ -0,0 +1,109 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
EEPROM24 Member List
+
+
+ +

This is the complete list of members for EEPROM24, including all inherited members.

+ + + + + + + + + +
available()EEPROM24
EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank=0)EEPROM24
pageSize() const EEPROM24inline
read(unsigned long address)EEPROM24
read(unsigned long address, void *data, size_t length)EEPROM24
size() const EEPROM24inline
write(unsigned long address, uint8_t value)EEPROM24
write(unsigned long address, const void *data, size_t length)EEPROM24
+ + + + diff --git a/html/classEEPROM24.html b/html/classEEPROM24.html new file mode 100644 index 00000000..54350ab1 --- /dev/null +++ b/html/classEEPROM24.html @@ -0,0 +1,439 @@ + + + + + + +ArduinoLibs: EEPROM24 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
EEPROM24 Class Reference
+
+
+ +

Reading and writing EEPROM's from the 24LCXX family. + More...

+ +

#include <EEPROM24.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 EEPROM24 (I2CMaster &bus, unsigned long type, uint8_t bank=0)
 Constructs a new EEPROM access object on bus for an EEPROM of the specified type. More...
 
unsigned long size () const
 Returns the size of the EEPROM in bytes. More...
 
unsigned long pageSize () const
 Returns the size of a single EEPROM page in bytes. More...
 
bool available ()
 Returns true if the EEPROM is available on the I2C bus; false otherwise. More...
 
uint8_t read (unsigned long address)
 Reads a single byte from the EEPROM at address. More...
 
size_t read (unsigned long address, void *data, size_t length)
 Reads a block of length bytes from the EEPROM at address into the specified data buffer. More...
 
bool write (unsigned long address, uint8_t value)
 Writes a byte value to address in the EEPROM. More...
 
size_t write (unsigned long address, const void *data, size_t length)
 Writes length bytes from a data buffer to address in the EEPROM. More...
 
+

Detailed Description

+

Reading and writing EEPROM's from the 24LCXX family.

+

The 24LCXX family of EEPROM's provide a variety of memory sizes from 16 bytes up to 128 kBytes that can be accessed via the I2C protocol. These chips can be used to augment the 1 kByte or so of builtin EEPROM memory that is typical on Arduino boards. The EEPROM should be wired to an Arduino Uno as follows:

+
+eeprom_circuit.png +
+

Access to a 24LCXX chip is initialized as follows:

+
SoftI2C i2c(A4, A5);
+
EEPROM24 eeprom(i2c, EEPROM_24LC256);
+

Once initialized, read() and write() can be used to manipulate the contents of the EEPROM's memory.

+

The following EEPROM types are supported by this class:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChipTypeSize
24lc00EEPROM_24LC00 16 bytes
24lc01EEPROM_24LC01 128 bytes
24lc014EEPROM_24LC014 128 bytes
24lc02EEPROM_24LC02 256 bytes
24lc024EEPROM_24LC024 256 bytes
24lc025EEPROM_24LC025 256 bytes
24lc04EEPROM_24LC04 512 bytes
24lc08EEPROM_24LC08 1 kByte
24lc16EEPROM_24LC16 2 kBytes
24lc32EEPROM_24LC32 4 kBytes
24lc64EEPROM_24LC64 8 kBytes
24lc128EEPROM_24LC128 16 kBytes
24lc256EEPROM_24LC256 32 kBytes
24lc512EEPROM_24LC512 64 kBytes
24lc1025EEPROM_24LC1025 128 kBytes
24lc1026EEPROM_24LC1026 128 kBytes
+

There can be multiple 24LCXX chips on the same I2C bus, as long as their A0, A1, and A2 address pins are set to different values. For example, two 24LC256 chips can be used to provide the same memory capacity as a single 24LC512 chip. The optional bank parameter to the constructor is used to assign different bank addresses to each chip:

+
SoftI2C i2c(A4, A5);
+
EEPROM24 eeprom0(i2c, EEPROM_24LC256, 0);
+
EEPROM24 eeprom1(i2c, EEPROM_24LC256, 1);
+
See Also
I2CMaster
+ +

Definition at line 60 of file EEPROM24.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
EEPROM24::EEPROM24 (I2CMasterbus,
unsigned long type,
uint8_t bank = 0 
)
+
+ +

Constructs a new EEPROM access object on bus for an EEPROM of the specified type.

+

The bank can be used to choose between multiple EEPROM's on bus of the specified type. The bank corresponds to the value that is set on the EEPROM's A0, A1, and A2 address pins. Note that some EEPROM's have less than 3 address pins; consult the datasheet for more information.

+ +

Definition at line 95 of file EEPROM24.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
bool EEPROM24::available ()
+
+ +

Returns true if the EEPROM is available on the I2C bus; false otherwise.

+

This function can be used to probe the I2C bus to determine if the EEPROM is present or not.

+
See Also
read(), write()
+ +

Definition at line 152 of file EEPROM24.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long EEPROM24::pageSize () const
+
+inline
+
+ +

Returns the size of a single EEPROM page in bytes.

+

Writes that are a multiple of the page size and aligned on a page boundary will typically be more efficient than non-aligned writes.

+
See Also
size()
+ +

Definition at line 66 of file EEPROM24.h.

+ +
+
+ +
+
+ + + + + + + + +
uint8_t EEPROM24::read (unsigned long address)
+
+ +

Reads a single byte from the EEPROM at address.

+
See Also
write()
+ +

Definition at line 167 of file EEPROM24.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t EEPROM24::read (unsigned long address,
void * data,
size_t length 
)
+
+ +

Reads a block of length bytes from the EEPROM at address into the specified data buffer.

+

Returns the number of bytes that were read, which may be short if address + length is greater than size() or the EEPROM is not available on the I2C bus.

+
See Also
write(), available()
+ +

Definition at line 187 of file EEPROM24.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long EEPROM24::size () const
+
+inline
+
+ +

Returns the size of the EEPROM in bytes.

+
See Also
pageSize()
+ +

Definition at line 65 of file EEPROM24.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool EEPROM24::write (unsigned long address,
uint8_t value 
)
+
+ +

Writes a byte value to address in the EEPROM.

+

Returns true if the byte was written successfully, or false if address is out of range or the EEPROM is not available on the I2C bus.

+
See Also
read(), available()
+ +

Definition at line 213 of file EEPROM24.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t EEPROM24::write (unsigned long address,
const void * data,
size_t length 
)
+
+ +

Writes length bytes from a data buffer to address in the EEPROM.

+

Returns the number of bytes that were written, which may be short if address + length is greater than size() or the EEPROM is not available on the I2C bus.

+

Best performance will be achieved if address and length are a multiple of pageSize().

+
See Also
read(), available(), pageSize()
+ +

Definition at line 235 of file EEPROM24.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classField-members.html b/html/classField-members.html new file mode 100644 index 00000000..2a0f2c50 --- /dev/null +++ b/html/classField-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Field Member List
+
+
+ +

This is the complete list of members for Field, including all inherited members.

+ + + + + + + + + + + + + + +
dispatch(int event)Fieldvirtual
enterField(bool reverse)Fieldvirtual
exitField()Fieldvirtual
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
Form (defined in Field)Fieldfriend
isCurrent() const Field
label() const Fieldinline
lcd() const Fieldinlineprotected
setLabel(const String &label)Field
updateCursor()Fieldprotectedvirtual
~Field()Field
+ + + + diff --git a/html/classField.html b/html/classField.html new file mode 100644 index 00000000..692b958a --- /dev/null +++ b/html/classField.html @@ -0,0 +1,432 @@ + + + + + + +ArduinoLibs: Field Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +Friends | +List of all members
+
+
Field Class Reference
+
+
+ +

Manages a single data input/output field within a Form. + More...

+ +

#include <Field.h>

+
+Inheritance diagram for Field:
+
+
+ + +BoolField +IntField +ListField +TextField +TimeField + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
virtual int dispatch (int event)
 Dispatches event via this field. More...
 
virtual void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
virtual void exitField ()
 Exits the field due to form navigation. More...
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + +

+Protected Member Functions

+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+ + + +

+Friends

+class Form
 
+

Detailed Description

+

Manages a single data input/output field within a Form.

+
See Also
Form, BoolField, IntField, ListField, TextField, TimeField
+ +

Definition at line 28 of file Field.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
Field::Field (const String & label)
+
+explicit
+
+ +

Constructs a new field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+
See Also
Form::addField()
+ +

Definition at line 40 of file Field.cpp.

+ +
+
+ +
+
+ + + + + + + +
Field::~Field ()
+
+ +

Destroys this field and removes it from its owning Form.

+
See Also
Form::removeField()
+ +

Definition at line 66 of file Field.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
int Field::dispatch (int event)
+
+virtual
+
+ +

Dispatches event via this field.

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

+

Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

+
See Also
Form::dispatch(), LCD::getButton()
+ +

Reimplemented in ListField, TimeField, IntField, and BoolField.

+ +

Definition at line 96 of file Field.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void Field::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented in ListField, TimeField, IntField, BoolField, and TextField.

+ +

Definition at line 116 of file Field.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void Field::exitField ()
+
+virtual
+
+ +

Exits the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate from the field.

+
See Also
enterField()
+ +

Reimplemented in TimeField.

+ +

Definition at line 129 of file Field.cpp.

+ +
+
+ +
+
+ + + + + + + +
bool Field::isCurrent () const
+
+ +

Returns true if this field is the currently-displayed field in its owning form; false otherwise.

+

This function should be called from property setters in subclasses to determine if the screen should be updated when a property is modified.

+ +

Definition at line 169 of file Field.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
const String & Field::label () const
+
+inline
+
+ +

Returns the label to display in the first line of this field.

+
See Also
setLabel()
+ +

Definition at line 41 of file Field.h.

+ +
+
+ +
+
+ + + + + + + + +
void Field::setLabel (const String & label)
+
+ +

Sets the label to display in the first line of this field.

+
See Also
label()
+ +

Definition at line 146 of file Field.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void Field::updateCursor ()
+
+protectedvirtual
+
+ +

Updates the cursor position after the label has been drawn by setLabel().

+

The default implementation does nothing. Subclasses that use an LCD cursor may override this to ensure that the cursor position stays valid after the label is modified.

+
See Also
setLabel()
+ +

Definition at line 191 of file Field.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classField.png b/html/classField.png new file mode 100644 index 00000000..7dcee809 Binary files /dev/null and b/html/classField.png differ diff --git a/html/classForm-members.html b/html/classForm-members.html new file mode 100644 index 00000000..bfd42e65 --- /dev/null +++ b/html/classForm-members.html @@ -0,0 +1,116 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Form Member List
+
+
+ +

This is the complete list of members for Form, including all inherited members.

+ + + + + + + + + + + + + + + + +
addField(Field *field)Form
currentField() const Forminline
defaultField()Form
dispatch(int event)Form
Field (defined in Form)Formfriend
Form(LiquidCrystal &lcd)Formexplicit
hide()Form
isCurrent(Field &field) const Forminline
isVisible() const Forminline
nextField()Form
prevField()Form
removeField(Field *field)Form
setCurrentField(Field *field)Form
show()Form
~Form()Form
+ + + + diff --git a/html/classForm.html b/html/classForm.html new file mode 100644 index 00000000..dac6c529 --- /dev/null +++ b/html/classForm.html @@ -0,0 +1,493 @@ + + + + + + +ArduinoLibs: Form Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Friends | +List of all members
+
+
Form Class Reference
+
+
+ +

Manager for a form containing data input/output fields. + More...

+ +

#include <Form.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Form (LiquidCrystal &lcd)
 Constructs a new form and associates it with lcd. More...
 
~Form ()
 Detaches all remaining fields and destroys this form.
 
int dispatch (int event)
 Dispatches event to the currently active field using Field::dispatch(). More...
 
void nextField ()
 Changes to the next field in the "tab order". More...
 
void prevField ()
 Changes to the previous field in the "tab order". More...
 
void defaultField ()
 Changes to default field (i.e., the first field). More...
 
void addField (Field *field)
 Adds field to this form. More...
 
void removeField (Field *field)
 Removes field from this form. More...
 
FieldcurrentField () const
 Returns the current field that is displayed on-screen. More...
 
void setCurrentField (Field *field)
 Sets the current field that is displayed on-screen. More...
 
bool isCurrent (Field &field) const
 Returns true if field is currently displayed on-screen, false otherwise. More...
 
void show ()
 Shows the form, or does nothing if the form is already on-screen. More...
 
void hide ()
 Hides the form, or does nothing if the form is not on-screen. More...
 
bool isVisible () const
 Returns true if the form is shown; false if the form is hidden. More...
 
+ + + +

+Friends

+class Field
 
+

Detailed Description

+

Manager for a form containing data input/output fields.

+

See the Form example for more information on creating an application that uses forms and fields.

+ +

Definition at line 32 of file Form.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
Form::Form (LiquidCrystal & lcd)
+
+explicit
+
+ +

Constructs a new form and associates it with lcd.

+

This constructor is typically followed by calls to construct Field values for each of the fields on the form. For example:

+
Form mainForm(lcd);
+
TextField welcomeField(mainForm, "Form example", "v1.0");
+
+FormText.png +
+ +

Definition at line 47 of file Form.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
void Form::addField (Fieldfield)
+
+ +

Adds field to this form.

+

Usually this function is not required because the field's constructor will add the field to the form automatically.

+
See Also
removeField()
+ +

Definition at line 165 of file Form.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
Field * Form::currentField () const
+
+inline
+
+ +

Returns the current field that is displayed on-screen.

+

Returns null if the form has no fields, or setCurrentField() explicitly set the current field to null.

+
See Also
setCurrentField(), isCurrent()
+ +

Definition at line 46 of file Form.h.

+ +
+
+ +
+
+ + + + + + + +
void Form::defaultField ()
+
+ +

Changes to default field (i.e., the first field).

+
See Also
nextField(), prevField(), currentField()
+ +

Definition at line 152 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + + +
int Form::dispatch (int event)
+
+ +

Dispatches event to the currently active field using Field::dispatch().

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if one of the fields on the form has changed value due to the event, perhaps requiring the application to take further action based on the new field value. Use currentField() or isCurrent() to determine which field has changed.

+
int event = lcd.getButton();
+
if (mainForm.dispatch(event) == FORM_CHANGED) {
+
if (mainForm.isCurrent(volumeField)) {
+
// Adjust the volume to match the field.
+
setVolume(volumeField.value());
+
}
+
}
+

This function handles the Left and Right buttons to navigate between fields.

+
See Also
Field::dispatch(), LCD::getButton(), currentField(), isCurrent()
+ +

Definition at line 99 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Form::hide ()
+
+ +

Hides the form, or does nothing if the form is not on-screen.

+

The screen will be cleared to remove the contents of the current field.

+
See Also
show(), isVisible()
+ +

Definition at line 293 of file Form.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool Form::isCurrent (Fieldfield) const
+
+inline
+
+ +

Returns true if field is currently displayed on-screen, false otherwise.

+

This function is typically called after dispatch() returns FORM_CHANGED to determine which field has changed.

+
See Also
currentField(), setCurrentField()
+ +

Definition at line 49 of file Form.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool Form::isVisible () const
+
+inline
+
+ +

Returns true if the form is shown; false if the form is hidden.

+
See Also
show(), hide()
+ +

Definition at line 53 of file Form.h.

+ +
+
+ +
+
+ + + + + + + +
void Form::nextField ()
+
+ +

Changes to the next field in the "tab order".

+
See Also
prevField(), defaultField(), currentField()
+ +

Definition at line 118 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Form::prevField ()
+
+ +

Changes to the previous field in the "tab order".

+
See Also
nextField(), defaultField(), currentField()
+ +

Definition at line 135 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void Form::removeField (Fieldfield)
+
+ +

Removes field from this form.

+

If field is the current field on-screen, then either the next or previous field will be made current.

+
See Also
addField()
+ +

Definition at line 187 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void Form::setCurrentField (Fieldfield)
+
+ +

Sets the current field that is displayed on-screen.

+

Use this function to programmatically force the form to display a specific field on-screen.

+
See Also
currentField(), isCurrent()
+ +

Definition at line 230 of file Form.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Form::show ()
+
+ +

Shows the form, or does nothing if the form is already on-screen.

+

When the form is shown, the screen will be cleared and the currentField() will be drawn.

+

If the form was previously hidden, then the field that was previously current will be shown again. Call defaultField() before show() to reset the form to show the first field instead.

+
See Also
hide(), isVisible(), defaultField()
+ +

Definition at line 274 of file Form.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classHash-members.html b/html/classHash-members.html new file mode 100644 index 00000000..0ee9ba82 --- /dev/null +++ b/html/classHash-members.html @@ -0,0 +1,112 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Hash Member List
+
+
+ +

This is the complete list of members for Hash, including all inherited members.

+ + + + + + + + + + + + +
blockSize() const =0Hashpure virtual
clear()=0Hashpure virtual
finalize(void *hash, size_t len)=0Hashpure virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)=0Hashpure virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
Hash()Hash
hashSize() const =0Hashpure virtual
reset()=0Hashpure virtual
resetHMAC(const void *key, size_t keyLen)=0Hashpure virtual
update(const void *data, size_t len)=0Hashpure virtual
~Hash()Hashvirtual
+ + + + diff --git a/html/classHash.html b/html/classHash.html new file mode 100644 index 00000000..99a1878b --- /dev/null +++ b/html/classHash.html @@ -0,0 +1,584 @@ + + + + + + +ArduinoLibs: Hash Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
Hash Class Referenceabstract
+
+
+ +

Abstract base class for cryptographic hash algorithms. + More...

+ +

#include <Hash.h>

+
+Inheritance diagram for Hash:
+
+
+ + +BLAKE2b +BLAKE2s +SHA1 +SHA256 +SHA3_256 +SHA3_512 +SHA512 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
virtual size_t hashSize () const =0
 Size of the hash result from finalize(). More...
 
virtual size_t blockSize () const =0
 Size of the internal block used by the hash algorithm. More...
 
virtual void reset ()=0
 Resets the hash ready for a new hashing process. More...
 
virtual void update (const void *data, size_t len)=0
 Updates the hash with more data. More...
 
virtual void finalize (void *hash, size_t len)=0
 Finalizes the hashing process and returns the hash. More...
 
virtual void clear ()=0
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
virtual void resetHMAC (const void *key, size_t keyLen)=0
 Resets the hash ready for a new HMAC hashing process. More...
 
virtual void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)=0
 Finalizes the HMAC hashing process and returns the hash. More...
 
+ + + + +

+Protected Member Functions

void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

Abstract base class for cryptographic hash algorithms.

+
See Also
SHA1, SHA256
+ +

Definition at line 29 of file Hash.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
Hash::~Hash ()
+
+virtual
+
+ +

Destroys this hash object.

+
Note
Subclasses are responsible for clearing any sensitive data that remains in the hash object when it is destroyed.
+
See Also
clear()
+ +

Definition at line 48 of file Hash.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t Hash::blockSize () const
+
+pure virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implemented in SHA3_512, SHA3_256, BLAKE2b, BLAKE2s, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void Hash::clear ()
+
+pure virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implemented in SHA3_512, BLAKE2b, BLAKE2s, SHA3_256, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Hash::finalize (void * hash,
size_t len 
)
+
+pure virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implemented in SHA3_512, BLAKE2b, BLAKE2s, SHA3_256, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Hash::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+pure virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implemented in SHA3_512, BLAKE2b, BLAKE2s, SHA3_256, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Hash::formatHMACKey (void * block,
const void * key,
size_t len,
uint8_t pad 
)
+
+protected
+
+ +

Formats a HMAC key into a block.

+
Parameters
+ + + + + +
blockThe block to format the key into. Must be at least blockSize() bytes in length.
keyPoints to the HMAC key for the hashing process.
lenLength of the HMAC key in bytes.
padInner (0x36) or outer (0x5C) padding value to XOR with the formatted HMAC key.
+
+
+

This function is intended to help subclasses implement resetHMAC() and finalizeHMAC() by directly formatting the HMAC key into the subclass's internal block buffer and resetting the hash.

+ +

Definition at line 162 of file Hash.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t Hash::hashSize () const
+
+pure virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implemented in SHA3_512, SHA3_256, BLAKE2b, BLAKE2s, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void Hash::reset ()
+
+pure virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implemented in SHA3_512, SHA3_256, BLAKE2b, BLAKE2s, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Hash::resetHMAC (const void * key,
size_t keyLen 
)
+
+pure virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implemented in SHA3_512, BLAKE2b, BLAKE2s, SHA3_256, SHA1, SHA256, and SHA512.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Hash::update (const void * data,
size_t len 
)
+
+pure virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implemented in SHA3_512, BLAKE2b, BLAKE2s, SHA3_256, SHA1, SHA256, and SHA512.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classHash.png b/html/classHash.png new file mode 100644 index 00000000..9324f7da Binary files /dev/null and b/html/classHash.png differ diff --git a/html/classI2CMaster-members.html b/html/classI2CMaster-members.html new file mode 100644 index 00000000..f9ffa15a --- /dev/null +++ b/html/classI2CMaster-members.html @@ -0,0 +1,108 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
I2CMaster Member List
+
+
+ +

This is the complete list of members for I2CMaster, including all inherited members.

+ + + + + + + + +
available()=0I2CMasterpure virtual
endWrite()=0I2CMasterpure virtual
maxTransferSize() const =0I2CMasterpure virtual
read()=0I2CMasterpure virtual
startRead(unsigned int address, unsigned int count)=0I2CMasterpure virtual
startWrite(unsigned int address)I2CMastervirtual
write(uint8_t value)=0I2CMasterpure virtual
+ + + + diff --git a/html/classI2CMaster.html b/html/classI2CMaster.html new file mode 100644 index 00000000..07523ad8 --- /dev/null +++ b/html/classI2CMaster.html @@ -0,0 +1,336 @@ + + + + + + +ArduinoLibs: I2CMaster Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
I2CMaster Class Referenceabstract
+
+
+ +

Abstract base class for I2C master implementations. + More...

+ +

#include <I2CMaster.h>

+
+Inheritance diagram for I2CMaster:
+
+
+ + +SoftI2C + +
+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual unsigned int maxTransferSize () const =0
 Returns the maximum number of bytes that can be read or written in a single request by this bus master.
 
virtual void startWrite (unsigned int address)
 Starts a write operation by sending a start condition and the I2C control byte. More...
 
virtual void write (uint8_t value)=0
 Writes a single byte value on the I2C bus. More...
 
virtual bool endWrite ()=0
 Ends the current write operation. More...
 
virtual bool startRead (unsigned int address, unsigned int count)=0
 Starts a read operation for count bytes by sending the start condition and the I2C control byte. More...
 
virtual unsigned int available ()=0
 Returns the number of bytes that are still available for reading. More...
 
virtual uint8_t read ()=0
 Reads a single byte from the I2C bus. More...
 
+

Detailed Description

+

Abstract base class for I2C master implementations.

+
See Also
SoftI2C
+ +

Definition at line 28 of file I2CMaster.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
unsigned int I2CMaster::available ()
+
+pure virtual
+
+ +

Returns the number of bytes that are still available for reading.

+
See Also
startRead(), read()
+ +

Implemented in SoftI2C.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool I2CMaster::endWrite ()
+
+pure virtual
+
+ +

Ends the current write operation.

+

Returns true if the write operation was acknowledged; false otherwise.

+
See Also
startWrite(), write()
+ +

Implemented in SoftI2C.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
uint8_t I2CMaster::read ()
+
+pure virtual
+
+ +

Reads a single byte from the I2C bus.

+
See Also
startRead(), available()
+ +

Implemented in SoftI2C.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool I2CMaster::startRead (unsigned int address,
unsigned int count 
)
+
+pure virtual
+
+ +

Starts a read operation for count bytes by sending the start condition and the I2C control byte.

+

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

+

Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by count calls to read() to fetch the bytes.

+
See Also
available(), read(), startWrite()
+ +

Implemented in SoftI2C.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void I2CMaster::startWrite (unsigned int address)
+
+virtual
+
+ +

Starts a write operation by sending a start condition and the I2C control byte.

+

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

+
See Also
write(), endWrite(), startRead()
+ +

Reimplemented in SoftI2C.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void I2CMaster::write (uint8_t value)
+
+pure virtual
+
+ +

Writes a single byte value on the I2C bus.

+
See Also
startWrite(), endWrite()
+ +

Implemented in SoftI2C.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classI2CMaster.png b/html/classI2CMaster.png new file mode 100644 index 00000000..74b8b7cb Binary files /dev/null and b/html/classI2CMaster.png differ diff --git a/html/classIRreceiver-members.html b/html/classIRreceiver-members.html new file mode 100644 index 00000000..91e656dd --- /dev/null +++ b/html/classIRreceiver-members.html @@ -0,0 +1,108 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
IRreceiver Member List
+
+
+ +

This is the complete list of members for IRreceiver, including all inherited members.

+ + + + + + + + +
_IR_receive_interrupt (defined in IRreceiver)IRreceiverfriend
AUTO_REPEATIRreceiverstatic
command()IRreceiver
IRreceiver(int interruptNumber=0)IRreceiverexplicit
setSystemFilter(int system)IRreceiverinline
system() const IRreceiverinline
systemFilter() const IRreceiverinline
+ + + + diff --git a/html/classIRreceiver.html b/html/classIRreceiver.html new file mode 100644 index 00000000..b4af25b4 --- /dev/null +++ b/html/classIRreceiver.html @@ -0,0 +1,336 @@ + + + + + + +ArduinoLibs: IRreceiver Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Static Public Attributes | +Friends | +List of all members
+
+
IRreceiver Class Reference
+
+
+ +

Manages the reception of RC-5 commands from an infrared remote control. + More...

+ +

#include <IRreceiver.h>

+ + + + + + + + + + + + + + + + + +

+Public Member Functions

IRreceiver (int interruptNumber=0)
 Constructs a new infrared remote control receiver that is attached to interruptNumber.
 
int command ()
 Returns the next command from the remote control. More...
 
int system () const
 Returns the system number of the previous command(), indicating whether the command was for a TV, VCR, CD player, etc. More...
 
int systemFilter () const
 Returns the system to filter commands against, or -1 if no filter is set. More...
 
void setSystemFilter (int system)
 Sets the system to filter commands against, or -1 to turn off the system filter. More...
 
+ + + + +

+Static Public Attributes

+static const int AUTO_REPEAT = 128
 Flag that is added to the output of command() when the command is an auto-repeated button press rather than the original button press.
 
+ + + +

+Friends

+void _IR_receive_interrupt (void)
 
+

Detailed Description

+

Manages the reception of RC-5 commands from an infrared remote control.

+

IRreceiver recognizes commands in the Philips RC-5 protocol. This is a fairly common infrared protocol, supported by most universal remote controls. Program the universal remote to simulate a Philips TV, VCR, CD player, etc.

+

This class uses interrupts to process incoming bits from a standard 3-pin infrared receiver:

+
+irchip.jpg +
+

Typically, pin 1 of the receiver should be connected to the Arduino interrupt pin (e.g. D2), pin 2 should be connected to GND, and pin 3 should be connected to 5V. Consult the datasheet for your receiver to be sure though; some receivers may have different pin assignments.

+

The receiver is initialized by constructing an instance of the IRreceiver class:

+

By default, interrupt 0 on pin D2 is used. To change to another interrupt, pass its number to the constructor:

+
IRreceiver ir(1); // Interrupt 1 on pin D3
+

Currently this class can only handle a single instance of IRreceiver being active in the application. It isn't possible to have separate IRreceiver instances on different pins. Usually this won't be a problem because the same receiver can process inputs from multiple remotes.

+

The application retrieves incoming infrared commands by calling the command() function. The return value indicates the type of command:

+
void loop() {
+
switch (ir.command()) {
+
case RC5_0: case RC5_1: case RC5_2: case RC5_3: case RC5_4:
+
case RC5_5: case RC5_6: case RC5_7: case RC5_8: case RC5_9:
+
// Process a digit
+
...
+
break;
+
+
case RC5_ERASE:
+
// Backspace/erase last digit.
+
...
+
break;
+
+
case RC5_STANDBY:
+
// Power on/off button.
+
...
+
break;
+
}
+
}
+

If the command is an auto-repeat of a previous button press, then the AUTO_REPEAT flag will be set in the value returned from command(). The application can choose to ignore all auto-repeats, process all auto-repeats, or choose which button to auto-repeat based on its code:

+
void loop() {
+
switch (ir.command()) {
+
case RC5_INC_VOLUME:
+
case IRreceiver::AUTO_REPEAT | RC5_INC_VOLUME:
+
// Volume increase button pressed or held.
+
...
+
break;
+
+
case RC5_DEC_VOLUME:
+
case IRreceiver::AUTO_REPEAT | RC5_DEC_VOLUME:
+
// Volume decrease button pressed or held.
+
...
+
break;
+
+
case RC5_MUTE:
+
// Mute button (ignore auto-repeat).
+
...
+
break;
+
}
+
}
+

By default, command codes will be generated for every type of RC-5 remote control, be it a TV, VCR, CD player, or something else. The application can distinguish between the remote controls using system(); noting that command() must be called before system() for the system value to be valid. For example, the following code could be used in a two-player video game where the first player's remote is configured as a TV and the second player's remote is configured as a VCR:

+
void loop() {
+
int cmd = ir.command();
+
int sys = ir.system();
+
if (sys == RC5_SYS_TV)
+
player1(cmd);
+
else if (sys == RC5_SYS_VCR)
+
player2(cmd);
+
+
...
+
}
+

If the application only cares about a single system and wishes to ignore all other systems, it can configure a system filter at startup:

+
+
+
void setup() {
+
ir.setSystemFilter(RC5_SYS_VCR);
+
}
+

The complete list of RC-5 system numbers and command codes is given in the RC5.h header file.

+
See Also
DumpIR Example
+ +

Definition at line 29 of file IRreceiver.h.

+

Member Function Documentation

+ +
+
+ + + + + + + +
int IRreceiver::command ()
+
+ +

Returns the next command from the remote control.

+

Returns -1 if there is no new command, or the number between 0 and 127 corresponding to the command. If the command is an auto-repeat button press rather than an original button press, then the AUTO_REPEAT flag will be set.

+

The companion function system() will return the system number for the command indicating whether the command is for a TV, VCR, CD player, etc. By default, all systems are reported; use setSystemFilter() to filter out commands from all but a specific system.

+

The next call to command() will return -1 or the code for the next button press.

+

The header file RC5.h contains a list of command codes for common remote controls.

+
See Also
system(), setSystemFilter()
+ +

Definition at line 220 of file IRreceiver.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void IRreceiver::setSystemFilter (int system)
+
+inline
+
+ +

Sets the system to filter commands against, or -1 to turn off the system filter.

+

If system is -1, then all received systems are returned via command() and system() irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If system is set to anything other than -1, then only commands for that system are returned via command(). For example:

+
+
ir.setSystemFilter(RC5_SYS_VCR);
+
See Also
systemFilter(), system(), command()
+ +

Definition at line 40 of file IRreceiver.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IRreceiver::system () const
+
+inline
+
+ +

Returns the system number of the previous command(), indicating whether the command was for a TV, VCR, CD player, etc.

+

The return value from this function is valid only after a call to command(). The next call to command() will clear the system value, possibly to -1 if there is no new command.

+

The header file RC5.h contains a list of system numbers for common remote controls.

+
See Also
command(), setSystemFilter()
+ +

Definition at line 37 of file IRreceiver.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IRreceiver::systemFilter () const
+
+inline
+
+ +

Returns the system to filter commands against, or -1 if no filter is set.

+

If this value is -1, then all received systems are returned via command() and system() irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If this value is set to anything other than -1, then only commands for that system are returned via command().

+
See Also
setSystemFilter(), system(), command()
+ +

Definition at line 39 of file IRreceiver.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classIntField-members.html b/html/classIntField-members.html new file mode 100644 index 00000000..f8538a1e --- /dev/null +++ b/html/classIntField-members.html @@ -0,0 +1,126 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
IntField Member List
+
+
+ +

This is the complete list of members for IntField, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
dispatch(int event)IntFieldvirtual
enterField(bool reverse)IntFieldvirtual
exitField()Fieldvirtual
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
IntField(const String &label)IntFieldexplicit
IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)IntField
IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)IntField
isCurrent() const Field
label() const Fieldinline
lcd() const Fieldinlineprotected
maxValue() const IntFieldinline
minValue() const IntFieldinline
setLabel(const String &label)Field
setMaxValue(int value)IntFieldinline
setMinValue(int value)IntFieldinline
setStepValue(int value)IntFieldinline
setSuffix(const String &suffix)IntField
setValue(int value)IntField
stepValue() const IntFieldinline
suffix() const IntFieldinline
updateCursor()Fieldprotectedvirtual
value() const IntFieldinline
~Field()Field
+ + + + diff --git a/html/classIntField.html b/html/classIntField.html new file mode 100644 index 00000000..4873c695 --- /dev/null +++ b/html/classIntField.html @@ -0,0 +1,655 @@ + + + + + + +ArduinoLibs: IntField Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
IntField Class Reference
+
+
+ +

Field that manages the input of an integer value. + More...

+ +

#include <IntField.h>

+
+Inheritance diagram for IntField:
+
+
+ + +Field + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 IntField (const String &label)
 Constructs a new integer field with a specific label. More...
 
 IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
 Constructs a new integer field with a specific label, minValue, maxValue, stepValue, and value, and attaches it to a form. More...
 
IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
 Constructs a new integer field with a specific label, minValue, maxValue, stepValue, value, and suffix and attaches it to a form.
 
int dispatch (int event)
 Dispatches event via this field. More...
 
void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
int minValue () const
 Returns the minimum value for the input field. More...
 
void setMinValue (int value)
 Sets the minimum value for the input field. More...
 
int maxValue () const
 Returns the maximum value for the input field. More...
 
void setMaxValue (int value)
 Sets the maximum value for the input field. More...
 
int stepValue () const
 Returns the step value to use when increasing or decreasing the value() due to Up and Down button presses. More...
 
void setStepValue (int value)
 Sets the step value value to use when increasing or decreasing the value() due to Up and Down button presses. More...
 
int value () const
 Returns the current value of this field. More...
 
void setValue (int value)
 Sets the current value of this field. More...
 
const String & suffix () const
 Returns the suffix string to be displayed after the field's value. More...
 
void setSuffix (const String &suffix)
 Sets the suffix string to be displayed after the field's value. More...
 
- Public Member Functions inherited from Field
 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
virtual void exitField ()
 Exits the field due to form navigation. More...
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Field
+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+

Detailed Description

+

Field that manages the input of an integer value.

+

IntField is intended for field values that are modifiable by the user. Pressing Up adds stepValue() to the current value and pressing Down subtracts stepValue() from the current value. The value is clamped to the range minValue() to maxValue().

+

The following example creates an integer field with the label "Iterations", that ranges between 1 and 5, with a stepValue() of 1, and an initial default value() of 2:

+
Form mainForm(lcd);
+
IntField iterField(mainForm, "Iterations", 1, 5, 1, 2);
+

IntField can be configured to show a suffix() on the screen after the integer value(). This is intended for communicating the units in which the value is expressed. For example:

+
IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
+
IntField speedField(mainForm, "Speed", 0, 2000, 15, 450, " rpm");
+
+FormInt.png +
+

Use TextField for read-only fields that report integer values but which are not modifiable by the user.

+
See Also
Field, TextField
+ +

Definition at line 28 of file IntField.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
IntField::IntField (const String & label)
+
+explicit
+
+ +

Constructs a new integer field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+

Initially, value() is 0, minValue() is 0, maxValue() is 100, stepValue() is 1, and suffix() is an empty string.

+
See Also
Form::addField()
+ +

Definition at line 71 of file IntField.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IntField::IntField (Formform,
const String & label,
int minValue,
int maxValue,
int stepValue,
int value 
)
+
+ +

Constructs a new integer field with a specific label, minValue, maxValue, stepValue, and value, and attaches it to a form.

+

The suffix() is initially set to an empty string.

+ +

Definition at line 88 of file IntField.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
int IntField::dispatch (int event)
+
+virtual
+
+ +

Dispatches event via this field.

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

+

Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

+
See Also
Form::dispatch(), LCD::getButton()
+ +

Reimplemented from Field.

+ +

Definition at line 114 of file IntField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void IntField::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented from Field.

+ +

Definition at line 126 of file IntField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IntField::maxValue () const
+
+inline
+
+ +

Returns the maximum value for the input field.

+
See Also
setMaxValue(), minValue(), stepValue(), value()
+ +

Definition at line 41 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IntField::minValue () const
+
+inline
+
+ +

Returns the minimum value for the input field.

+
See Also
setMinValue(), maxValue(), stepValue(), value()
+ +

Definition at line 38 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void IntField::setMaxValue (int value)
+
+inline
+
+ +

Sets the maximum value for the input field.

+

The new maximum value will be used to clamp the field's value the next time setValue() is called.

+
See Also
maxValue(), setMinValue(), setStepValue(), setValue()
+ +

Definition at line 42 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void IntField::setMinValue (int value)
+
+inline
+
+ +

Sets the minimum value for the input field.

+

The new minimum value will be used to clamp the field's value the next time setValue() is called.

+
See Also
minValue(), setMaxValue(), setStepValue(), setValue()
+ +

Definition at line 39 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void IntField::setStepValue (int value)
+
+inline
+
+ +

Sets the step value value to use when increasing or decreasing the value() due to Up and Down button presses.

+
See Also
stepValue(), setMinValue(), setMaxValue(), setValue()
+ +

Definition at line 45 of file IntField.h.

+ +
+
+ +
+
+ + + + + + + + +
void IntField::setSuffix (const String & suffix)
+
+ +

Sets the suffix string to be displayed after the field's value.

+

Suffixes are typically used to indicate the units that the value() is expressed in. For example:

+
field.setSuffix("%");
+
field.setSuffix(" rpm");
+
See Also
suffix()
+ +

Definition at line 231 of file IntField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void IntField::setValue (int value)
+
+ +

Sets the current value of this field.

+

The value will be clamped to the range defined by minValue() and maxValue().

+
See Also
value(), setMinValue(), setMaxValue(), setStepValue()
+ +

Definition at line 198 of file IntField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IntField::stepValue () const
+
+inline
+
+ +

Returns the step value to use when increasing or decreasing the value() due to Up and Down button presses.

+
See Also
setStepValue(), minValue(), maxValue(), value()
+ +

Definition at line 44 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
const String & IntField::suffix () const
+
+inline
+
+ +

Returns the suffix string to be displayed after the field's value.

+
See Also
setSuffix()
+ +

Definition at line 50 of file IntField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int IntField::value () const
+
+inline
+
+ +

Returns the current value of this field.

+
See Also
setValue(), minValue(), maxValue(), stepValue()
+ +

Definition at line 47 of file IntField.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classIntField.png b/html/classIntField.png new file mode 100644 index 00000000..1afe0741 Binary files /dev/null and b/html/classIntField.png differ diff --git a/html/classKeccakCore-members.html b/html/classKeccakCore-members.html new file mode 100644 index 00000000..8dfa69f0 --- /dev/null +++ b/html/classKeccakCore-members.html @@ -0,0 +1,116 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
KeccakCore Member List
+
+
+ +

This is the complete list of members for KeccakCore, including all inherited members.

+ + + + + + + + + + + + + + + + +
A (defined in KeccakCore)KeccakCore
B (defined in KeccakCore)KeccakCore
blockSize() const KeccakCoreinline
capacity() const KeccakCore
clear()KeccakCore
extract(void *data, size_t size)KeccakCore
inputSize (defined in KeccakCore)KeccakCore
KeccakCore()KeccakCore
outputSize (defined in KeccakCore)KeccakCore
pad(uint8_t tag)KeccakCore
reset()KeccakCore
setCapacity(size_t capacity)KeccakCore
setHMACKey(const void *key, size_t len, uint8_t pad, size_t hashSize)KeccakCore
update(const void *data, size_t size)KeccakCore
~KeccakCore()KeccakCore
+ + + + diff --git a/html/classKeccakCore.html b/html/classKeccakCore.html new file mode 100644 index 00000000..9ddc03ec --- /dev/null +++ b/html/classKeccakCore.html @@ -0,0 +1,433 @@ + + + + + + +ArduinoLibs: KeccakCore Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
KeccakCore Class Reference
+
+
+ +

Keccak core sponge function. + More...

+ +

#include <KeccakCore.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 KeccakCore ()
 Constructs a new Keccak sponge function. More...
 
~KeccakCore ()
 Destroys this Keccak sponge function after clearing all sensitive information.
 
size_t capacity () const
 Returns the capacity of the sponge function in bits. More...
 
void setCapacity (size_t capacity)
 Sets the capacity of the Keccak sponge function in bits. More...
 
size_t blockSize () const
 Returns the input block size for the sponge function in bytes. More...
 
void reset ()
 Resets the Keccak sponge function ready for a new session. More...
 
void update (const void *data, size_t size)
 Updates the Keccak sponge function with more input data. More...
 
void pad (uint8_t tag)
 Pads the last block of input data to blockSize(). More...
 
void extract (void *data, size_t size)
 Extracts data from the Keccak sponge function. More...
 
+void clear ()
 Clears all sensitive data from this object.
 
void setHMACKey (const void *key, size_t len, uint8_t pad, size_t hashSize)
 Sets a HMAC key for a Keccak-based hash algorithm. More...
 
+

Detailed Description

+

Keccak core sponge function.

+

KeccakCore provides the core sponge function for different capacities. It is used to implement Hash algorithms such as SHA3.

+

References: http://en.wikipedia.org/wiki/SHA-3

+
See Also
SHA3
+ +

Definition at line 29 of file KeccakCore.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
KeccakCore::KeccakCore ()
+
+ +

Constructs a new Keccak sponge function.

+

The capacity() will initially be set to 1536, which normally won't be of much use to the caller. The constructor should be followed by a call to setCapacity() to select the capacity of interest.

+ +

Definition at line 49 of file KeccakCore.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t KeccakCore::blockSize () const
+
+inline
+
+ +

Returns the input block size for the sponge function in bytes.

+

The block size is (1600 - capacity()) / 8.

+
See Also
capacity()
+ +

Definition at line 38 of file KeccakCore.h.

+ +
+
+ +
+
+ + + + + + + +
size_t KeccakCore::capacity () const
+
+ +

Returns the capacity of the sponge function in bits.

+
See Also
setCapacity(), blockSize()
+ +

Definition at line 71 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void KeccakCore::extract (void * data,
size_t size 
)
+
+ +

Extracts data from the Keccak sponge function.

+
Parameters
+ + + +
dataThe data buffer to fill with extracted data.
sizeThe number number of bytes of extracted data that are required.
+
+
+

If more than blockSize() bytes are required, the sponge function will be invoked to generate additional data.

+
See Also
update(), reset(), extractHash()
+ +

Definition at line 201 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void KeccakCore::pad (uint8_t tag)
+
+ +

Pads the last block of input data to blockSize().

+
Parameters
+ + +
tagThe tag byte to add to the padding to identify SHA3 (0x06), SHAKE (0x1F), or the plain pre-standardized version of Keccak (0x01).
+
+
+

The sponge function will be invoked to process the completed padding block.

+
See Also
update(), extract()
+ +

Definition at line 174 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + +
void KeccakCore::reset ()
+
+ +

Resets the Keccak sponge function ready for a new session.

+
See Also
update(), extract()
+ +

Definition at line 109 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void KeccakCore::setCapacity (size_t capacity)
+
+ +

Sets the capacity of the Keccak sponge function in bits.

+
Parameters
+ + +
capacityThe capacity of the Keccak sponge function in bits which should be a multiple of 64 and between 64 and 1536.
+
+
+
Note
It is possible to create a sponge function with this constructor that doesn't strictly conform with the capacity and hash size constraints defined in the relevant standards. It is the responsibility of callers to only use standard parameter combinations.
+
See Also
capacity(), blockSize()
+ +

Definition at line 89 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void KeccakCore::setHMACKey (const void * key,
size_t len,
uint8_t pad,
size_t hashSize 
)
+
+ +

Sets a HMAC key for a Keccak-based hash algorithm.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process.
lenLength of the HMAC key in bytes.
padInner (0x36) or outer (0x5C) padding value to XOR with the formatted HMAC key.
hashSizeThe size of the output from the hash algorithm.
+
+
+

This function is intended to help classes implement Hash::resetHMAC() and Hash::finalizeHMAC() by directly formatting the HMAC key into the internal block buffer and resetting the hash.

+ +

Definition at line 263 of file KeccakCore.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void KeccakCore::update (const void * data,
size_t size 
)
+
+ +

Updates the Keccak sponge function with more input data.

+
Parameters
+ + + +
dataThe extra input data to incorporate.
sizeThe size of the new data to incorporate.
+
+
+

This function will invoke the sponge function whenever a full blockSize() bytes of input data have been accumulated. Call pad() after the last block to finalize the input before calling extract().

+
See Also
pad(), extract(), reset()
+ +

Definition at line 128 of file KeccakCore.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classLCD-members.html b/html/classLCD-members.html new file mode 100644 index 00000000..904d1010 --- /dev/null +++ b/html/classLCD-members.html @@ -0,0 +1,118 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
LCD Member List
+
+
+ +

This is the complete list of members for LCD, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
BacklightOff enum valueLCD
BacklightOnSelect enum valueLCD
backlightPin() const LCDinline
disableScreenSaver()LCD
display()LCD
DisplayOff enum valueLCD
enableScreenSaver(int timeoutSecs=10)LCD
getButton()LCD
isScreenSaved() const LCDinline
LCD()LCDinline
LCD(uint8_t pin9)LCDinline
LCD(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)LCDinline
noDisplay()LCD
ScreenSaverMode enum nameLCD
screenSaverMode() const LCDinline
setBacklightPin(uint8_t pin)LCD
setScreenSaverMode(ScreenSaverMode mode)LCD
+ + + + diff --git a/html/classLCD.html b/html/classLCD.html new file mode 100644 index 00000000..d69ac219 --- /dev/null +++ b/html/classLCD.html @@ -0,0 +1,600 @@ + + + + + + +ArduinoLibs: LCD Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Types | +Public Member Functions | +List of all members
+
+
LCD Class Reference
+
+
+ +

Enhanced library for Freetronics 16x2 LCD shields. + More...

+ +

#include <LCD.h>

+
+Inheritance diagram for LCD:
+
+
+ + + +
+ + + + + +

+Public Types

enum  ScreenSaverMode { DisplayOff, +BacklightOff, +BacklightOnSelect + }
 Screen saver mode that controls the display and back light. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 LCD ()
 Initialize the Freetronics LCD display with the default pin assignment. More...
 
 LCD (uint8_t pin9)
 Initialize the Freetronics LCD display for USBDroid. More...
 
 LCD (uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
 Initialize the Freetronics LCD display with custom pins. More...
 
uint8_t backlightPin () const
 Returns the pin that is being used to control the back light. The default is 3. More...
 
void setBacklightPin (uint8_t pin)
 Sets the back light pin for the LCD shield. More...
 
void display ()
 Turns on the display of text on the LCD and the back light. More...
 
void noDisplay ()
 Turns off the display of text on the LCD and the back light. More...
 
ScreenSaverMode screenSaverMode () const
 Returns the current screen saver mode; default is DisplayOff. More...
 
void setScreenSaverMode (ScreenSaverMode mode)
 Sets the current screen saver mode. More...
 
void enableScreenSaver (int timeoutSecs=10)
 Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons. More...
 
void disableScreenSaver ()
 Disables the screen saver. More...
 
bool isScreenSaved () const
 Returns true if the screen has been saved; false otherwise. More...
 
int getButton ()
 Gets the next button press, release, or idle event. More...
 
+

Detailed Description

+

Enhanced library for Freetronics 16x2 LCD shields.

+

This class extends the standard Arduino LiquidCrystal library with extra functionality for the Freetronics 16x2 LCD shield:

+

http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide

+

The Freetronics LCD has an additional back light, which is turned on and off with the display() and noDisplay() functions. The user can also call enableScreenSaver() to cause the display and back light to automatically turn off after a specific timeout. The setScreenSaverMode() function controls which of the display and back light are disabled when the screen saver activates.

+

The Freetronics LCD also has 5 push buttons for Left, Right, Up, Down, and Select, to assist with the creation of interactive sketches. The user can call getButton() to get the current button state. One of the following values may be returned:

+ +

For convenience, all RELEASED button codes are the negation of their pressed counterparts. That is, LCD_BUTTON_LEFT_RELEASED == -LCD_BUTTON_LEFT. LCD_BUTTON_NONE is defined to be zero. Thus, you can check if a generic button has been pressed with button > 0 and if a generic button has been released with button < 0.

+

+Support for DFRobot LCD Shield

+

The DFRobot LCD Shield is almost identical to the Freetronics shield, except it uses pin 10 for the back light instead of pin 3. This can be specified in the application's setup() function:

+
LCD lcd;
+
+
void setup() {
+
lcd.setBacklightPin(10);
+
}
+

The back light pin is configured for output the first time the application calls getButton().

+
See Also
Form, Hello World Example
+ +

Definition at line 48 of file LCD.h.

+

Member Enumeration Documentation

+ +
+
+ + + + +
enum LCD::ScreenSaverMode
+
+ +

Screen saver mode that controls the display and back light.

+ + + + +
Enumerator
DisplayOff  +

Turn off both the display and the backlight when the screen saver is activated.

+
BacklightOff  +

Turn off the back light but leave the display on when the screen saver is activated.

+
BacklightOnSelect  +

Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons have no effect.

+
+ +

Definition at line 62 of file LCD.h.

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
LCD::LCD ()
+
+inline
+
+ +

Initialize the Freetronics LCD display with the default pin assignment.

+

The following example shows how to initialize the Freetronics LCD shield:

+
LCD lcd;
+
+

Definition at line 50 of file LCD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
LCD::LCD (uint8_t pin9)
+
+inline
+
+ +

Initialize the Freetronics LCD display for USBDroid.

+

On the USBDroid, the D9 pin is used for USB Host functionality. Either the USB Host's use of D9 must be reassigned to another pin, or the Freetronics LCD shield must be modified. The following Web page describes the modifications that are necessary: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid

+

If you choose to modify the LCD shield, then you must use this version of the constructor to initialize the shield, passing the alternative pin as the pin9 parameter. Using the recommended pin from the above Web page of A1, you would initialize the LCD as follows:

+
LCD lcd(A1);
+
+

Definition at line 51 of file LCD.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LCD::LCD (uint8_t rs,
uint8_t enable,
uint8_t d0,
uint8_t d1,
uint8_t d2,
uint8_t d3 
)
+
+inline
+
+ +

Initialize the Freetronics LCD display with custom pins.

+

For compatibility with other shields, it may be desirable to rewire some of the pins entirely. This version of the constructor allows any pins to be reassigned from the defaults (which are rs = 8, enable = 9, d0 = 4, d1 = 5, d2 = 6, d3 = 7.)

+
LCD lcd(8,9,4,5,10,11);
+
+

Definition at line 52 of file LCD.h.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
uint8_t LCD::backlightPin () const
+
+inline
+
+ +

Returns the pin that is being used to control the back light. The default is 3.

+
See Also
setBacklightPin()
+ +

Definition at line 56 of file LCD.h.

+ +
+
+ +
+
+ + + + + + + +
void LCD::disableScreenSaver ()
+
+ +

Disables the screen saver.

+
See Also
enableScreenSaver(), display(), isScreenSaved()
+ +

Definition at line 323 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + + + +
void LCD::display ()
+
+ +

Turns on the display of text on the LCD and the back light.

+

If the screen saver is active, then calling this function will deactivate the screen saver and reset the timeout. Thus, this function can be called for force the screen to restore.

+
See Also
noDisplay(), enableScreenSaver(), setScreenSaverMode()
+ +

Definition at line 221 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void LCD::enableScreenSaver (int timeoutSecs = 10)
+
+ +

Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons.

+

If timeoutSecs is less than or equal to zero, then the call is equivalent to calling disableScreenSaver().

+

For the screen saver to work, the application must regularly call getButton() to fetch the LCD's button state even if no buttons are pressed.

+

If the timeoutSecs parameter is not supplied, the default is 10 seconds.

+
See Also
disableScreenSaver(), display(), getButton(), isScreenSaved()
+ +

Definition at line 309 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + + + +
int LCD::getButton ()
+
+ +

Gets the next button press, release, or idle event.

+

If no buttons are pressed, this function will return LCD_BUTTON_NONE.

+

When a button is pressed, this function will return one of LCD_BUTTON_LEFT, LCD_BUTTON_RIGHT, LCD_BUTTON_UP, LCD_BUTTON_DOWN, or LCD_BUTTON_SELECT. While the button is pressed, this function will return LCD_BUTTON_NONE until the button is released. When the button is released, this function will return one of LCD_BUTTON_LEFT_RELEASED, LCD_BUTTON_RIGHT_RELEASED, LCD_BUTTON_UP_RELEAED, LCD_BUTTON_DOWN_RELEASED, or LCD_BUTTON_SELECT_RELEASED.

+

If the screen saver is currently active, then it will be deactivated by this function whenever a button is pressed. If screenSaverMode() is DisplayOff, the function will "eat" the button press and return LCD_BUTTON_NONE. The scrren saver can also be deactivated under program control by calling display().

+

This function debounces the button state automatically so there is no need for the caller to worry about spurious button events.

+
See Also
enableScreenSaver(), display(), Form::dispatch()
+ +

Definition at line 368 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool LCD::isScreenSaved () const
+
+inline
+
+ +

Returns true if the screen has been saved; false otherwise.

+
See Also
enableScreenSaver()
+ +

Definition at line 74 of file LCD.h.

+ +
+
+ +
+
+ + + + + + + +
void LCD::noDisplay ()
+
+ +

Turns off the display of text on the LCD and the back light.

+

This function can be called to force the screen saver to activate.

+
See Also
display(), enableScreenSaver(), setScreenSaverMode()
+ +

Definition at line 238 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
ScreenSaverMode LCD::screenSaverMode () const
+
+inline
+
+ +

Returns the current screen saver mode; default is DisplayOff.

+
See Also
setScreenSaverMode(), enableScreenSaver()
+ +

Definition at line 69 of file LCD.h.

+ +
+
+ +
+
+ + + + + + + + +
void LCD::setBacklightPin (uint8_t pin)
+
+ +

Sets the back light pin for the LCD shield.

+

The DFRobot LCD Shield uses pin 10 for the back light instead of pin 3:

+
LCD lcd;
+
+
void setup() {
+
lcd.setBacklightPin(10);
+
}
+

The back light pin is configured for output the next time the application calls getButton().

+
See Also
backlightPin()
+ +

Definition at line 197 of file LCD.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void LCD::setScreenSaverMode (ScreenSaverMode mode)
+
+ +

Sets the current screen saver mode.

+
See Also
screenSaverMode(), enableScreenSaver()
+ +

Definition at line 283 of file LCD.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classLCD.png b/html/classLCD.png new file mode 100644 index 00000000..b3dc8d1f Binary files /dev/null and b/html/classLCD.png differ diff --git a/html/classListField-members.html b/html/classListField-members.html new file mode 100644 index 00000000..ee3dd34d --- /dev/null +++ b/html/classListField-members.html @@ -0,0 +1,119 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
ListField Member List
+
+
+ +

This is the complete list of members for ListField, including all inherited members.

+ + + + + + + + + + + + + + + + + + + +
dispatch(int event)ListFieldvirtual
enterField(bool reverse)ListFieldvirtual
exitField()Fieldvirtual
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
isCurrent() const Field
items() const ListFieldinline
label() const Fieldinline
lcd() const Fieldinlineprotected
ListField(const String &label)ListFieldexplicit
ListField(Form &form, const String &label, ListItems items, int value=0)ListField
setItems(ListItems items)ListField
setLabel(const String &label)Field
setValue(int value)ListField
updateCursor()Fieldprotectedvirtual
value() const ListFieldinline
~Field()Field
+ + + + diff --git a/html/classListField.html b/html/classListField.html new file mode 100644 index 00000000..c6c8e59b --- /dev/null +++ b/html/classListField.html @@ -0,0 +1,419 @@ + + + + + + +ArduinoLibs: ListField Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
ListField Class Reference
+
+
+ +

Field that manages selection from a static list of items. + More...

+ +

#include <ListField.h>

+
+Inheritance diagram for ListField:
+
+
+ + +Field + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ListField (const String &label)
 Constructs a new list field with a specific label. More...
 
ListField (Form &form, const String &label, ListItems items, int value=0)
 Constructs a new list field with a specific label, list of items, and value, and attaches it to a form.
 
int dispatch (int event)
 Dispatches event via this field. More...
 
void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
ListItems items () const
 Returns the array of items in this list. More...
 
void setItems (ListItems items)
 Sets the array of items for this list. More...
 
int value () const
 Returns the value of this list; i.e. the index within items() of the selected item. More...
 
void setValue (int value)
 Sets the value of this list; i.e. the index within items() of the selected item. More...
 
- Public Member Functions inherited from Field
 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
virtual void exitField ()
 Exits the field due to form navigation. More...
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Field
+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+

Detailed Description

+

Field that manages selection from a static list of items.

+

ListField is intended for selecting an element from a list of items. Each items is represented by a string within program memory, with the list terminated by null. For example:

+
const char item_Eggs[] PROGMEM = "Eggs";
+
const char item_Cheese[] PROGMEM = "Cheese";
+
const char item_Pumpkin[] PROGMEM = "Pumpkin";
+
ListItem const ingredients[] PROGMEM = {
+
item_Eggs,
+
item_Cheese,
+
item_Pumpkin,
+
0
+
};
+
+
Form mainForm(lcd);
+
ListField ingredient(mainForm, "Select ingredient", ingredients);
+

If there are only two items in the list, then BoolField can be used instead.

+
See Also
Field, BoolField
+ +

Definition at line 32 of file ListField.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
ListField::ListField (const String & label)
+
+explicit
+
+ +

Constructs a new list field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+

Initially, items() is null and value() is -1.

+
See Also
Form::addField()
+ +

Definition at line 64 of file ListField.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
int ListField::dispatch (int event)
+
+virtual
+
+ +

Dispatches event via this field.

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

+

Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

+
See Also
Form::dispatch(), LCD::getButton()
+ +

Reimplemented from Field.

+ +

Definition at line 87 of file ListField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void ListField::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented from Field.

+ +

Definition at line 105 of file ListField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
ListItems ListField::items () const
+
+inline
+
+ +

Returns the array of items in this list.

+
See Also
setItems()
+ +

Definition at line 41 of file ListField.h.

+ +
+
+ +
+
+ + + + + + + + +
void ListField::setItems (ListItems items)
+
+ +

Sets the array of items for this list.

+

The items must be stored within program memory and terminated by null; for example:

+
const char item_Eggs[] PROGMEM = "Eggs";
+
const char item_Cheese[] PROGMEM = "Cheese";
+
const char item_Pumpkin[] PROGMEM = "Pumpkin";
+
ListItem const ingredients[] PROGMEM = {
+
item_Eggs,
+
item_Cheese,
+
item_Pumpkin,
+
0
+
};
+
+
list.setItems(ingredients);
+
See Also
items()
+ +

Definition at line 141 of file ListField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void ListField::setValue (int value)
+
+ +

Sets the value of this list; i.e. the index within items() of the selected item.

+

The value will be clamped to the range of items().

+
See Also
value(), items()
+ +

Definition at line 178 of file ListField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int ListField::value () const
+
+inline
+
+ +

Returns the value of this list; i.e. the index within items() of the selected item.

+

Returns -1 if the items() array is empty or null.

+
See Also
setValue(), items()
+ +

Definition at line 44 of file ListField.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classListField.png b/html/classListField.png new file mode 100644 index 00000000..c2b62b4f Binary files /dev/null and b/html/classListField.png differ diff --git a/html/classMelody-members.html b/html/classMelody-members.html new file mode 100644 index 00000000..1d167d55 --- /dev/null +++ b/html/classMelody-members.html @@ -0,0 +1,111 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Melody Member List
+
+
+ +

This is the complete list of members for Melody, including all inherited members.

+ + + + + + + + + + + +
isPlaying() const Melodyinline
loopCount() const Melodyinline
Melody(uint8_t pin)Melody
play()Melody
playOnce()Melody
run()Melody
setLoopCount(int count)Melodyinline
setLoopDuration(unsigned long ms)Melody
setMelody(const int *notes, const uint8_t *lengths, unsigned int size)Melody
stop()Melody
+ + + + diff --git a/html/classMelody.html b/html/classMelody.html new file mode 100644 index 00000000..88820fdc --- /dev/null +++ b/html/classMelody.html @@ -0,0 +1,379 @@ + + + + + + +ArduinoLibs: Melody Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
Melody Class Reference
+
+
+ +

Plays a melody on a digital output pin using tone(). + More...

+ +

#include <Melody.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Melody (uint8_t pin)
 Constructs a new melody playing object for pin.
 
+bool isPlaying () const
 Returns true if the melody is currently playing; false if not.
 
int loopCount () const
 Returns the number of times the melody should loop before stopping. More...
 
void setLoopCount (int count)
 Sets the number of times the melody should loop to count. More...
 
void setLoopDuration (unsigned long ms)
 Sets the maximum number of loops to last no longer than ms milliseconds. More...
 
void play ()
 Starts playing the melody, or restarts it if already playing. More...
 
void playOnce ()
 Plays the melody once and then stops. More...
 
void stop ()
 Stops playing the melody. More...
 
void setMelody (const int *notes, const uint8_t *lengths, unsigned int size)
 Sets the melody to the size elements of notes and lengths. More...
 
void run ()
 Runs the melody control loop. More...
 
+

Detailed Description

+

Plays a melody on a digital output pin using tone().

+

The following example plays a simple tone three times on digital pin 8:

+
#include <Melody.h>
+
+
int notes[] = {
+
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3,
+
NOTE_REST, NOTE_B3, NOTE_C4, NOTE_REST
+
};
+
byte lengths[] = {4, 8, 8, 4, 4, 4, 4, 4, 2};
+
+
Melody melody(8);
+
+
void setup() {
+
melody.setMelody(notes, lengths, sizeof(lengths));
+
melody.setLoopCount(3);
+
melody.play();
+
}
+
+
void loop() {
+
melody.run();
+
}
+

The notes array contains the frequency of the notes to be played, with the special value NOTE_REST indicating a rest where no notes are playing. The lengths array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.

+

The run() method must be called from the application's main loop() method to ensure that the melody advances from one note to the next. It will not block the application while notes are playing.

+

The number of loops can also be specified with setLoopDuration() which sets a maximum amount of time that the melody will play before stopping. The following example plays the melody for no more than 60 seconds:

+
void setup() {
+
melody.setMelody(notes, lengths, sizeof(lengths));
+
melody.setLoopDuration(60000UL);
+
melody.play();
+
}
+
+

Definition at line 122 of file Melody.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
int Melody::loopCount () const
+
+inline
+
+ +

Returns the number of times the melody should loop before stopping.

+

The default value is zero, indicating that the melody will loop indefinitely.

+
See Also
setLoopCount(), setLoopDuration(), play()
+ +

Definition at line 128 of file Melody.h.

+ +
+
+ +
+
+ + + + + + + +
void Melody::play ()
+
+ +

Starts playing the melody, or restarts it if already playing.

+
See Also
playOnce(), setMelody(), stop(), loopCount()
+ +

Definition at line 146 of file Melody.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Melody::playOnce ()
+
+ +

Plays the melody once and then stops.

+
See Also
play(), stop()
+ +

Definition at line 162 of file Melody.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Melody::run ()
+
+ +

Runs the melody control loop.

+

This function must be called by the application's main loop() function to cause the melody to advance from note to note. It will not block the application while notes are playing.

+ +

Definition at line 214 of file Melody.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void Melody::setLoopCount (int count)
+
+inline
+
+ +

Sets the number of times the melody should loop to count.

+

If count is zero, then the melody will loop indefinitely.

+
See Also
loopCount(), setLoopDuration()
+ +

Definition at line 129 of file Melody.h.

+ +
+
+ +
+
+ + + + + + + + +
void Melody::setLoopDuration (unsigned long ms)
+
+ +

Sets the maximum number of loops to last no longer than ms milliseconds.

+

This function must be called after the melody is specified with setMelody() as it uses the length of the melody and ms to determine the loopCount().

+
See Also
loopCount(), setLoopCount()
+ +

Definition at line 131 of file Melody.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Melody::setMelody (const int * notes,
const uint8_t * lengths,
unsigned int size 
)
+
+ +

Sets the melody to the size elements of notes and lengths.

+

If a melody is currently playing, then this function will stop playback.

+

The notes array contains the frequency of the notes to be played, with the special value NOTE_REST indicating a rest where no notes are playing. The lengths array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.

+
See Also
play()
+ +

Definition at line 199 of file Melody.cpp.

+ +
+
+ +
+
+ + + + + + + +
void Melody::stop ()
+
+ +

Stops playing the melody.

+
See Also
play()
+ +

Definition at line 178 of file Melody.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classNoiseSource-members.html b/html/classNoiseSource-members.html new file mode 100644 index 00000000..e288f1e0 --- /dev/null +++ b/html/classNoiseSource-members.html @@ -0,0 +1,106 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
NoiseSource Member List
+
+
+ +

This is the complete list of members for NoiseSource, including all inherited members.

+ + + + + + +
calibrating() const =0NoiseSourcepure virtual
NoiseSource()NoiseSource
output(const uint8_t *data, size_t len, unsigned int credit)NoiseSourceprotectedvirtual
stir()=0NoiseSourcepure virtual
~NoiseSource()NoiseSourcevirtual
+ + + + diff --git a/html/classNoiseSource.html b/html/classNoiseSource.html new file mode 100644 index 00000000..ab6006d8 --- /dev/null +++ b/html/classNoiseSource.html @@ -0,0 +1,266 @@ + + + + + + +ArduinoLibs: NoiseSource Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
NoiseSource Class Referenceabstract
+
+
+ +

Abstract base class for random noise sources. + More...

+ +

#include <NoiseSource.h>

+
+Inheritance diagram for NoiseSource:
+
+
+ + +RingOscillatorNoiseSource +TransistorNoiseSource + +
+ + + + + + + + + + + + + + +

+Public Member Functions

NoiseSource ()
 Constructs a new random noise source.
 
+virtual ~NoiseSource ()
 Destroys this random noise source.
 
virtual bool calibrating () const =0
 Determine if the noise source is still calibrating itself. More...
 
virtual void stir ()=0
 Stirs entropy from this noise source into the global random number pool. More...
 
+ + + + +

+Protected Member Functions

virtual void output (const uint8_t *data, size_t len, unsigned int credit)
 Called from subclasses to output noise to the global random number pool. More...
 
+

Detailed Description

+

Abstract base class for random noise sources.

+
See Also
RNG, TransistorNoiseSource
+ +

Definition at line 29 of file NoiseSource.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool NoiseSource::calibrating () const
+
+pure virtual
+
+ +

Determine if the noise source is still calibrating itself.

+
Returns
Returns true if calibration is in progress; false if the noise source is generating valid random data.
+

Noise sources that require calibration start doing so at system startup and then switch over to random data generation once calibration is complete. Since no random data is being generated during calibration, the output from RNG.rand() may be predictable. Use RNG.available() to determine when sufficient entropy is available to generate good random values.

+

It is possible that the noise source never exits calibration. This can happen if the input voltage is insufficient to trigger noise or if the noise source is not connected. Noise sources may also periodically recalibrate themselves.

+
See Also
stir()
+ +

Implemented in RingOscillatorNoiseSource, and TransistorNoiseSource.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void NoiseSource::output (const uint8_t * data,
size_t len,
unsigned int credit 
)
+
+protectedvirtual
+
+ +

Called from subclasses to output noise to the global random number pool.

+
Parameters
+ + + + +
dataPoints to the noise data.
lenNumber of bytes of noise data.
creditThe number of bits of entropy to credit for the data. Note that this is bits, not bytes.
+
+
+

The default implementation of this function calls RNG.stir() to add the entropy from this noise source to the global random number pool.

+

This function may be overridden by subclasses to capture the raw output from the noise source before it is mixed into the pool to allow the raw data to be analyzed for randomness.

+ +

Definition at line 102 of file NoiseSource.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void NoiseSource::stir ()
+
+pure virtual
+
+ +

Stirs entropy from this noise source into the global random number pool.

+

This function should call output() to add the entropy from this noise source to the global random number pool.

+

The noise source should batch up the entropy data, providing between 16 and 48 bytes of data each time. If the noise source does not have sufficient entropy data at the moment, it should return without stiring the current data in.

+
See Also
calibrating(), output()
+ +

Implemented in RingOscillatorNoiseSource, and TransistorNoiseSource.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classNoiseSource.png b/html/classNoiseSource.png new file mode 100644 index 00000000..ece76a1f Binary files /dev/null and b/html/classNoiseSource.png differ diff --git a/html/classOFB-members.html b/html/classOFB-members.html new file mode 100644 index 00000000..ded87fd1 --- /dev/null +++ b/html/classOFB-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
OFB< T > Member List
+
+
+ +

This is the complete list of members for OFB< T >, including all inherited members.

+ + + + + + + + + + + + + + +
Cipher()Cipher
clear()OFBCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)OFBCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)OFBCommonvirtual
ivSize() const OFBCommonvirtual
keySize() const OFBCommonvirtual
OFB()OFB< T >inline
OFBCommon()OFBCommonprotected
setBlockCipher(BlockCipher *cipher)OFBCommoninlineprotected
setIV(const uint8_t *iv, size_t len)OFBCommonvirtual
setKey(const uint8_t *key, size_t len)OFBCommonvirtual
~Cipher()Ciphervirtual
~OFBCommon()OFBCommonvirtual
+ + + + diff --git a/html/classOFB.html b/html/classOFB.html new file mode 100644 index 00000000..7a7ffba4 --- /dev/null +++ b/html/classOFB.html @@ -0,0 +1,189 @@ + + + + + + +ArduinoLibs: OFB< T > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
OFB< T > Class Template Reference
+
+
+ +

Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers. + More...

+ +

#include <OFB.h>

+
+Inheritance diagram for OFB< T >:
+
+
+ + +OFBCommon +Cipher + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

OFB ()
 Constructs a new OFB object for the block cipher T.
 
- Public Member Functions inherited from OFBCommon
+virtual ~OFBCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from OFBCommon
 OFBCommon ()
 Constructs a new cipher in OFB mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this OFB object. More...
 
+

Detailed Description

+

template<typename T>
+class OFB< T >

+ +

Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers.

+

The template parameter T must be a concrete subclass of BlockCipher indicating the specific block cipher to use. T must have a block size of 16 bytes (128 bits).

+

For example, the following creates a OFB object using AES192 as the underlying cipher:

+
+
ofb.setKey(key, 24);
+
ofb.setIV(iv, 16);
+
ofb.encrypt(output, input, len);
+

Decryption is identical to encryption for OFB mode.

+

The size of the ciphertext will always be the same as the size of the plaintext.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
CTR, CFB, CBC
+ +

Definition at line 56 of file OFB.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classOFB.png b/html/classOFB.png new file mode 100644 index 00000000..4bf8fac5 Binary files /dev/null and b/html/classOFB.png differ diff --git a/html/classOFBCommon-members.html b/html/classOFBCommon-members.html new file mode 100644 index 00000000..f6cc1081 --- /dev/null +++ b/html/classOFBCommon-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
OFBCommon Member List
+
+
+ +

This is the complete list of members for OFBCommon, including all inherited members.

+ + + + + + + + + + + + + +
Cipher()Cipher
clear()OFBCommonvirtual
decrypt(uint8_t *output, const uint8_t *input, size_t len)OFBCommonvirtual
encrypt(uint8_t *output, const uint8_t *input, size_t len)OFBCommonvirtual
ivSize() const OFBCommonvirtual
keySize() const OFBCommonvirtual
OFBCommon()OFBCommonprotected
setBlockCipher(BlockCipher *cipher)OFBCommoninlineprotected
setIV(const uint8_t *iv, size_t len)OFBCommonvirtual
setKey(const uint8_t *key, size_t len)OFBCommonvirtual
~Cipher()Ciphervirtual
~OFBCommon()OFBCommonvirtual
+ + + + diff --git a/html/classOFBCommon.html b/html/classOFBCommon.html new file mode 100644 index 00000000..12ae4c99 --- /dev/null +++ b/html/classOFBCommon.html @@ -0,0 +1,542 @@ + + + + + + +ArduinoLibs: OFBCommon Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
OFBCommon Class Reference
+
+
+ +

Concrete base class to assist with implementing OFB for 128-bit block ciphers. + More...

+ +

#include <OFB.h>

+
+Inheritance diagram for OFBCommon:
+
+
+ + +Cipher +OFB< T > + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+virtual ~OFBCommon ()
 Destroys this cipher object after clearing sensitive information.
 
size_t keySize () const
 Default size of the key for this cipher, in bytes. More...
 
size_t ivSize () const
 Size of the initialization vector for this cipher, in bytes. More...
 
bool setKey (const uint8_t *key, size_t len)
 Sets the key to use for future encryption and decryption operations. More...
 
bool setIV (const uint8_t *iv, size_t len)
 Sets the initialization vector to use for future encryption and decryption operations. More...
 
void encrypt (uint8_t *output, const uint8_t *input, size_t len)
 Encrypts an input buffer and writes the ciphertext to an output buffer. More...
 
void decrypt (uint8_t *output, const uint8_t *input, size_t len)
 Decrypts an input buffer and writes the plaintext to an output buffer. More...
 
void clear ()
 Clears all security-sensitive state from this cipher. More...
 
- Public Member Functions inherited from Cipher
Cipher ()
 Constructs a new cipher object.
 
virtual ~Cipher ()
 Destroys this cipher object. More...
 
+ + + + + + + +

+Protected Member Functions

 OFBCommon ()
 Constructs a new cipher in OFB mode. More...
 
void setBlockCipher (BlockCipher *cipher)
 Sets the block cipher to use for this OFB object. More...
 
+

Detailed Description

+

Concrete base class to assist with implementing OFB for 128-bit block ciphers.

+

Reference: http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

+
See Also
OFB
+ +

Definition at line 29 of file OFB.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + +
OFBCommon::OFBCommon ()
+
+protected
+
+ +

Constructs a new cipher in OFB mode.

+

This constructor should be followed by a call to setBlockCipher().

+ +

Definition at line 42 of file OFB.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void OFBCommon::clear ()
+
+virtual
+
+ +

Clears all security-sensitive state from this cipher.

+

Security-sensitive information includes key schedules, initialization vectors, and any temporary state that is used by encrypt() or decrypt() which is stored in the cipher itself.

+ +

Implements Cipher.

+ +

Definition at line 113 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void OFBCommon::decrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Decrypts an input buffer and writes the plaintext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to decrypt.
+
+
+

The decrypt() function can be called multiple times with different regions of the ciphertext data.

+
See Also
encrypt()
+ +

Implements Cipher.

+ +

Definition at line 108 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
void OFBCommon::encrypt (uint8_t * output,
const uint8_t * input,
size_t len 
)
+
+virtual
+
+ +

Encrypts an input buffer and writes the ciphertext to an output buffer.

+
Parameters
+ + + + +
outputThe output buffer to write to, which may be the same buffer as input. The output buffer must have at least as many bytes as the input buffer.
inputThe input buffer to read from.
lenThe number of bytes to encrypt.
+
+
+

The encrypt() function can be called multiple times with different regions of the plaintext data.

+
See Also
decrypt()
+ +

Implements Cipher.

+ +

Definition at line 85 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t OFBCommon::ivSize () const
+
+virtual
+
+ +

Size of the initialization vector for this cipher, in bytes.

+

If the cipher does not need an initialization vector, this function will return zero.

+ +

Implements Cipher.

+ +

Definition at line 61 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t OFBCommon::keySize () const
+
+virtual
+
+ +

Default size of the key for this cipher, in bytes.

+

If the cipher supports variable-sized keys, keySize() indicates the default or recommended key size. The cipher may support other key sizes.

+
See Also
setKey(), ivSize()
+ +

Implements Cipher.

+ +

Definition at line 56 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void OFBCommon::setBlockCipher (BlockCiphercipher)
+
+inlineprotected
+
+ +

Sets the block cipher to use for this OFB object.

+
Parameters
+ + +
cipherThe block cipher to use to implement OFB mode, which must have a block size of 16 bytes (128 bits).
+
+
+ +

Definition at line 47 of file OFB.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool OFBCommon::setIV (const uint8_t * iv,
size_t len 
)
+
+virtual
+
+ +

Sets the initialization vector to use for future encryption and decryption operations.

+
Parameters
+ + + +
ivThe initialization vector to use.
lenThe length of the initialization vector in bytes.
+
+
+
Returns
Returns false if the length is not supported.
+

Initialization vectors should be set before the first call to encrypt() or decrypt() after a setKey() call. If the initialization vector is changed after encryption or decryption begins, then the behaviour is undefined.

+
Note
The IV is not encoded into the output stream by encrypt(). The caller is responsible for communicating the IV to the other party.
+
See Also
ivSize()
+ +

Implements Cipher.

+ +

Definition at line 76 of file OFB.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool OFBCommon::setKey (const uint8_t * key,
size_t len 
)
+
+virtual
+
+ +

Sets the key to use for future encryption and decryption operations.

+
Parameters
+ + + +
keyThe key to use.
lenThe length of the key in bytes.
+
+
+
Returns
Returns false if the key length is not supported, or the key is somehow "weak" and unusable by this cipher.
+

Use clear() or the destructor to remove the key and any other sensitive data from the object once encryption or decryption is complete.

+

Calling setKey() resets the cipher. Any temporary data that was being retained for encrypting partial blocks will be abandoned.

+
See Also
keySize(), clear()
+ +

Implements Cipher.

+ +

Definition at line 66 of file OFB.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classOFBCommon.png b/html/classOFBCommon.png new file mode 100644 index 00000000..87536b58 Binary files /dev/null and b/html/classOFBCommon.png differ diff --git a/html/classRNGClass-members.html b/html/classRNGClass-members.html new file mode 100644 index 00000000..1ca6ed50 --- /dev/null +++ b/html/classRNGClass-members.html @@ -0,0 +1,113 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RNGClass Member List
+
+
+ +

This is the complete list of members for RNGClass, including all inherited members.

+ + + + + + + + + + + + + +
addNoiseSource(NoiseSource &source)RNGClass
available(size_t len) const RNGClass
begin(const char *tag, int eepromAddress)RNGClass
destroy()RNGClass
loop()RNGClass
rand(uint8_t *data, size_t len)RNGClass
RNGClass()RNGClass
save()RNGClass
SEED_SIZERNGClassstatic
setAutoSaveTime(uint16_t minutes)RNGClass
stir(const uint8_t *data, size_t len, unsigned int credit=0)RNGClass
~RNGClass()RNGClass
+ + + + diff --git a/html/classRNGClass.html b/html/classRNGClass.html new file mode 100644 index 00000000..35efd6a6 --- /dev/null +++ b/html/classRNGClass.html @@ -0,0 +1,525 @@ + + + + + + +ArduinoLibs: RNGClass Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +Static Public Attributes | +List of all members
+
+
RNGClass Class Reference
+
+
+ +

Pseudo random number generator suitable for cryptography. + More...

+ +

#include <RNG.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 RNGClass ()
 Constructs a new random number generator instance. More...
 
~RNGClass ()
 Destroys this random number generator instance.
 
void begin (const char *tag, int eepromAddress)
 Initializes the random number generator. More...
 
void addNoiseSource (NoiseSource &source)
 Adds a noise source to the random number generator. More...
 
void setAutoSaveTime (uint16_t minutes)
 Sets the amount of time between automatic seed saves. More...
 
void rand (uint8_t *data, size_t len)
 Generates random bytes into a caller-supplied buffer. More...
 
bool available (size_t len) const
 Determine if there is sufficient entropy available for a specific request size. More...
 
void stir (const uint8_t *data, size_t len, unsigned int credit=0)
 Stirs additional entropy data into the random pool. More...
 
void save ()
 Saves the random seed to EEPROM. More...
 
void loop ()
 Run periodic housekeeping tasks on the random number generator. More...
 
void destroy ()
 Destroys the data in the random number pool and the saved seed in EEPROM. More...
 
+ + + + +

+Static Public Attributes

+static const int SEED_SIZE = 49
 Size of a saved random number seed in EEPROM space.
 
+

Detailed Description

+

Pseudo random number generator suitable for cryptography.

+

Random number generators must be seeded properly before they can be used or an adversary may be able to predict the random output. Seed data may be:

+ +

The following example demonstrates how to initialise the random number generator:

+
#include <SPI.h>
+
#include <Ethernet.h>
+
#include <Crypto.h>
+
#include <RNG.h>
+
#include <TransistorNoiseSource.h>
+
+
// Noise source to seed the random number generator.
+ +
+
// MAC address for Ethernet communication.
+
byte mac_address[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
+
+
void setup() {
+
// Initialize the Ethernet shield.
+
Ethernet.begin(mac_address);
+
+
// Initialize the random number generator with the application tag
+
// "MyApp 1.0" and load the previous seed from EEPROM address 500.
+
RNG.begin("MyApp 1.0", 500);
+
+
// Stir in the Ethernet MAC address.
+
RNG.stir(mac_address, sizeof(mac_address));
+
+
// Add the noise source to the list of sources known to RNG.
+
RNG.addNoiseSource(noise);
+
+
// ...
+
}
+

The application should regularly call loop() to stir in new data from the registered noise sources and to periodically save the seed:

+
void loop() {
+
// ...
+
+
// Perform regular housekeeping on the random number generator.
+
RNG.loop();
+
+
// ...
+
}
+

The loop() function will automatically save the random number seed on a regular basis. By default the seed is saved every hour but this can be changed using setAutoSaveTime().

+

Keep in mind that saving too often may cause the EEPROM to wear out quicker. It is wise to limit saving to once an hour or once a day depending upon how long you intend to field the device before replacing it. For example, an EEPROM rated for 100k erase/write cycles will last about 69 days saving once a minute or 11 years saving once an hour.

+

The application can still elect to call save() at any time if wants. For example, if the application can detect power loss or shutdown conditions programmatically, then it may make sense to force a save() of the seed upon shutdown.

+
See Also
NoiseSource
+ +

Definition at line 31 of file RNG.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
RNGClass::RNGClass ()
+
+ +

Constructs a new random number generator instance.

+

This constructor must be followed by a call to begin() to properly initialize the random number generator.

+
See Also
begin()
+ +

Definition at line 167 of file RNG.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
void RNGClass::addNoiseSource (NoiseSourcesource)
+
+ +

Adds a noise source to the random number generator.

+
Parameters
+ + +
sourceThe noise source to add, which will be polled regularly by loop() to accumulate noise-based entropy from the source.
+
+
+

RNG supports a maximum of four noise sources. If the application needs more than that then the application must poll the noise sources itself by calling NoiseSource::stir() directly.

+
See Also
loop(), begin()
+ +

Definition at line 249 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool RNGClass::available (size_t len) const
+
+ +

Determine if there is sufficient entropy available for a specific request size.

+
Parameters
+ + +
lenThe number of bytes of random data that will be requested via a call to rand().
+
+
+
Returns
Returns true if there is at least len * 8 bits of entropy in the random number pool, or false if not.
+

This function can be used by the application to wait for sufficient entropy to become available from the system's noise sources before generating important values. For example:

+
bool haveKey = false;
+
byte key[32];
+
+
void loop() {
+
...
+
+
if (!haveKey && RNG.available(sizeof(key))) {
+
RNG.rand(key, sizeof(key));
+
haveKey = true;
+
}
+
+
...
+
}
+

If len is larger than the maximum number of entropy credits supported by the random number pool (384 bits, 48 bytes), then the maximum will be used instead. For example, asking if 512 bits (64 bytes) are available will return true if in reality only 384 bits are available. If this is a problem for the application's security requirements, then large requests for random data should be broken up into smaller chunks with the application waiting for the entropy pool to refill between chunks.

+
See Also
rand()
+ +

Definition at line 373 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void RNGClass::begin (const char * tag,
int eepromAddress 
)
+
+ +

Initializes the random number generator.

+
Parameters
+ + + +
tagA string that is stirred into the random pool at startup; usually this should be a value that is unique to the application and version such as "MyApp 1.0" so that different applications do not generate the same sequence of values upon first boot.
eepromAddressThe EEPROM address to load the previously saved seed from and to save new seeds when save() is called. There must be at least SEED_SIZE (49) bytes of EEPROM space available at the address.
+
+
+

This function should be followed by calls to addNoiseSource() to register the application's noise sources.

+
See Also
addNoiseSource(), stir(), save()
+ +

Definition at line 202 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + +
void RNGClass::destroy ()
+
+ +

Destroys the data in the random number pool and the saved seed in EEPROM.

+

This function attempts to throw away any data that could theoretically be used to predict previous and future outputs of the random number generator if the device is captured, sold, or otherwise compromised.

+

After this function is called, begin() must be called again to re-initialize the random number generator.

+
Note
The rand() and save() functions take some care to manage the random number pool in a way that makes prediction of past outputs from a captured state very difficult. Future outputs may be predictable if noise or other high-entropy data is not mixed in with stir() on a regular basis.
+
See Also
begin()
+ +

Definition at line 523 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + +
void RNGClass::loop ()
+
+ +

Run periodic housekeeping tasks on the random number generator.

+

This function must be called on a regular basis from the application's main "loop()" function.

+ +

Definition at line 493 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void RNGClass::rand (uint8_t * data,
size_t len 
)
+
+ +

Generates random bytes into a caller-supplied buffer.

+
Parameters
+ + + +
dataPoints to the buffer to fill with random bytes.
lenNumber of bytes to generate.
+
+
+

Calling this function will decrease the amount of entropy in the random number pool by len * 8 bits. If there isn't enough entropy, then this function will still return len bytes of random data generated from what entropy it does have.

+

If the application requires a specific amount of entropy before generating important values, the available() function can be polled to determine when sufficient entropy is available.

+
See Also
available(), stir()
+ +

Definition at line 296 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + +
void RNGClass::save ()
+
+ +

Saves the random seed to EEPROM.

+

During system startup, noise sources typically won't have accumulated much entropy. But startup is usually the time when the system most needs to generate random data for session keys, IV's, and the like.

+

The purpose of this function is to pass some of the accumulated entropy from one session to the next after a loss of power. Thus, once the system has been running for a while it will get progressively better at generating random values and the accumulated entropy will not be completely lost.

+

Normally it isn't necessary to call save() directly. The loop() function will automatically save the seed on a periodic basis (default of 1 hour).

+

The seed that is saved is generated in such a way that it cannot be used to predict random values that were generated previously or subsequently in the current session. So a compromise of the EEPROM contents of a captured device should not result in compromise of random values that have already been generated. However, if power is lost and the system restarted, then there will be a short period of time where the random state will be predictable from the seed. For this reason it is very important to stir() in new noise data at startup.

+
See Also
loop(), stir()
+ +

Definition at line 475 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void RNGClass::setAutoSaveTime (uint16_t minutes)
+
+ +

Sets the amount of time between automatic seed saves.

+
Parameters
+ + +
minutesThe number of minutes between automatic seed saves.
+
+
+

The default time between automatic seed saves is 1 hour.

+

This function is intended to help with EEPROM wear by slowing down how often seed data is saved as noise is stirred into the random pool. The exact period to use depends upon how long you intend to field the device before replacing it. For example, an EEPROM rated for 100k erase/write cycles will last about 69 days saving once a minute or 11 years saving once an hour.

+
See Also
save(), stir()
+ +

Definition at line 272 of file RNG.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void RNGClass::stir (const uint8_t * data,
size_t len,
unsigned int credit = 0 
)
+
+ +

Stirs additional entropy data into the random pool.

+
Parameters
+ + + + +
dataPoints to the additional data to be stirred in.
lenNumber of bytes to be stirred in.
creditThe number of bits of entropy to credit for the data that is stirred in. Note that this is bits, not bytes.
+
+
+

The maximum credit allowed is len * 8 bits, indicating that every bit in the input data is good and random. Practical noise sources are rarely that good, so credit will usually be smaller. For example, to credit 2 bits of entropy per byte, the function would be called as follows:

+
RNG.stir(noise_data, noise_bytes, noise_bytes * 2);
+

If credit is zero, then the data will be stirred in but no entropy credit is given. This is useful for static values like serial numbers and MAC addresses that are different between devices but highly predictable.

+
See Also
loop()
+ +

Definition at line 406 of file RNG.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classRTC-members.html b/html/classRTC-members.html new file mode 100644 index 00000000..b42d5b81 --- /dev/null +++ b/html/classRTC-members.html @@ -0,0 +1,131 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RTC Member List
+
+
+ +

This is the complete list of members for RTC, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
adjustDays(RTCDate *date, uint8_t flags)RTCstatic
adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
adjustYears(RTCDate *date, uint8_t flags)RTCstatic
ALARM_COUNTRTCstatic
byteCount() const RTCvirtual
dayOfWeek(const RTCDate *date)RTCstatic
DayOfWeek enum nameRTC
DECREMENTRTCstatic
Friday enum value (defined in RTC)RTC
hasUpdates()RTCvirtual
INCREMENTRTCstatic
Monday enum value (defined in RTC)RTC
NO_TEMPERATURERTCstatic
readAlarm(uint8_t alarmNum, RTCAlarm *value)RTCvirtual
readByte(uint8_t offset)RTCvirtual
readDate(RTCDate *value)RTCvirtual
readTemperature()RTCvirtual
readTime(RTCTime *value)RTCvirtual
RTC()RTC
Saturday enum value (defined in RTC)RTC
Sunday enum value (defined in RTC)RTC
Thursday enum value (defined in RTC)RTC
Tuesday enum value (defined in RTC)RTC
Wednesday enum value (defined in RTC)RTC
WRAPRTCstatic
writeAlarm(uint8_t alarmNum, const RTCAlarm *value)RTCvirtual
writeByte(uint8_t offset, uint8_t value)RTCvirtual
writeDate(const RTCDate *value)RTCvirtual
writeTime(const RTCTime *value)RTCvirtual
~RTC() (defined in RTC)RTC
+ + + + diff --git a/html/classRTC.html b/html/classRTC.html new file mode 100644 index 00000000..45c0e9f0 --- /dev/null +++ b/html/classRTC.html @@ -0,0 +1,787 @@ + + + + + + +ArduinoLibs: RTC Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Types | +Public Member Functions | +Static Public Member Functions | +Static Public Attributes | +List of all members
+
+
RTC Class Reference
+
+
+ +

Base class for realtime clock handlers. + More...

+ +

#include <RTC.h>

+
+Inheritance diagram for RTC:
+
+
+ + +DS1307RTC +DS3231RTC +DS3232RTC + +
+ + + + + +

+Public Types

enum  DayOfWeek {
+  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
+  Friday, +Saturday, +Sunday +
+ }
 Day of the week corresponding to a date. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 RTC ()
 Constructs a new realtime clock handler. More...
 
virtual bool hasUpdates ()
 Returns true if the realtime clock has updated since the last call to this function. More...
 
virtual void readTime (RTCTime *value)
 Reads the current time from the realtime clock into value. More...
 
virtual void readDate (RTCDate *value)
 Reads the current date from the realtime clock into value. More...
 
virtual void writeTime (const RTCTime *value)
 Updates the time in the realtime clock to match value. More...
 
virtual void writeDate (const RTCDate *value)
 Updates the date in the realtime clock to match value. More...
 
virtual void readAlarm (uint8_t alarmNum, RTCAlarm *value)
 Reads the details of the alarm with index alarmNum into value. More...
 
virtual void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
 Updates the details of the alarm with index alarmNum from value. More...
 
virtual int byteCount () const
 Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms. More...
 
virtual uint8_t readByte (uint8_t offset)
 Reads the byte at offset within the realtime clock's non-volatile memory. More...
 
virtual void writeByte (uint8_t offset, uint8_t value)
 Writes value to offset within the realtime clock's non-volatile memory. More...
 
virtual int readTemperature ()
 Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius. More...
 
+ + + + + + + + + + + + + +

+Static Public Member Functions

static void adjustDays (RTCDate *date, uint8_t flags)
 Adjusts date up or down one day according to flags. More...
 
static void adjustMonths (RTCDate *date, uint8_t flags)
 Adjusts date up or down one month according to flags. More...
 
static void adjustYears (RTCDate *date, uint8_t flags)
 Adjusts date up or down one year according to flags. More...
 
static DayOfWeek dayOfWeek (const RTCDate *date)
 Returns the day of the week corresponding to date. More...
 
+ + + + + + + + + + + + + + + + +

+Static Public Attributes

+static const uint8_t ALARM_COUNT = 4
 Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
 
+static const int NO_TEMPERATURE = 32767
 Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
 
+static const uint8_t INCREMENT = 0x0000
 Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t DECREMENT = 0x0001
 Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
 
+static const uint8_t WRAP = 0x0002
 Wrap around to the beginning of the current month/year rather than advance to the next one.
 
+

Detailed Description

+

Base class for realtime clock handlers.

+

This class simplifies the process of reading and writing the time and date information in a realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

+

It is intended that the application will instantiate a subclass of this class to handle the specific realtime clock chip in the system. The default implementation in RTC simulates a clock based on the value of millis(), with alarms and clock settings stored in main memory.

+

Because the common DS1307 and DS3232 realtime clock chips use a 2-digit year, this class is also limited to dates between 2000 and 2099 inclusive.

+
See Also
RTCTime, RTCDate, RTCAlarm, DS1307RTC, DS3232RTC
+ +

Definition at line 52 of file RTC.h.

+

Member Enumeration Documentation

+ +
+
+ + + + +
enum RTC::DayOfWeek
+
+ +

Day of the week corresponding to a date.

+
See Also
dayOfWeek()
+ +

Definition at line 58 of file RTC.h.

+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
RTC::RTC ()
+
+ +

Constructs a new realtime clock handler.

+
See Also
hasUpdates()
+ +

Definition at line 105 of file RTC.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::adjustDays (RTCDatedate,
uint8_t flags 
)
+
+static
+
+ +

Adjusts date up or down one day according to flags.

+
See Also
adjustMonths(), adjustYears()
+ +

Definition at line 313 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::adjustMonths (RTCDatedate,
uint8_t flags 
)
+
+static
+
+ +

Adjusts date up or down one month according to flags.

+
See Also
adjustDays(), adjustYears()
+ +

Definition at line 343 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::adjustYears (RTCDatedate,
uint8_t flags 
)
+
+static
+
+ +

Adjusts date up or down one year according to flags.

+
See Also
adjustDays(), adjustMonths()
+ +

Definition at line 370 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int RTC::byteCount () const
+
+virtual
+
+ +

Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

+
See Also
readByte(), writeByte()
+ +

Reimplemented in DS1307RTC, and DS3232RTC.

+ +

Definition at line 235 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
RTC::DayOfWeek RTC::dayOfWeek (const RTCDatedate)
+
+static
+
+ +

Returns the day of the week corresponding to date.

+

This function is only guaranteed to produce meaningful values for years between 2000 and 2099.

+ +

Definition at line 399 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool RTC::hasUpdates ()
+
+virtual
+
+ +

Returns true if the realtime clock has updated since the last call to this function.

+

The default implementation returns true, indicating that an update is always available to be read.

+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 134 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::readAlarm (uint8_t alarmNum,
RTCAlarmvalue 
)
+
+virtual
+
+ +

Reads the details of the alarm with index alarmNum into value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
writeAlarm(), alarmCount()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 209 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
uint8_t RTC::readByte (uint8_t offset)
+
+virtual
+
+ +

Reads the byte at offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
writeByte(), byteCount()
+ +

Reimplemented in DS1307RTC, and DS3232RTC.

+ +

Definition at line 247 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void RTC::readDate (RTCDatevalue)
+
+virtual
+
+ +

Reads the current date from the realtime clock into value.

+

The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

+
See Also
writeDate(), readTime()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 169 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int RTC::readTemperature ()
+
+virtual
+
+ +

Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

+

Returns the value NO_TEMPERATURE if the realtime clock chip cannot determine the temperature.

+ +

Reimplemented in DS3231RTC, and DS3232RTC.

+ +

Definition at line 288 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void RTC::readTime (RTCTimevalue)
+
+virtual
+
+ +

Reads the current time from the realtime clock into value.

+
See Also
writeTime(), readDate()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 144 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::writeAlarm (uint8_t alarmNum,
const RTCAlarmvalue 
)
+
+virtual
+
+ +

Updates the details of the alarm with index alarmNum from value.

+

The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

+

Alarm details are stored at the end of the realtime clock's non-volatile memory.

+
See Also
readAlarm(), alarmCount()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 224 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void RTC::writeByte (uint8_t offset,
uint8_t value 
)
+
+virtual
+
+ +

Writes value to offset within the realtime clock's non-volatile memory.

+

The offset parameter must be between 0 and byteCount() - 1.

+
See Also
readByte(), byteCount()
+ +

Reimplemented in DS1307RTC, and DS3232RTC.

+ +

Definition at line 262 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void RTC::writeDate (const RTCDatevalue)
+
+virtual
+
+ +

Updates the date in the realtime clock to match value.

+
See Also
readDate(), writeTime()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 194 of file RTC.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void RTC::writeTime (const RTCTimevalue)
+
+virtual
+
+ +

Updates the time in the realtime clock to match value.

+
See Also
readTime(), writeDate()
+ +

Reimplemented in DS3231RTC, DS1307RTC, and DS3232RTC.

+ +

Definition at line 179 of file RTC.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classRTC.png b/html/classRTC.png new file mode 100644 index 00000000..d55acc64 Binary files /dev/null and b/html/classRTC.png differ diff --git a/html/classRTCAlarm-members.html b/html/classRTCAlarm-members.html new file mode 100644 index 00000000..808ba527 --- /dev/null +++ b/html/classRTCAlarm-members.html @@ -0,0 +1,107 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RTCAlarm Member List
+
+
+ +

This is the complete list of members for RTCAlarm, including all inherited members.

+ + + + + + + +
dayRTCAlarm
dowRTCAlarm
flagsRTCAlarm
hourRTCAlarm
minuteRTCAlarm
secondRTCAlarm
+ + + + diff --git a/html/classRTCDate-members.html b/html/classRTCDate-members.html new file mode 100644 index 00000000..112b849f --- /dev/null +++ b/html/classRTCDate-members.html @@ -0,0 +1,104 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RTCDate Member List
+
+
+ +

This is the complete list of members for RTCDate, including all inherited members.

+ + + + +
dayRTCDate
monthRTCDate
yearRTCDate
+ + + + diff --git a/html/classRTCTime-members.html b/html/classRTCTime-members.html new file mode 100644 index 00000000..5d20166d --- /dev/null +++ b/html/classRTCTime-members.html @@ -0,0 +1,104 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RTCTime Member List
+
+
+ +

This is the complete list of members for RTCTime, including all inherited members.

+ + + + +
hourRTCTime
minuteRTCTime
secondRTCTime
+ + + + diff --git a/html/classRingOscillatorNoiseSource-members.html b/html/classRingOscillatorNoiseSource-members.html new file mode 100644 index 00000000..053ab272 --- /dev/null +++ b/html/classRingOscillatorNoiseSource-members.html @@ -0,0 +1,108 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
RingOscillatorNoiseSource Member List
+
+
+ +

This is the complete list of members for RingOscillatorNoiseSource, including all inherited members.

+ + + + + + + + +
calibrating() const RingOscillatorNoiseSourcevirtual
NoiseSource()NoiseSource
output(const uint8_t *data, size_t len, unsigned int credit)NoiseSourceprotectedvirtual
RingOscillatorNoiseSource() (defined in RingOscillatorNoiseSource)RingOscillatorNoiseSource
stir()RingOscillatorNoiseSourcevirtual
~NoiseSource()NoiseSourcevirtual
~RingOscillatorNoiseSource() (defined in RingOscillatorNoiseSource)RingOscillatorNoiseSourcevirtual
+ + + + diff --git a/html/classRingOscillatorNoiseSource.html b/html/classRingOscillatorNoiseSource.html new file mode 100644 index 00000000..65566412 --- /dev/null +++ b/html/classRingOscillatorNoiseSource.html @@ -0,0 +1,258 @@ + + + + + + +ArduinoLibs: RingOscillatorNoiseSource Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
RingOscillatorNoiseSource Class Reference
+
+
+ +

Processes the signal from a ring oscillator based noise source. + More...

+ +

#include <RingOscillatorNoiseSource.h>

+
+Inheritance diagram for RingOscillatorNoiseSource:
+
+
+ + +NoiseSource + +
+ + + + + + + + + + + + + + + +

+Public Member Functions

bool calibrating () const
 Determine if the noise source is still calibrating itself. More...
 
void stir ()
 Stirs entropy from this noise source into the global random number pool. More...
 
- Public Member Functions inherited from NoiseSource
NoiseSource ()
 Constructs a new random noise source.
 
+virtual ~NoiseSource ()
 Destroys this random noise source.
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from NoiseSource
virtual void output (const uint8_t *data, size_t len, unsigned int credit)
 Called from subclasses to output noise to the global random number pool. More...
 
+

Detailed Description

+

Processes the signal from a ring oscillator based noise source.

+

This class processes input from a ring oscillator noise source, such as that described here.

+
Note
The output from a ring oscillator is not generally as good as a "true" noise source. The oscillation can easily settle into regular patterns or sync up with other clock sources on the board. It is even possible to "hack" a ring oscillator by injecting chosen frequencies on the power supply rails to force the oscillation into a predictable waveform (see this paper for an example). It is very important that the output of this class be whitened with RNG before it is used for cryptography and that the device is isolated from attacker-controlled sources of power. Unless you have a very good reason to use a ring oscillator, TransistorNoiseSource is usually a better option.
+

The noise is read from an input capture pin on the Arduino and stirred into the random number pool on a regular basis. The following pins are used on different Arduino variants:

+ + + + + + + + + +
VariantArduino Pin / AVR PinTimer
Arduino UnoD8 / PB0Timer 1
Arduino LeonardoD4 / PD4Timer 1
Arduino Mega or Mega 2560D49 / PL0Timer 4
+

If your board is not pin-compatible with one of the above, then the source for the RingOscillatorNoiseSource class will need to be modified to use a different pin/timer combination. Also, when the timer is in use by this class it cannot be used for other application tasks.

+

The example below shows how to initialize a ring oscillator based noise source and use it with RNG:

+
#include <Crypto.h>
+
#include <RNG.h>
+
#include <RingOscillatorNoiseSource.h>
+
+
// Noise source to seed the random number generator.
+ +
+
void setup() {
+
// Initialize the random number generator with the application tag
+
// "MyApp 1.0" and load the previous seed from EEPROM address 500.
+
RNG.begin("MyApp 1.0", 500);
+
+
// Add the noise source to the list of sources known to RNG.
+
RNG.addNoiseSource(noise);
+
+
// ...
+
}
+
+
void loop() {
+
// ...
+
+
// Perform regular housekeeping on the random number generator.
+
RNG.loop();
+
+
// ...
+
}
+

For more information, see the documentation for RNG.

+
See Also
RNG, NoiseSource, TransistorNoiseSource
+ +

Definition at line 29 of file RingOscillatorNoiseSource.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool RingOscillatorNoiseSource::calibrating () const
+
+virtual
+
+ +

Determine if the noise source is still calibrating itself.

+
Returns
Returns true if calibration is in progress; false if the noise source is generating valid random data.
+

Noise sources that require calibration start doing so at system startup and then switch over to random data generation once calibration is complete. Since no random data is being generated during calibration, the output from RNG.rand() may be predictable. Use RNG.available() to determine when sufficient entropy is available to generate good random values.

+

It is possible that the noise source never exits calibration. This can happen if the input voltage is insufficient to trigger noise or if the noise source is not connected. Noise sources may also periodically recalibrate themselves.

+
See Also
stir()
+ +

Implements NoiseSource.

+ +

Definition at line 178 of file RingOscillatorNoiseSource.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void RingOscillatorNoiseSource::stir ()
+
+virtual
+
+ +

Stirs entropy from this noise source into the global random number pool.

+

This function should call output() to add the entropy from this noise source to the global random number pool.

+

The noise source should batch up the entropy data, providing between 16 and 48 bytes of data each time. If the noise source does not have sufficient entropy data at the moment, it should return without stiring the current data in.

+
See Also
calibrating(), output()
+ +

Implements NoiseSource.

+ +

Definition at line 201 of file RingOscillatorNoiseSource.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classRingOscillatorNoiseSource.png b/html/classRingOscillatorNoiseSource.png new file mode 100644 index 00000000..138a6eb9 Binary files /dev/null and b/html/classRingOscillatorNoiseSource.png differ diff --git a/html/classSHA1-members.html b/html/classSHA1-members.html new file mode 100644 index 00000000..46b9245c --- /dev/null +++ b/html/classSHA1-members.html @@ -0,0 +1,118 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SHA1 Member List
+
+
+ +

This is the complete list of members for SHA1, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
blockSize() const SHA1virtual
chunkSize (defined in SHA1)SHA1
clear()SHA1virtual
finalize(void *hash, size_t len)SHA1virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)SHA1virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
h (defined in SHA1)SHA1
Hash()Hash
hashSize() const SHA1virtual
length (defined in SHA1)SHA1
reset()SHA1virtual
resetHMAC(const void *key, size_t keyLen)SHA1virtual
SHA1()SHA1
update(const void *data, size_t len)SHA1virtual
w (defined in SHA1)SHA1
~Hash()Hashvirtual
~SHA1()SHA1virtual
+ + + + diff --git a/html/classSHA1.html b/html/classSHA1.html new file mode 100644 index 00000000..7a95905f --- /dev/null +++ b/html/classSHA1.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: SHA1 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SHA1 Class Reference
+
+
+ +

SHA-1 hash algorithm. + More...

+ +

#include <SHA1.h>

+
+Inheritance diagram for SHA1:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SHA1 ()
 Constructs a SHA-1 hash object.
 
+virtual ~SHA1 ()
 Destroys this SHA-1 hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

SHA-1 hash algorithm.

+

Reference: http://en.wikipedia.org/wiki/SHA-1

+
See Also
SHA256, SHA512
+ +

Definition at line 28 of file SHA1.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA1::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 59 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA1::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 128 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA1::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 97 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void SHA1::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 141 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA1::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 54 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA1::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 64 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA1::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 134 of file SHA1.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA1::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 75 of file SHA1.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSHA1.png b/html/classSHA1.png new file mode 100644 index 00000000..c68d93bd Binary files /dev/null and b/html/classSHA1.png differ diff --git a/html/classSHA256-members.html b/html/classSHA256-members.html new file mode 100644 index 00000000..b5f26c13 --- /dev/null +++ b/html/classSHA256-members.html @@ -0,0 +1,118 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SHA256 Member List
+
+
+ +

This is the complete list of members for SHA256, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
blockSize() const SHA256virtual
chunkSize (defined in SHA256)SHA256
clear()SHA256virtual
finalize(void *hash, size_t len)SHA256virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)SHA256virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
h (defined in SHA256)SHA256
Hash()Hash
hashSize() const SHA256virtual
length (defined in SHA256)SHA256
reset()SHA256virtual
resetHMAC(const void *key, size_t keyLen)SHA256virtual
SHA256()SHA256
update(const void *data, size_t len)SHA256virtual
w (defined in SHA256)SHA256
~Hash()Hashvirtual
~SHA256()SHA256virtual
+ + + + diff --git a/html/classSHA256.html b/html/classSHA256.html new file mode 100644 index 00000000..e21d2bca --- /dev/null +++ b/html/classSHA256.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: SHA256 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SHA256 Class Reference
+
+
+ +

SHA-256 hash algorithm. + More...

+ +

#include <SHA256.h>

+
+Inheritance diagram for SHA256:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SHA256 ()
 Constructs a SHA-256 hash object.
 
+virtual ~SHA256 ()
 Destroys this SHA-256 hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

SHA-256 hash algorithm.

+

Reference: http://en.wikipedia.org/wiki/SHA-2

+
See Also
SHA512, SHA1, BLAKE2s
+ +

Definition at line 28 of file SHA256.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA256::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 61 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA256::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 133 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA256::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 102 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void SHA256::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 146 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA256::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 56 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA256::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 66 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA256::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 139 of file SHA256.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA256::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 80 of file SHA256.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSHA256.png b/html/classSHA256.png new file mode 100644 index 00000000..b3599afe Binary files /dev/null and b/html/classSHA256.png differ diff --git a/html/classSHA3__256-members.html b/html/classSHA3__256-members.html new file mode 100644 index 00000000..c7c01fd5 --- /dev/null +++ b/html/classSHA3__256-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SHA3_256 Member List
+
+
+ +

This is the complete list of members for SHA3_256, including all inherited members.

+ + + + + + + + + + + + + + +
blockSize() const SHA3_256virtual
clear()SHA3_256virtual
finalize(void *hash, size_t len)SHA3_256virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)SHA3_256virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
Hash()Hash
hashSize() const SHA3_256virtual
reset()SHA3_256virtual
resetHMAC(const void *key, size_t keyLen)SHA3_256virtual
SHA3_256()SHA3_256
update(const void *data, size_t len)SHA3_256virtual
~Hash()Hashvirtual
~SHA3_256()SHA3_256virtual
+ + + + diff --git a/html/classSHA3__256.html b/html/classSHA3__256.html new file mode 100644 index 00000000..af0eaa14 --- /dev/null +++ b/html/classSHA3__256.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: SHA3_256 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SHA3_256 Class Reference
+
+
+ +

SHA3-256 hash algorithm. + More...

+ +

#include <SHA3.h>

+
+Inheritance diagram for SHA3_256:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SHA3_256 ()
 Constructs a new SHA3-256 hash object.
 
+virtual ~SHA3_256 ()
 Destroys this hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

SHA3-256 hash algorithm.

+

Reference: http://en.wikipedia.org/wiki/SHA-3

+
See Also
SHA3_512
+ +

Definition at line 29 of file SHA3.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA3_256::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 56 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA3_256::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 78 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_256::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 71 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void SHA3_256::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 88 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA3_256::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 51 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA3_256::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 61 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_256::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 83 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_256::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 66 of file SHA3.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSHA3__256.png b/html/classSHA3__256.png new file mode 100644 index 00000000..4949a56d Binary files /dev/null and b/html/classSHA3__256.png differ diff --git a/html/classSHA3__512-members.html b/html/classSHA3__512-members.html new file mode 100644 index 00000000..6250621d --- /dev/null +++ b/html/classSHA3__512-members.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SHA3_512 Member List
+
+
+ +

This is the complete list of members for SHA3_512, including all inherited members.

+ + + + + + + + + + + + + + +
blockSize() const SHA3_512virtual
clear()SHA3_512virtual
finalize(void *hash, size_t len)SHA3_512virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)SHA3_512virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
Hash()Hash
hashSize() const SHA3_512virtual
reset()SHA3_512virtual
resetHMAC(const void *key, size_t keyLen)SHA3_512virtual
SHA3_512()SHA3_512
update(const void *data, size_t len)SHA3_512virtual
~Hash()Hashvirtual
~SHA3_512()SHA3_512virtual
+ + + + diff --git a/html/classSHA3__512.html b/html/classSHA3__512.html new file mode 100644 index 00000000..92a39cda --- /dev/null +++ b/html/classSHA3__512.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: SHA3_512 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SHA3_512 Class Reference
+
+
+ +

SHA3-512 hash algorithm. + More...

+ +

#include <SHA3.h>

+
+Inheritance diagram for SHA3_512:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SHA3_512 ()
 Constructs a new SHA3-512 hash object.
 
+virtual ~SHA3_512 ()
 Destroys this hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

SHA3-512 hash algorithm.

+

Reference: http://en.wikipedia.org/wiki/SHA-3

+
See Also
SHA3_256
+ +

Definition at line 51 of file SHA3.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA3_512::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 128 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA3_512::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 150 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_512::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 143 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void SHA3_512::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 160 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA3_512::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 123 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA3_512::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 133 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_512::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 155 of file SHA3.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA3_512::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 138 of file SHA3.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSHA3__512.png b/html/classSHA3__512.png new file mode 100644 index 00000000..be2ace43 Binary files /dev/null and b/html/classSHA3__512.png differ diff --git a/html/classSHA512-members.html b/html/classSHA512-members.html new file mode 100644 index 00000000..d89fa586 --- /dev/null +++ b/html/classSHA512-members.html @@ -0,0 +1,119 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SHA512 Member List
+
+
+ +

This is the complete list of members for SHA512, including all inherited members.

+ + + + + + + + + + + + + + + + + + + +
blockSize() const SHA512virtual
chunkSize (defined in SHA512)SHA512
clear()SHA512virtual
finalize(void *hash, size_t len)SHA512virtual
finalizeHMAC(const void *key, size_t keyLen, void *hash, size_t hashLen)SHA512virtual
formatHMACKey(void *block, const void *key, size_t len, uint8_t pad)Hashprotected
h (defined in SHA512)SHA512
Hash()Hash
hashSize() const SHA512virtual
lengthHigh (defined in SHA512)SHA512
lengthLow (defined in SHA512)SHA512
reset()SHA512virtual
resetHMAC(const void *key, size_t keyLen)SHA512virtual
SHA512()SHA512
update(const void *data, size_t len)SHA512virtual
w (defined in SHA512)SHA512
~Hash()Hashvirtual
~SHA512()SHA512virtual
+ + + + diff --git a/html/classSHA512.html b/html/classSHA512.html new file mode 100644 index 00000000..c0a8cf33 --- /dev/null +++ b/html/classSHA512.html @@ -0,0 +1,514 @@ + + + + + + +ArduinoLibs: SHA512 Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SHA512 Class Reference
+
+
+ +

SHA-512 hash algorithm. + More...

+ +

#include <SHA512.h>

+
+Inheritance diagram for SHA512:
+
+
+ + +Hash + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SHA512 ()
 Constructs a SHA-512 hash object.
 
+virtual ~SHA512 ()
 Destroys this SHA-512 hash object after clearing sensitive information.
 
size_t hashSize () const
 Size of the hash result from finalize(). More...
 
size_t blockSize () const
 Size of the internal block used by the hash algorithm. More...
 
void reset ()
 Resets the hash ready for a new hashing process. More...
 
void update (const void *data, size_t len)
 Updates the hash with more data. More...
 
void finalize (void *hash, size_t len)
 Finalizes the hashing process and returns the hash. More...
 
void clear ()
 Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
 
void resetHMAC (const void *key, size_t keyLen)
 Resets the hash ready for a new HMAC hashing process. More...
 
void finalizeHMAC (const void *key, size_t keyLen, void *hash, size_t hashLen)
 Finalizes the HMAC hashing process and returns the hash. More...
 
- Public Member Functions inherited from Hash
Hash ()
 Constructs a new hash object.
 
virtual ~Hash ()
 Destroys this hash object. More...
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Hash
void formatHMACKey (void *block, const void *key, size_t len, uint8_t pad)
 Formats a HMAC key into a block. More...
 
+

Detailed Description

+

SHA-512 hash algorithm.

+

Reference: http://en.wikipedia.org/wiki/SHA-2

+
See Also
SHA256, SHA1
+ +

Definition at line 28 of file SHA512.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA512::blockSize () const
+
+virtual
+
+ +

Size of the internal block used by the hash algorithm.

+
See Also
update(), hashSize()
+ +

Implements Hash.

+ +

Definition at line 61 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA512::clear ()
+
+virtual
+
+ +

Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.

+
See Also
reset()
+ +

Implements Hash.

+ +

Definition at line 136 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA512::finalize (void * hash,
size_t len 
)
+
+virtual
+
+ +

Finalizes the hashing process and returns the hash.

+
Parameters
+ + + +
hashThe buffer to return the hash value in.
lenThe length of the hash buffer, normally hashSize().
+
+
+

If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.

+

If finalize() is called again, then the returned hash value is undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), update(), finalizeHMAC()
+ +

Implements Hash.

+ +

Definition at line 105 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void SHA512::finalizeHMAC (const void * key,
size_t keyLen,
void * hash,
size_t hashLen 
)
+
+virtual
+
+ +

Finalizes the HMAC hashing process and returns the hash.

+
Parameters
+ + + + + +
keyPoints to the HMAC key for the hashing process. The contents of this array must be identical to the value passed to resetHMAC().
keyLenSize of the HMAC key in bytes.
hashThe buffer to return the hash value in.
hashLenThe length of the hash buffer, normally hashSize().
+
+
+
See Also
resetHMAC(), finalize()
+ +

Implements Hash.

+ +

Definition at line 149 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t SHA512::hashSize () const
+
+virtual
+
+ +

Size of the hash result from finalize().

+
See Also
finalize(), blockSize()
+ +

Implements Hash.

+ +

Definition at line 56 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void SHA512::reset ()
+
+virtual
+
+ +

Resets the hash ready for a new hashing process.

+
See Also
update(), finalize(), resetHMAC()
+ +

Implements Hash.

+ +

Definition at line 66 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA512::resetHMAC (const void * key,
size_t keyLen 
)
+
+virtual
+
+ +

Resets the hash ready for a new HMAC hashing process.

+
Parameters
+ + + +
keyPoints to the HMAC key for the hashing process.
keyLenSize of the HMAC key in bytes.
+
+
+

The following example computes a HMAC over a series of data blocks with a specific key:

+
hash.resetHMAC(key, sizeof(key));
+
hash.update(data1, sizeof(data1));
+
hash.update(data2, sizeof(data2));
+
...
+
hash.update(dataN, sizeof(dataN));
+
hash.finalizeHMAC(key, sizeof(key), hmac, sizeof(hmac));
+

The same key must be passed to both resetHMAC() and finalizeHMAC().

+
See Also
finalizeHMAC(), reset()
+ +

Implements Hash.

+ +

Definition at line 142 of file SHA512.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void SHA512::update (const void * data,
size_t len 
)
+
+virtual
+
+ +

Updates the hash with more data.

+
Parameters
+ + + +
dataData to be hashed.
lenNumber of bytes of data to be hashed.
+
+
+

If finalize() has already been called, then the behavior of update() will be undefined. Call reset() first to start a new hashing process.

+
See Also
reset(), finalize()
+ +

Implements Hash.

+ +

Definition at line 79 of file SHA512.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSHA512.png b/html/classSHA512.png new file mode 100644 index 00000000..2375ded7 Binary files /dev/null and b/html/classSHA512.png differ diff --git a/html/classSoftI2C-members.html b/html/classSoftI2C-members.html new file mode 100644 index 00000000..c605dcc3 --- /dev/null +++ b/html/classSoftI2C-members.html @@ -0,0 +1,109 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
SoftI2C Member List
+
+
+ +

This is the complete list of members for SoftI2C, including all inherited members.

+ + + + + + + + + +
available()SoftI2Cvirtual
endWrite()SoftI2Cvirtual
maxTransferSize() const SoftI2Cvirtual
read()SoftI2Cvirtual
SoftI2C(uint8_t dataPin, uint8_t clockPin)SoftI2C
startRead(unsigned int address, unsigned int count)SoftI2Cvirtual
startWrite(unsigned int address)SoftI2Cvirtual
write(uint8_t value)SoftI2Cvirtual
+ + + + diff --git a/html/classSoftI2C.html b/html/classSoftI2C.html new file mode 100644 index 00000000..5b2d7281 --- /dev/null +++ b/html/classSoftI2C.html @@ -0,0 +1,354 @@ + + + + + + +ArduinoLibs: SoftI2C Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
SoftI2C Class Reference
+
+
+ +

Bit-banged implementation of an I2C master. + More...

+ +

#include <SoftI2C.h>

+
+Inheritance diagram for SoftI2C:
+
+
+ + +I2CMaster + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

SoftI2C (uint8_t dataPin, uint8_t clockPin)
 Constructs a new software I2C master on dataPin and clockPin.
 
+unsigned int maxTransferSize () const
 Returns the maximum number of bytes that can be read or written in a single request by this bus master.
 
void startWrite (unsigned int address)
 Starts a write operation by sending a start condition and the I2C control byte. More...
 
void write (uint8_t value)
 Writes a single byte value on the I2C bus. More...
 
bool endWrite ()
 Ends the current write operation. More...
 
bool startRead (unsigned int address, unsigned int count)
 Starts a read operation for count bytes by sending the start condition and the I2C control byte. More...
 
unsigned int available ()
 Returns the number of bytes that are still available for reading. More...
 
uint8_t read ()
 Reads a single byte from the I2C bus. More...
 
+

Detailed Description

+

Bit-banged implementation of an I2C master.

+

This class implements the I2C master protocol on any arbitrary pair of data and clock pins. It is not restricted to pre-defined pins as is the case for the standard Arduino two-wire interface.

+

This implementation only implements the master side of the protocol. It assumes that there is a single bus master, no arbitration, and no clock stretching.

+
See Also
I2CMaster
+ +

Definition at line 28 of file SoftI2C.h.

+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
unsigned int SoftI2C::available ()
+
+virtual
+
+ +

Returns the number of bytes that are still available for reading.

+
See Also
startRead(), read()
+ +

Implements I2CMaster.

+ +

Definition at line 155 of file SoftI2C.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool SoftI2C::endWrite ()
+
+virtual
+
+ +

Ends the current write operation.

+

Returns true if the write operation was acknowledged; false otherwise.

+
See Also
startWrite(), write()
+ +

Implements I2CMaster.

+ +

Definition at line 129 of file SoftI2C.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
uint8_t SoftI2C::read ()
+
+virtual
+
+ +

Reads a single byte from the I2C bus.

+
See Also
startRead(), available()
+ +

Implements I2CMaster.

+ +

Definition at line 160 of file SoftI2C.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool SoftI2C::startRead (unsigned int address,
unsigned int count 
)
+
+virtual
+
+ +

Starts a read operation for count bytes by sending the start condition and the I2C control byte.

+

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

+

Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by count calls to read() to fetch the bytes.

+
See Also
available(), read(), startWrite()
+ +

Implements I2CMaster.

+ +

Definition at line 135 of file SoftI2C.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void SoftI2C::startWrite (unsigned int address)
+
+virtual
+
+ +

Starts a write operation by sending a start condition and the I2C control byte.

+

The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

+
See Also
write(), endWrite(), startRead()
+ +

Reimplemented from I2CMaster.

+ +

Definition at line 104 of file SoftI2C.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void SoftI2C::write (uint8_t value)
+
+virtual
+
+ +

Writes a single byte value on the I2C bus.

+
See Also
startWrite(), endWrite()
+ +

Implements I2CMaster.

+ +

Definition at line 118 of file SoftI2C.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classSoftI2C.png b/html/classSoftI2C.png new file mode 100644 index 00000000..6094e88e Binary files /dev/null and b/html/classSoftI2C.png differ diff --git a/html/classTextField-members.html b/html/classTextField-members.html new file mode 100644 index 00000000..f3ce5433 --- /dev/null +++ b/html/classTextField-members.html @@ -0,0 +1,117 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
TextField Member List
+
+
+ +

This is the complete list of members for TextField, including all inherited members.

+ + + + + + + + + + + + + + + + + +
dispatch(int event)Fieldvirtual
enterField(bool reverse)TextFieldvirtual
exitField()Fieldvirtual
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
isCurrent() const Field
label() const Fieldinline
lcd() const Fieldinlineprotected
setLabel(const String &label)Field
setValue(const String &value)TextField
TextField(const String &label)TextFieldexplicit
TextField(Form &form, const String &label, const String &value)TextField
updateCursor()Fieldprotectedvirtual
value() const TextFieldinline
~Field()Field
+ + + + diff --git a/html/classTextField.html b/html/classTextField.html new file mode 100644 index 00000000..1d7582a1 --- /dev/null +++ b/html/classTextField.html @@ -0,0 +1,351 @@ + + + + + + +ArduinoLibs: TextField Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
TextField Class Reference
+
+
+ +

Field that displays a read-only text value. + More...

+ +

#include <TextField.h>

+
+Inheritance diagram for TextField:
+
+
+ + +Field + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 TextField (const String &label)
 Constructs a new text field with a specific label. More...
 
 TextField (Form &form, const String &label, const String &value)
 Constructs a new text field with a specific label and value attaches it to a form. More...
 
void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
const String & value () const
 Returns the text value that is currently displayed by this field. More...
 
void setValue (const String &value)
 Sets the text value that is displayed by this field. More...
 
- Public Member Functions inherited from Field
 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
virtual int dispatch (int event)
 Dispatches event via this field. More...
 
virtual void exitField ()
 Exits the field due to form navigation. More...
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Field
+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+

Detailed Description

+

Field that displays a read-only text value.

+

This following example displays a text field with the label "Form example" and a value() of "v1.0".

+
Form mainForm(lcd);
+
TextField welcomeField(mainForm, "Form example", "v1.0");
+
+FormText.png +
+

As well as static messages, TextField can be used to display read-only information that is computed at runtime:

+
TextField timeField(mainForm, "Time since reset", "0");
+
+
void loop() {
+
timeField.setValue(millis() / 1000);
+
mainForm.dispatch(lcd.getButton());
+
}
+

For writable fields, use BoolField, IntField, or TimeField.

+
See Also
Field
+ +

Definition at line 28 of file TextField.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
TextField::TextField (const String & label)
+
+explicit
+
+ +

Constructs a new text field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+

The initial value() will be the empty string.

+
See Also
Form::addField()
+ +

Definition at line 66 of file TextField.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TextField::TextField (Formform,
const String & label,
const String & value 
)
+
+ +

Constructs a new text field with a specific label and value attaches it to a form.

+
See Also
value()
+ +

Definition at line 77 of file TextField.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
void TextField::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented from Field.

+ +

Definition at line 83 of file TextField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void TextField::setValue (const String & value)
+
+ +

Sets the text value that is displayed by this field.

+
See Also
value()
+ +

Definition at line 102 of file TextField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
const String & TextField::value () const
+
+inline
+
+ +

Returns the text value that is currently displayed by this field.

+
See Also
setValue()
+ +

Definition at line 35 of file TextField.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classTextField.png b/html/classTextField.png new file mode 100644 index 00000000..837289a6 Binary files /dev/null and b/html/classTextField.png differ diff --git a/html/classTimeField-members.html b/html/classTimeField-members.html new file mode 100644 index 00000000..cf11b00e --- /dev/null +++ b/html/classTimeField-members.html @@ -0,0 +1,121 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
TimeField Member List
+
+
+ +

This is the complete list of members for TimeField, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + +
dispatch(int event)TimeFieldvirtual
enterField(bool reverse)TimeFieldvirtual
exitField()TimeFieldvirtual
Field(const String &label)Fieldexplicit
Field(Form &form, const String &label)Field
form() const Fieldinline
isCurrent() const Field
label() const Fieldinline
lcd() const Fieldinlineprotected
maxHours() const TimeFieldinline
readOnly() const TimeFieldinline
setLabel(const String &label)Field
setMaxHours(int maxHours)TimeFieldinline
setReadOnly(bool value)TimeField
setValue(unsigned long value)TimeField
TimeField(const String &label)TimeFieldexplicit
TimeField(Form &form, const String &label, int maxHours, bool readOnly)TimeField
updateCursor()Fieldprotectedvirtual
value() const TimeFieldinline
~Field()Field
+ + + + diff --git a/html/classTimeField.html b/html/classTimeField.html new file mode 100644 index 00000000..21d65f57 --- /dev/null +++ b/html/classTimeField.html @@ -0,0 +1,549 @@ + + + + + + +ArduinoLibs: TimeField Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
TimeField Class Reference
+
+
+ +

Field that manages the display and editing of a time value. + More...

+ +

#include <TimeField.h>

+
+Inheritance diagram for TimeField:
+
+
+ + +Field + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 TimeField (const String &label)
 Constructs a new time field with a specific label. More...
 
 TimeField (Form &form, const String &label, int maxHours, bool readOnly)
 Constructs a new boolean field with a specific label and attaches it to a form. More...
 
int dispatch (int event)
 Dispatches event via this field. More...
 
void enterField (bool reverse)
 Enters the field due to form navigation. More...
 
void exitField ()
 Exits the field due to form navigation. More...
 
unsigned long value () const
 Returns the current value of this time field, in seconds. More...
 
void setValue (unsigned long value)
 Sets the value of this time field, in seconds. More...
 
int maxHours () const
 Returns the maximum number of hours before the field wraps around. More...
 
void setMaxHours (int maxHours)
 Sets the maximum number of hours before the field wraps around to maxHours. More...
 
bool readOnly () const
 Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false). More...
 
void setReadOnly (bool value)
 Sets the read-only state of this field to value. More...
 
- Public Member Functions inherited from Field
 Field (const String &label)
 Constructs a new field with a specific label. More...
 
Field (Form &form, const String &label)
 Constructs a new field with a specific label and attaches it to a form.
 
 ~Field ()
 Destroys this field and removes it from its owning Form. More...
 
+Formform () const
 Returns the Form that owns this field; null if not associated with a Form.
 
const String & label () const
 Returns the label to display in the first line of this field. More...
 
void setLabel (const String &label)
 Sets the label to display in the first line of this field. More...
 
bool isCurrent () const
 Returns true if this field is the currently-displayed field in its owning form; false otherwise. More...
 
+ + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from Field
+LiquidCrystal * lcd () const
 Returns the LCD that this field is being drawn on.
 
virtual void updateCursor ()
 Updates the cursor position after the label has been drawn by setLabel(). More...
 
+

Detailed Description

+

Field that manages the display and editing of a time value.

+

TimeField is suitable for displaying wall clock time in 24-hour format, or for displaying timeouts and durations in seconds. Times are specified in seconds as an unsigned long value. They are displayed as HH:MM:SS, for hours, minutes, and seconds.

+

The time field can be either read-only or read-write. When read-write, the Up, Down, Left, and Right buttons can be used to modify the hour, minute, and second components of the time value.

+

The following example displays the number of hours, minutes, and seconds since the device was reset, wrapping around after 24 hours:

+
Form mainForm(lcd);
+
TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
+
+
void loop() {
+
timeField.setValue(millis() / 1000);
+
mainForm.dispatch(lcd.getButton());
+
}
+
+FormTimeRO.png +
+

A read-write field can be used to ask the user for the duration of an application count-down timer:

+
TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
+
+FormTimeRW.png +
+
See Also
Field
+ +

Definition at line 31 of file TimeField.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
TimeField::TimeField (const String & label)
+
+explicit
+
+ +

Constructs a new time field with a specific label.

+

The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

+

Initially value() is 0, maxHours() is 24, and isReadOnly() is TIMEFIELD_READ_WRITE.

+
See Also
Form::addField()
+ +

Definition at line 82 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TimeField::TimeField (Formform,
const String & label,
int maxHours,
bool readOnly 
)
+
+ +

Constructs a new boolean field with a specific label and attaches it to a form.

+

The initial value() of the field will be 0. The value() will be limited to be less than maxHours * 60 * 60 seconds.

+

If readOnly is TIMEFIELD_READ_ONLY, then the field will display times but not allow them to be modified by the user. If readOnly is TIMEFIELD_READ_WRITE, then the field will modifiable by the user.

+
See Also
value()
+ +

Definition at line 105 of file TimeField.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
int TimeField::dispatch (int event)
+
+virtual
+
+ +

Dispatches event via this field.

+

The event is usually obtained from LCD::getButton().

+

Returns zero if the event has been handled and no further action is required.

+

Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

+

Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

+
See Also
Form::dispatch(), LCD::getButton()
+ +

Reimplemented from Field.

+ +

Definition at line 115 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void TimeField::enterField (bool reverse)
+
+virtual
+
+ +

Enters the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

+

This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

+

The default implementation prints the label().

+
See Also
exitField()
+ +

Reimplemented from Field.

+ +

Definition at line 193 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void TimeField::exitField ()
+
+virtual
+
+ +

Exits the field due to form navigation.

+

This function is typically called when the user presses Left and Right buttons to navigate from the field.

+
See Also
enterField()
+ +

Reimplemented from Field.

+ +

Definition at line 205 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int TimeField::maxHours () const
+
+inline
+
+ +

Returns the maximum number of hours before the field wraps around.

+
See Also
setMaxHours(), setValue()
+ +

Definition at line 44 of file TimeField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool TimeField::readOnly () const
+
+inline
+
+ +

Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).

+
See Also
setReadOnly()
+ +

Definition at line 47 of file TimeField.h.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void TimeField::setMaxHours (int maxHours)
+
+inline
+
+ +

Sets the maximum number of hours before the field wraps around to maxHours.

+
See Also
maxHours(), setValue()
+ +

Definition at line 45 of file TimeField.h.

+ +
+
+ +
+
+ + + + + + + + +
void TimeField::setReadOnly (bool value)
+
+ +

Sets the read-only state of this field to value.

+

The value should be one of TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false). Use of the named constants is recommended.

+
See Also
readOnly()
+ +

Definition at line 268 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + + + + +
void TimeField::setValue (unsigned long value)
+
+ +

Sets the value of this time field, in seconds.

+

If value is greater than or equal to maxHours() * 60 * 60, then it will be wrapped around to fall within the valid range.

+
See Also
value(), maxHours()
+ +

Definition at line 227 of file TimeField.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
unsigned long TimeField::value () const
+
+inline
+
+ +

Returns the current value of this time field, in seconds.

+
See Also
setValue()
+ +

Definition at line 41 of file TimeField.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classTimeField.png b/html/classTimeField.png new file mode 100644 index 00000000..58edd40f Binary files /dev/null and b/html/classTimeField.png differ diff --git a/html/classTransistorNoiseSource-members.html b/html/classTransistorNoiseSource-members.html new file mode 100644 index 00000000..bdbe601e --- /dev/null +++ b/html/classTransistorNoiseSource-members.html @@ -0,0 +1,108 @@ + + + + + + +ArduinoLibs: Member List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
TransistorNoiseSource Member List
+
+
+ +

This is the complete list of members for TransistorNoiseSource, including all inherited members.

+ + + + + + + + +
calibrating() const TransistorNoiseSourcevirtual
NoiseSource()NoiseSource
output(const uint8_t *data, size_t len, unsigned int credit)NoiseSourceprotectedvirtual
stir()TransistorNoiseSourcevirtual
TransistorNoiseSource(uint8_t pin)TransistorNoiseSourceexplicit
~NoiseSource()NoiseSourcevirtual
~TransistorNoiseSource() (defined in TransistorNoiseSource)TransistorNoiseSourcevirtual
+ + + + diff --git a/html/classTransistorNoiseSource.html b/html/classTransistorNoiseSource.html new file mode 100644 index 00000000..e483f80d --- /dev/null +++ b/html/classTransistorNoiseSource.html @@ -0,0 +1,285 @@ + + + + + + +ArduinoLibs: TransistorNoiseSource Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+Public Member Functions | +List of all members
+
+
TransistorNoiseSource Class Reference
+
+
+ +

Processes the signal from a transistor-based noise source. + More...

+ +

#include <TransistorNoiseSource.h>

+
+Inheritance diagram for TransistorNoiseSource:
+
+
+ + +NoiseSource + +
+ + + + + + + + + + + + + + + + + + +

+Public Member Functions

 TransistorNoiseSource (uint8_t pin)
 Constructs a new transitor-based noise source handler. More...
 
bool calibrating () const
 Determine if the noise source is still calibrating itself. More...
 
void stir ()
 Stirs entropy from this noise source into the global random number pool. More...
 
- Public Member Functions inherited from NoiseSource
NoiseSource ()
 Constructs a new random noise source.
 
+virtual ~NoiseSource ()
 Destroys this random noise source.
 
+ + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from NoiseSource
virtual void output (const uint8_t *data, size_t len, unsigned int credit)
 Called from subclasses to output noise to the global random number pool. More...
 
+

Detailed Description

+

Processes the signal from a transistor-based noise source.

+

This class processes input from a transistor-based noise source, such as that described by Rob Seward. See that Web page for full details on how such noise sources work, how the output should be used, and caveats for the unwary. For convenience, Rob's circuit is reproduced below:

+
+transistor_noise_source.png +
+

The following example shows how to initialize a transistor-based noise source and use it with RNG. The noise is read from the A1 pin on the Arduino and stirred into the random number pool on a regular basis. For more information, see the documentation for RNG.

+
#include <Crypto.h>
+
#include <RNG.h>
+
#include <TransistorNoiseSource.h>
+
+
// Noise source to seed the random number generator.
+ +
+
void setup() {
+
// Initialize the random number generator with the application tag
+
// "MyApp 1.0" and load the previous seed from EEPROM address 500.
+
RNG.begin("MyApp 1.0", 500);
+
+
// Add the noise source to the list of sources known to RNG.
+
RNG.addNoiseSource(noise);
+
+
// ...
+
}
+
+
void loop() {
+
// ...
+
+
// Perform regular housekeeping on the random number generator.
+
RNG.loop();
+
+
// ...
+
}
+
See Also
RNG, NoiseSource, RingOscillatorNoiseSource
+ +

Definition at line 29 of file TransistorNoiseSource.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + +
+ + + + + + + + +
TransistorNoiseSource::TransistorNoiseSource (uint8_t pin)
+
+explicit
+
+ +

Constructs a new transitor-based noise source handler.

+
Parameters
+ + +
pinThe analog input pin that the noise will appear on.
+
+
+ +

Definition at line 138 of file TransistorNoiseSource.cpp.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
bool TransistorNoiseSource::calibrating () const
+
+virtual
+
+ +

Determine if the noise source is still calibrating itself.

+
Returns
Returns true if calibration is in progress; false if the noise source is generating valid random data.
+

Noise sources that require calibration start doing so at system startup and then switch over to random data generation once calibration is complete. Since no random data is being generated during calibration, the output from RNG.rand() may be predictable. Use RNG.available() to determine when sufficient entropy is available to generate good random values.

+

It is possible that the noise source never exits calibration. This can happen if the input voltage is insufficient to trigger noise or if the noise source is not connected. Noise sources may also periodically recalibrate themselves.

+
See Also
stir()
+ +

Implements NoiseSource.

+ +

Definition at line 156 of file TransistorNoiseSource.cpp.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void TransistorNoiseSource::stir ()
+
+virtual
+
+ +

Stirs entropy from this noise source into the global random number pool.

+

This function should call output() to add the entropy from this noise source to the global random number pool.

+

The noise source should batch up the entropy data, providing between 16 and 48 bytes of data each time. If the noise source does not have sufficient entropy data at the moment, it should return without stiring the current data in.

+
See Also
calibrating(), output()
+ +

Implements NoiseSource.

+ +

Definition at line 161 of file TransistorNoiseSource.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/classTransistorNoiseSource.png b/html/classTransistorNoiseSource.png new file mode 100644 index 00000000..7bbe617d Binary files /dev/null and b/html/classTransistorNoiseSource.png differ diff --git a/html/classes.html b/html/classes.html new file mode 100644 index 00000000..50eda519 --- /dev/null +++ b/html/classes.html @@ -0,0 +1,137 @@ + + + + + + +ArduinoLibs: Class Index + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
Class Index
+
+
+
A | B | C | D | E | F | H | I | K | L | M | N | O | R | S | T
+ + + + + + + + + + + + + + + + + + + + +
  A  
+
CFB   
  F  
+
ListField   RTCTime   
CFBCommon   
  M  
+
  S  
+
AES128   ChaCha   Field   
AES192   Charlieplex   Form   Melody   SHA1   
AES256   ChaseLEDs   
  H  
+
  N  
+
SHA256   
AESCommon   Cipher   SHA3_256   
  B  
+
CTR   Hash   NoiseSource   SHA3_512   
CTRCommon   
  I  
+
  O  
+
SHA512   
Bitmap   Curve25519   SoftI2C   
BLAKE2b   
  D  
+
I2CMaster   OFB   
  T  
+
BLAKE2s   IntField   OFBCommon   
BlinkLED   DMD   IRreceiver   
  R  
+
TextField   
BlockCipher   DS1307RTC   
  K  
+
TimeField   
BoolField   DS3231RTC   RingOscillatorNoiseSource   TransistorNoiseSource   
  C  
+
DS3232RTC   KeccakCore   RNGClass   
  E  
+
  L  
+
RTC   
CBC   RTCAlarm   
CBCCommon   EEPROM24   LCD   RTCDate   
+
A | B | C | D | E | F | H | I | K | L | M | N | O | R | S | T
+
+ + + + diff --git a/html/clock_shield.jpg b/html/clock_shield.jpg new file mode 100644 index 00000000..0d4673d4 Binary files /dev/null and b/html/clock_shield.jpg differ diff --git a/html/closed.png b/html/closed.png new file mode 100644 index 00000000..98cc2c90 Binary files /dev/null and b/html/closed.png differ diff --git a/html/crypto-rng-ring_8dox.html b/html/crypto-rng-ring_8dox.html new file mode 100644 index 00000000..1f9bc249 --- /dev/null +++ b/html/crypto-rng-ring_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: crypto-rng-ring.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
crypto-rng-ring.dox File Reference
+
+
+
+ + + + diff --git a/html/crypto-rng_8dox.html b/html/crypto-rng_8dox.html new file mode 100644 index 00000000..171b4ddb --- /dev/null +++ b/html/crypto-rng_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: crypto-rng.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
crypto-rng.dox File Reference
+
+
+
+ + + + diff --git a/html/crypto.html b/html/crypto.html new file mode 100644 index 00000000..b0c1fd48 --- /dev/null +++ b/html/crypto.html @@ -0,0 +1,153 @@ + + + + + + +ArduinoLibs: Cryptographic Library + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Cryptographic Library
+
+
+

+Supported Algorithms

+ +

All cryptographic algorithms have been optimized for 8-bit Arduino platforms like the Uno. Memory usage is also reduced, particularly for SHA1, SHA256, and SHA512 which save 256, 192, and 512 bytes respectively over traditional implementations. For all algorithms, static sbox tables and the like are placed into program memory to further reduce data memory usage.

+

ChaCha with 20 rounds and 256-bit keys is the recommended symmetric encryption algorithm because it is twice as fast as AES128, constant-time, and much more secure. AES128, AES192, and AES256 are provided for use in applications where compatibility with other systems is desirable.

+

BLAKE2s and BLAKE2b are variations on the ChaCha stream cipher, designed for hashing, with 256-bit and 512-bit hash outputs respectively. They are intended as high performance replacements for SHA256 and SHA512 for when speed is critical but exact bit-compatibility of hash values is not.

+

+Examples and other topics

+ +

+Performance

+

All figures are for the Arduino Uno running at 16 MHz. Figures for the Ardunino Mega 2560 running at 16 MHz are similar:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AlgorithmEncryption / Hashing (per byte)Decryption (per byte)Key SetupState Size (bytes)
AES128 (ECB mode)36.90us66.48us160.00us208
AES192 (ECB mode)44.20us80.35us166.54us240
AES256 (ECB mode)51.50us94.22us227.97us272
ChaCha (20 rounds)14.87us14.88us43.74us130
ChaCha (12 rounds)10.38us10.38us43.74us130
ChaCha (8 rounds)8.13us8.14us43.74us130
SHA121.90us93
SHA25643.85us105
SHA512123.24us209
SHA3_256121.69us403
SHA3_512229.12us403
BLAKE2s18.54us169
BLAKE2b50.58us337
+

Where a cipher supports more than one key size (such as ChaCha), the values are typically almost identical for 128-bit and 256-bit keys so only the maximum is shown above.

+

Public key algorithms have the following results on an Arduino Uno:

+ + + + + + + + + +
AlgorithmOperationTimeComment
Curve25519eval()3738 msRaw curve evaluation
Curve25519dh1()3740 msFirst half of Diffie-Hellman key agreement
Curve25519dh2()3738 msSecond half of Diffie-Hellman key agreement
+
+ + + + diff --git a/html/crypto_8dox.html b/html/crypto_8dox.html new file mode 100644 index 00000000..f019c86f --- /dev/null +++ b/html/crypto_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: crypto.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
crypto.dox File Reference
+
+
+
+ + + + diff --git a/html/crypto_rng.html b/html/crypto_rng.html new file mode 100644 index 00000000..f9051d30 --- /dev/null +++ b/html/crypto_rng.html @@ -0,0 +1,190 @@ + + + + + + +ArduinoLibs: Generating random numbers + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Generating random numbers
+
+
+

Random numbers are one of the most important aspects of secure cryptography. Without a good source of random numbers it may be possible for an attacker to predict the encryption and authentication keys that are used to protect a session, or to predict the private component of a public/private key pair. This is especially difficult in embedded environments that do not have input sources like keystrokes, mouse movements, disk drive write times, etc to collect entropy from the user.

+

+Features of the random number generator

+

This library provides the RNG class to manage the global random number pool. It has the following features:

+ +

The whitening function and the PRNG are based on ChaCha::hashCore() with 20 rounds. The structure of the PRNG is very similar to OpenBSD's ChaCha20-based arc4random() implementation.

+

+Standard noise sources

+

The library provides two standard noise sources:

+ +

The transistor design needs an input voltage of 10 to 15 VDC to trigger the avalanche effect, which can sometimes be difficult in a 5V Arduino environment. The ring oscillator design can run at 5V but the quality of the noise is less than for the transistor design. The RingOscillatorNoiseSource class attempts to make up for this by collecting more input bits for the same amount of output entropy. See this page for more information on ring oscillators.

+

For both of the standard noise sources, the system should have enough entropy to safely generate 256 bits of key material about 3 to 4 seconds after startup. This is sufficient to create a private key for Curve25519 for example.

+

If you are unsure which noise source to use, then I suggest TransistorNoiseSource as Rob's design has had more review. Another approach is to mix multiple noise sources together to get the best of both worlds.

+

+Initializing the random number generator

+

To use the random number generator, both RNG and a noise source must first be initialized. We start by including the necessary libraries:

+
#include <Crypto.h>
+
#include <RNG.h>
+
#include <TransistorNoiseSource.h>
+

Next we create a global variable for the noise source and specify the I/O pin that the noise circuit is connected to:

+

Then in the setup() function we call RNG.begin() to start the random number generator running and call RNG.addNoiseSource() to register all of the application's noise sources:

+
void setup() {
+
// Initialize the random number generator with the application tag
+
// "MyApp 1.0" and load the previous seed from EEPROM address 500.
+
RNG.begin("MyApp 1.0", 500);
+
+
// Add the noise source to the list of sources known to RNG.
+
RNG.addNoiseSource(noise);
+
+
// ...
+
}
+

The begin() function is passed two arguments: a tag string that should be different for every application and an EEPROM address to use to load and save the random number seed. The tag string ensures that different applications and versions will generate different random numbers upon first boot before the noise source has collected any entropy. If the device also has a unique serial number or a MAC address, then those can be mixed in during the setup() function after calling begin():

+
void setup() {
+
RNG.begin("MyApp 1.0", 500);
+
RNG.stir(serial_number, sizeof(serial_number));
+
RNG.stir(mac_address, sizeof(mac_address));
+
RNG.addNoiseSource(noise);
+
...
+
}
+

The random number generator needs 49 bytes of EEPROM space at the specified address to store the previous seed. When the system is started next time, the previous saved seed is loaded and then deliberately overwritten with a new seed. This ensures that the device will not accidentally generate the same sequence of random numbers if it is restarted before a new seed can be saved.

+

By default the seed is saved once an hour, although this can be changed with RNG.setAutoSaveTime(). Because the device may be restarted before the first hour expires, there is a special case in the code: the first time that the entropy pool fills up, a save will be automatically forced.

+

To use the random number generator properly, there are some regular tasks that must be performed every time around the application's main loop(). Newly accumulated noise must be mixed in and auto-saves must be performed on a regular basis. The RNG.loop() function takes care of these tasks for us:

+
void loop() {
+
// ...
+
+
// Perform regular housekeeping on the random number generator.
+
RNG.loop();
+
+
// ...
+
}
+

The random number generator is now ready to generate data.

+

+Generating data with the random number generator

+

Whenever the application needs random data, it calls RNG.rand() with a buffer to fill. The following example generates a 256-bit encryption key and a 128-bit initialization vector; e.g. for use with AES256 in CTR mode:

+
byte key[32];
+
byte iv[16];
+
+
void generateKeys() {
+
RNG.rand(key, sizeof(key));
+
RNG.rand(iv, sizeof(iv));
+
}
+

The data will be generated immediately, using whatever entropy happens to be in the global random number pool at the time. In Linux terms, the rand() function acts like the /dev/urandom device.

+

If the system has been running for a while then this should be safe as the noise source would have already permuted the pool with noise-based entropy. However, when the system first starts up there may not be much entropy available other than that from the saved seed (which could have been compromised).

+

In Linux terms we want the effect of the /dev/random device which blocks until sufficient entropy is available to service the request. Blocking isn't compatible with the Arduino way of doing things, so the library instead provides the RNG.available() function to poll how much entropy is in the global random number pool:

+
byte key[32];
+
byte iv[16];
+
bool haveKeys = false;
+
+
void generateKeys() {
+
if (!haveKeys && RNG.available(sizeof(key) + sizeof(iv))) {
+
RNG.rand(key, sizeof(key));
+
RNG.rand(iv, sizeof(iv));
+
haveKeys = true;
+
}
+
}
+

This feature should allow applications to generate secret material safely at startup. The application may want to implement a timeout: if the application has to wait too long to generate a key then the noise source may be disconnected or faulty.

+

The global random number pool can hold up to 48 bytes, or 384 bits, of entropy. Requests for more than 384 bits will be allowed if the entropy is at maximum. That is, a request for 64 bytes (512 bits) of data will be allowed when there is only 384 bits of entropy in the pool. This behaviour prevents the application from waiting indefinitely if the request is too large.

+

If the application truly needs more than 384 bits of real entropy (e.g. to generate a public/private key pair for an algorithm like RSA), then it should break the request up into smaller chunks and poll available() for each chunk.

+

+Destroying secret data

+

When the application is finished with the secret key material and plaintext, it should destroy the data to remove it from RAM permanently. The memset() function can be used for this purpose:

+
memset(key, 0, sizeof(key));
+
memset(iv, 0, sizeof(iv));
+

However, this may not be safe. Optimizing compilers have been known to optimize away memset() calls if the compiler thinks that the value won't be used again. A safer method is to use the clean() function in the library:

+
clean(key);
+
clean(iv);
+

The clean() function attempts to implement the memory clear in a way that the compiler shouldn't optimize away. By default the clean() function figures out the size of the buffer itself at compile time. In some cases (e.g. buffers that are passed by pointer), it may be necessary to specify the size manually:

+
clean(key, 32);
+
clean(iv, 16);
+
+ + + + diff --git a/html/crypto_rng_ring.html b/html/crypto_rng_ring.html new file mode 100644 index 00000000..946ad738 --- /dev/null +++ b/html/crypto_rng_ring.html @@ -0,0 +1,159 @@ + + + + + + +ArduinoLibs: Ring Oscillator Noise Sources + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Ring Oscillator Noise Sources
+
+
+

This page discusses how to construct and use a noise source based on the jitter from a ring oscillator. The circuit here is very simple: more complex ring oscillator designs are possible and may give better results.

+
Note
The output from a ring oscillator is not generally as good as a "true" noise source. The oscillation can easily settle into regular patterns or sync up with other clock sources on the board. It is even possible to "hack" a ring oscillator by injecting chosen frequencies on the power supply rails to force the oscillation into a predictable waveform (see this paper for an example). It is very important that the output of this class be whitened with RNG before it is used for cryptography and that the device is isolated from attacker-controlled sources of power. Unless you have a very good reason to use a ring oscillator, TransistorNoiseSource is usually a better option.
+

+Ring oscillator theory

+

A ring oscillator is formed out of an odd number of inverter gates. A 1 value on the input to the first gate will be inverted several times, resulting in a 0 value being fed back into the first gate. In turn that 0 is inverted several times to generate another 1. And so on. In schematic form, a 3-stage ring oscillator looks like this:

+
+ring_oscillator_basic.png +
+

Because electronic circuits are not instanteous devices it can take some time for the values to propagate down the inverter chain. The longer the chain (5-stage, 7-stage, 9-stage, or more) the longer the propagation delay. The important thing is that the delay is not fixed: differences in components, ambient temperature, and other factors combine to introduce a little bit of random jitter in the output waveform.

+

For our purposes, the jitter is what we are after. The timing differences from one rising edge to the the next gives us the random bits.

+

The triangular-shaped output from the final inverter isn't very friendly to microprocessors. So it is common to select out the jitter using a D flip-flop and a periodic clock signal:

+
+ring_oscillator_sampled.png +
+

Practical designs inside CPU's often use multiple ring oscillators XOR'ed together:

+
+ring_oscillator_multi.png +
+

Even after all that the output won't be uniformly random. It is necessary to whiten the output with a secure hash function before using the data for cryptography. Fortunately for us, RNG.stir() has built-in support for whitening so we just need to collect the raw bits.

+

+Our ring oscillator

+

To keep things simple, we are going to use a single 5-stage ring oscillator with a sampling clock provided by a 555 timer:

+
+ring_oscillator.png +
+

The components were deliberately chosen to be commonly available. The only special one is the 555. I recommend using the CMOS LM7555 variant (or something equivalent) instead because it can operate at higher frequencies than a garden variety 555. The 56 ohm resistor on the output of U2 inhibits ringing on the clock line: we want the noise to come from U1 not U2.

+

The frequency output from U1 will depend upon the properties of your 4069 chip. A cheap bargain bin chip is actually better than a high quality chip. Some inverter datasheets I have read proudly advertise reduced jitter but the jitter is what we are after here. My 4069 was generating about 1.7MHz with a 5-stage ring oscillator. Other chips I tried were able to exceed 12MHz with a 3-stage ring oscillator. Because the Arduino isn't fast enough to sample high frequency signals, lower is actually better for our needs.

+

To further lower the frequency to something the Arduino can measure, the 555 timer should be set to between 100kHz and 200kHz (it's ok to be a little over 200kHz). Start with an R1 value of about 2.2K and adjust it up or down to get the frequency into the target range. Also measure the output frequency from U3A and try to target between 20kHz and 50kHz. The Arduino can easily sample that without putting too much burden on the CPU. The signal should be very jittery at this point.

+

This design can of course be improved by using multiple ring oscillators and an XOR gate, but I wanted to keep the component count low for the basic design.

+

+Parts list

+ +

+Connecting to the Arduino

+

The RingOscillatorNoiseSource class uses the input capture feature of the AVR microcontroller to measure the time between successive rising edges. Input capture is only possible on certain pins and the output of the circuit above needs to be connected to the correct pin:

+ + + + + + + + + +
VariantArduino Pin / AVR PinTimer
Arduino UnoD8 / PB0Timer 1
Arduino LeonardoD4 / PD4Timer 1
Arduino Mega or Mega 2560D49 / PL0Timer 4
+

If your board is not pin-compatible with one of the above, then the source for the RingOscillatorNoiseSource class will need to be modified to use a different pin/timer combination. Also, when the timer is in use by this class it cannot be used for other application tasks.

+

The timer is set up in free-running mode to count as fast as possible. Whenever a rising edge occurs on the input signal, the timer's current value is written to a special register and an interrupt occurs. Within the interrupt service routine, the previous register value is subtracted from the current value to determine the amount of time that has elapsed between the two rising edges.

+

The jitter is extracted from the time difference in a very simple way: the lowest bit of the difference is the jitter and all other bits are discarded. The interrupt service routine collects up 16 bits of jitter over successive input pulses and then passes them to the higher level code in the RingOscillatorNoiseSource class.

+

Within the higher level code, the input bits are first debiased using the Von Neumann method to discard the parts of the signal that don't jitter very much:

+ +

The debiased bits are collected up into a 256-bit buffer. Once the buffer is full it is passed to RNG.stir() to be whitened and incorporated into the global random number pool.

+

And that's it!

+

As noted earlier, the output from a ring oscillator is not uniform. To deal with this, the RingOscillatorNoiseSource class takes a fairly conservative approach. It credits a very small amount of entropy to each full buffer, forcing the system to collect more input data to achieve full entropy.

+

My investigations showed that at 20kHz it takes about a second to generate 256 bits of good random data after Von Neumann debiasing and whitening. Two to three seconds after startup there should be enough entropy in the random number pool to generate encryption keys and other secret material safely. The RNG.available() function can be used to determine when there is enough entropy in the pool for the application's needs.

+
+ + + + diff --git a/html/dir_1586d320a3b1e622174530fde769cda9.html b/html/dir_1586d320a3b1e622174530fde769cda9.html new file mode 100644 index 00000000..6d6b7e94 --- /dev/null +++ b/html/dir_1586d320a3b1e622174530fde769cda9.html @@ -0,0 +1,110 @@ + + + + + + +ArduinoLibs: BlinkLED Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
BlinkLED Directory Reference
+
+
+ + + + + + + + + + + + + + +

+Files

file  BlinkLED.cpp [code]
 
file  BlinkLED.h [code]
 
file  Charlieplex.cpp [code]
 
file  Charlieplex.h [code]
 
file  ChaseLEDs.cpp [code]
 
file  ChaseLEDs.h [code]
 
+
+ + + + diff --git a/html/dir_48f64e79f12bd77ba047e9e436ec978c.html b/html/dir_48f64e79f12bd77ba047e9e436ec978c.html new file mode 100644 index 00000000..c0c28026 --- /dev/null +++ b/html/dir_48f64e79f12bd77ba047e9e436ec978c.html @@ -0,0 +1,130 @@ + + + + + + +ArduinoLibs: LCD Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
LCD Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  BoolField.cpp [code]
 
file  BoolField.h [code]
 
file  Field.cpp [code]
 
file  Field.h [code]
 
file  Form.cpp [code]
 
file  Form.h [code]
 
file  IntField.cpp [code]
 
file  IntField.h [code]
 
file  LCD.cpp [code]
 
file  LCD.h [code]
 
file  ListField.cpp [code]
 
file  ListField.h [code]
 
file  TextField.cpp [code]
 
file  TextField.h [code]
 
file  TimeField.cpp [code]
 
file  TimeField.h [code]
 
+
+ + + + diff --git a/html/dir_5e87a7229a108582288ef7eda1233dc3.html b/html/dir_5e87a7229a108582288ef7eda1233dc3.html new file mode 100644 index 00000000..ed6058fe --- /dev/null +++ b/html/dir_5e87a7229a108582288ef7eda1233dc3.html @@ -0,0 +1,102 @@ + + + + + + +ArduinoLibs: PowerSave Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
PowerSave Directory Reference
+
+
+ + + + + + +

+Files

file  PowerSave.cpp [code]
 
file  PowerSave.h [code]
 
+
+ + + + diff --git a/html/dir_6591a2127a29f6cea3994dcb5b0596d1.html b/html/dir_6591a2127a29f6cea3994dcb5b0596d1.html new file mode 100644 index 00000000..6fdf4541 --- /dev/null +++ b/html/dir_6591a2127a29f6cea3994dcb5b0596d1.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: DMD Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
DMD Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + +

+Files

file  Bitmap.cpp [code]
 
file  Bitmap.h [code]
 
file  DejaVuSans9.h [code]
 
file  DejaVuSansBold9.h [code]
 
file  DejaVuSansItalic9.h [code]
 
file  DMD.cpp [code]
 
file  DMD.h [code]
 
file  Mono5x7.h [code]
 
+
+ + + + diff --git a/html/dir_9a34040863d1190c0e01b23e6b44de01.html b/html/dir_9a34040863d1190c0e01b23e6b44de01.html new file mode 100644 index 00000000..eb8fada6 --- /dev/null +++ b/html/dir_9a34040863d1190c0e01b23e6b44de01.html @@ -0,0 +1,104 @@ + + + + + + +ArduinoLibs: IR Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
IR Directory Reference
+
+
+ + + + + + + + +

+Files

file  IRreceiver.cpp [code]
 
file  IRreceiver.h [code]
 
file  RC5.h [code]
 
+
+ + + + diff --git a/html/dir_bc0718b08fb2015b8e59c47b2805f60c.html b/html/dir_bc0718b08fb2015b8e59c47b2805f60c.html new file mode 100644 index 00000000..41a5ad21 --- /dev/null +++ b/html/dir_bc0718b08fb2015b8e59c47b2805f60c.html @@ -0,0 +1,116 @@ + + + + + + +ArduinoLibs: libraries Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
libraries Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Directories

directory  BlinkLED
 
directory  Crypto
 
directory  DMD
 
directory  I2C
 
directory  IR
 
directory  LCD
 
directory  Melody
 
directory  PowerSave
 
directory  RTC
 
+
+ + + + diff --git a/html/dir_be059bf9978ae156837504b1b8a7568c.html b/html/dir_be059bf9978ae156837504b1b8a7568c.html new file mode 100644 index 00000000..672ab798 --- /dev/null +++ b/html/dir_be059bf9978ae156837504b1b8a7568c.html @@ -0,0 +1,102 @@ + + + + + + +ArduinoLibs: Melody Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Melody Directory Reference
+
+
+ + + + + + +

+Files

file  Melody.cpp [code]
 
file  Melody.h [code]
 
+
+ + + + diff --git a/html/dir_e2ce51835550ba18edf07a8311722290.html b/html/dir_e2ce51835550ba18edf07a8311722290.html new file mode 100644 index 00000000..730f0780 --- /dev/null +++ b/html/dir_e2ce51835550ba18edf07a8311722290.html @@ -0,0 +1,192 @@ + + + + + + +ArduinoLibs: Crypto Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
Crypto Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  AES.h [code]
 
file  AES128.cpp [code]
 
file  AES192.cpp [code]
 
file  AES256.cpp [code]
 
file  AESCommon.cpp [code]
 
file  BLAKE2b.cpp [code]
 
file  BLAKE2b.h [code]
 
file  BLAKE2s.cpp [code]
 
file  BLAKE2s.h [code]
 
file  BlockCipher.cpp [code]
 
file  BlockCipher.h [code]
 
file  CBC.cpp [code]
 
file  CBC.h [code]
 
file  CFB.cpp [code]
 
file  CFB.h [code]
 
file  ChaCha.cpp [code]
 
file  ChaCha.h [code]
 
file  Cipher.cpp [code]
 
file  Cipher.h [code]
 
file  Crypto.cpp [code]
 
file  Crypto.h [code]
 
file  CTR.cpp [code]
 
file  CTR.h [code]
 
file  Curve25519.cpp [code]
 
file  Curve25519.h [code]
 
file  Hash.cpp [code]
 
file  Hash.h [code]
 
file  KeccakCore.cpp [code]
 
file  KeccakCore.h [code]
 
file  NoiseSource.cpp [code]
 
file  NoiseSource.h [code]
 
file  OFB.cpp [code]
 
file  OFB.h [code]
 
file  RingOscillatorNoiseSource.cpp [code]
 
file  RingOscillatorNoiseSource.h [code]
 
file  RNG.cpp [code]
 
file  RNG.h [code]
 
file  SHA1.cpp [code]
 
file  SHA1.h [code]
 
file  SHA256.cpp [code]
 
file  SHA256.h [code]
 
file  SHA3.cpp [code]
 
file  SHA3.h [code]
 
file  SHA512.cpp [code]
 
file  SHA512.h [code]
 
file  TransistorNoiseSource.cpp [code]
 
file  TransistorNoiseSource.h [code]
 
+
+ + + + diff --git a/html/dir_f34881fcf60f680b800190d5274dfaea.html b/html/dir_f34881fcf60f680b800190d5274dfaea.html new file mode 100644 index 00000000..0f54db8a --- /dev/null +++ b/html/dir_f34881fcf60f680b800190d5274dfaea.html @@ -0,0 +1,114 @@ + + + + + + +ArduinoLibs: RTC Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
RTC Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + +

+Files

file  DS1307RTC.cpp [code]
 
file  DS1307RTC.h [code]
 
file  DS3231RTC.cpp [code]
 
file  DS3231RTC.h [code]
 
file  DS3232RTC.cpp [code]
 
file  DS3232RTC.h [code]
 
file  RTC.cpp [code]
 
file  RTC.h [code]
 
+
+ + + + diff --git a/html/dir_f9b96888882c2691b8eeaeafd1b9501d.html b/html/dir_f9b96888882c2691b8eeaeafd1b9501d.html new file mode 100644 index 00000000..05ffe78e --- /dev/null +++ b/html/dir_f9b96888882c2691b8eeaeafd1b9501d.html @@ -0,0 +1,110 @@ + + + + + + +ArduinoLibs: I2C Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ + +
+
+
+
I2C Directory Reference
+
+
+ + + + + + + + + + + + + + +

+Files

file  EEPROM24.cpp [code]
 
file  EEPROM24.h [code]
 
file  I2CMaster.cpp [code]
 
file  I2CMaster.h [code]
 
file  SoftI2C.cpp [code]
 
file  SoftI2C.h [code]
 
+
+ + + + diff --git a/html/dmd-4x1.png b/html/dmd-4x1.png new file mode 100644 index 00000000..f796bbd2 Binary files /dev/null and b/html/dmd-4x1.png differ diff --git a/html/dmd-4x2.png b/html/dmd-4x2.png new file mode 100644 index 00000000..ac0f3144 Binary files /dev/null and b/html/dmd-4x2.png differ diff --git a/html/dmd-4x3.png b/html/dmd-4x3.png new file mode 100644 index 00000000..7291057c Binary files /dev/null and b/html/dmd-4x3.png differ diff --git a/html/dmd-demo_8dox.html b/html/dmd-demo_8dox.html new file mode 100644 index 00000000..16e0a7ef --- /dev/null +++ b/html/dmd-demo_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: dmd-demo.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
dmd-demo.dox File Reference
+
+
+
+ + + + diff --git a/html/dmd-running-figure_8dox.html b/html/dmd-running-figure_8dox.html new file mode 100644 index 00000000..f36944a0 --- /dev/null +++ b/html/dmd-running-figure_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: dmd-running-figure.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
dmd-running-figure.dox File Reference
+
+
+
+ + + + diff --git a/html/dmd_demo.html b/html/dmd_demo.html new file mode 100644 index 00000000..1ac4b869 --- /dev/null +++ b/html/dmd_demo.html @@ -0,0 +1,244 @@ + + + + + + +ArduinoLibs: Dot Matrix Display Demo + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Dot Matrix Display Demo
+
+
+

This demo shows off various features of drawing with the Bitmap class to a DMD display:

+ +

RunningFigure provides another example of drawing and animating bitmaps.

+

The full source code for the demo follows:

+
/*
+
This example demonstrates how to use the DMD and related classes to
+
draw things on a Freetronics Large Dot Matrix Display.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <DMD.h>
+
#include <DejaVuSans9.h>
+
#include <DejaVuSansBold9.h>
+
#include <DejaVuSansItalic9.h>
+
#include <Mono5x7.h>
+
+
DMD display;
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer1();
+
}
+
+
void loop() {
+
drawShapes();
+
delay(1000);
+
+
drawBricks();
+
delay(1000);
+
+
drawStickFigures();
+
delay(1000);
+
+
drawText();
+
delay(1000);
+
+
drawBoldText();
+
delay(1000);
+
+
drawItalicText();
+
delay(1000);
+
+
drawMonoText();
+
delay(1000);
+
+
drawMarquee();
+
delay(500);
+
}
+
+
void drawShapes()
+
{
+
display.clear();
+
display.drawCircle(6, 8, 3);
+
display.drawFilledCircle(16, 8, 3);
+
display.drawLine(22, 5, 28, 11);
+
display.drawLine(28, 5, 22, 11);
+
display.drawRect(0, 0, display.width() - 1, display.height() - 1);
+
}
+
+
void drawBricks()
+
{
+
static const uint8_t bricks[] PROGMEM = {
+
16, 6,
+
B11111111, B11111111,
+
B10000000, B10000000,
+
B10000000, B10000000,
+
B11111111, B11111111,
+
B00001000, B00001000,
+
B00001000, B00001000
+
};
+
display.fill(0, 0, display.width(), display.height(), bricks);
+
}
+
+
void drawStickFigures()
+
{
+
static const uint8_t stickFigure[] PROGMEM = {
+
9, 13,
+
B00111110, B00000000,
+
B01000001, B00000000,
+
B01000001, B00000000,
+
B00111110, B00000000,
+
B00001000, B00000000,
+
B00001000, B00000000,
+
B11111111, B10000000,
+
B00001000, B00000000,
+
B00001000, B00000000,
+
B00010100, B00000000,
+
B00100010, B00000000,
+
B01000001, B00000000,
+
B10000000, B10000000
+
};
+
display.clear();
+
display.drawBitmap(2, 1, stickFigure);
+
display.drawInvertedBitmap(12, 1, stickFigure);
+
display.drawBitmap(22, 1, stickFigure);
+
}
+
+
void drawText()
+
{
+
display.clear();
+
display.setFont(DejaVuSans9);
+
display.drawText(0, 0, "Hello");
+
display.drawText(9, 8, "World");
+
}
+
+
void drawBoldText()
+
{
+
display.clear();
+
display.setFont(DejaVuSansBold9);
+
display.drawText(0, 0, "Hello");
+
display.drawText(4, 8, "World");
+
}
+
+
void drawItalicText()
+
{
+
display.clear();
+
display.setFont(DejaVuSansItalic9);
+
display.drawText(0, 0, "Hello");
+
display.drawText(2, 8, "World");
+
}
+
+
void drawMonoText()
+
{
+
display.clear();
+
display.setFont(Mono5x7);
+
display.drawText(0, 0, "Hello");
+
display.drawText(3, 8, "World");
+
}
+
+
static const char message[] = "Eat at Joes!";
+
+
void drawMarquee()
+
{
+
int width = display.width();
+
display.setFont(DejaVuSans9);
+
int msgWidth = display.textWidth(message);
+
int fullScroll = msgWidth + width + 1;
+
for (int x = 0; x < fullScroll; ++x) {
+
display.clear();
+
display.drawText(width - x, 3, message);
+
delay(50);
+
}
+
}
+
+ + + + diff --git a/html/dmd_running_figure.html b/html/dmd_running_figure.html new file mode 100644 index 00000000..704a536b --- /dev/null +++ b/html/dmd_running_figure.html @@ -0,0 +1,438 @@ + + + + + + +ArduinoLibs: Running figure example + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
+
Running figure example
+
+
+

This example demonstrates how to draw animated bitmaps to Freetronics Large Dot Matrix Displays. These displays have 512 LED's arranged in a 32x16 matrix and controlled by an SPI interface. The displays are available in red, blue, green, yellow, and white variations.

+

The first step is to initialize the display:

+
#include <DMD.h>
+
+
DMD display;
+

+

We will also need some bitmaps to animate the running figure. We will use static bitmaps stored in program memory. The first frame of the 10-frame animation is:

+
byte const run1[] PROGMEM = {
+
16, 16,
+
B00000000, B00001100,
+
B00000000, B00011110,
+
B00000111, B11111110,
+
B00001111, B11111110,
+
B00011100, B11111100,
+
B00000001, B11111100,
+
B00000001, B11110000,
+
B00000011, B11111000,
+
B00000111, B00011000,
+
B00001110, B01110000,
+
B00011100, B01100000,
+
B00111000, B00000000,
+
B01110000, B00000000,
+
B01100000, B00000000,
+
B01000000, B00000000,
+
B00000000, B00000000
+
};
+

+

As can be seen, the bitmap is made up of 0's and 1's; a 1 bit indicates that the corresponding LED will be lit when it is drawn to the dot matrix display. The first two bytes are the width and height of the bitmap in pixels. In this case, the first frame is 16x16 pixels. Other frames in the animation are 18x16 and 13x16.

+

We store pointers to all of the frames in a common array:

+
Bitmap::ProgMem frames[] = {
+
run1,
+
run2,
+
run3,
+
run4,
+
run5,
+
run6,
+
run7,
+
run8,
+
run9,
+
run10
+
};
+
#define NUM_FRAMES (sizeof(frames) / sizeof(frames[0]))
+
unsigned int frame = 0;
+

+

All that remains is to run the animation loop:

+
#define ADVANCE_MS (1000 / NUM_FRAMES)
+
unsigned long lastFrame;
+
+
void setup() {
+
lastFrame = millis() - ADVANCE_MS;
+
}
+
+
void loop() {
+
if ((millis() - lastFrame) >= ADVANCE_MS) {
+
display.clear();
+
int x = (32 - pgm_read_byte(frames[frame])) / 2;
+
display.drawBitmap(x, 0, frames[frame]);
+
lastFrame += ADVANCE_MS;
+
frame = (frame + 1) % NUM_FRAMES;
+
}
+
display.loop();
+
}
+

+

Each time ADVANCE_MS milliseconds expires, we clear the display and draw a bitmap centered on the screen. To help with the centering, we read the width value from the bitmap for the current frame (the height is always 16). We must also call DMD::loop() repeatedly from the application's main loop() function to ensure that the display is kept refreshed.

+

Sometimes it can be inconvenient to arrange for DMD::loop() to be called regularly. An alternative is to use Timer1 or Timer2 and interrupt-driven display refresh:

+
#define ADVANCE_MS (1000 / NUM_FRAMES)
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer1();
+
}
+
+
void loop() {
+
display.clear();
+
int x = (32 - pgm_read_byte(frames[frame])) / 2;
+
display.drawBitmap(x, 0, frames[frame]);
+
frame = (frame + 1) % NUM_FRAMES;
+
+
delay(ADVANCE_MS);
+
}
+

+

In the case of Timer2, TIMER2_OVF_vect and enableTimer2() would be used in place of TIMER1_OVF_vect and enableTimer1().

+

The full source code for the example follows:

+
/*
+
* Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
*
+
* Permission is hereby granted, free of charge, to any person obtaining a
+
* copy of this software and associated documentation files (the "Software"),
+
* to deal in the Software without restriction, including without limitation
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
* and/or sell copies of the Software, and to permit persons to whom the
+
* Software is furnished to do so, subject to the following conditions:
+
*
+
* The above copyright notice and this permission notice shall be included
+
* in all copies or substantial portions of the Software.
+
*
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
* DEALINGS IN THE SOFTWARE.
+
*/
+
+
#include <DMD.h>
+
+
DMD display;
+
+
// Running stick figure pictures are loosely based on those from this tutorial:
+
// http://www.fluidanims.com/FAelite/phpBB3/viewtopic.php?f=10&t=102
+
+
byte const run1[] PROGMEM = {
+
16, 16,
+
B00000000, B00001100,
+
B00000000, B00011110,
+
B00000111, B11111110,
+
B00001111, B11111110,
+
B00011100, B11111100,
+
B00000001, B11111100,
+
B00000001, B11110000,
+
B00000011, B11111000,
+
B00000111, B00011000,
+
B00001110, B01110000,
+
B00011100, B01100000,
+
B00111000, B00000000,
+
B01110000, B00000000,
+
B01100000, B00000000,
+
B01000000, B00000000,
+
B00000000, B00000000
+
};
+
+
byte const run2[] PROGMEM = {
+
18, 16,
+
B00000000, B01110011, B10000000,
+
B00000000, B11111111, B10000000,
+
B00000000, B00011111, B10000000,
+
B00000000, B00111111, B11000000,
+
B00000000, B01111011, B11000000,
+
B00000000, B11110011, B10000000,
+
B00000001, B11100000, B00000000,
+
B00000011, B11100000, B00000000,
+
B00000111, B01110000, B00000000,
+
B01111110, B00111000, B00000000,
+
B11111100, B00011100, B00000000,
+
B00000000, B00001110, B00000000,
+
B00000000, B00000111, B00000000,
+
B00000000, B00000011, B10000000,
+
B00000000, B00000001, B00000000,
+
B00000000, B00000000, B00000000
+
};
+
+
byte const run3[] PROGMEM = {
+
18, 16,
+
B00000000, B00110000, B00000000,
+
B00000000, B01111000, B00000000,
+
B00000000, B00011111, B00000000,
+
B00000000, B00011111, B00000000,
+
B00000000, B00111111, B10000000,
+
B00000000, B01111111, B11000000,
+
B00000000, B11100011, B10000000,
+
B00000001, B11000000, B00000000,
+
B00000011, B11100000, B00000000,
+
B11111111, B01110000, B00000000,
+
B11111110, B00111000, B00000000,
+
B00000000, B00011000, B00000000,
+
B00000000, B00011100, B00000000,
+
B00000000, B00001110, B00000000,
+
B00000000, B00000100, B00000000,
+
B00000000, B00000000, B00000000
+
};
+
+
byte const run4[] PROGMEM = {
+
16, 16,
+
B00000001, B11100000,
+
B00000011, B11111100,
+
B00000000, B00111110,
+
B00000000, B01111110,
+
B00000000, B11111100,
+
B00000001, B10011111,
+
B00000011, B00001110,
+
B00000011, B00000000,
+
B00000011, B10000000,
+
B11111111, B10000000,
+
B11111000, B11000000,
+
B00000001, B11000000,
+
B00000011, B10000000,
+
B00000111, B00000000,
+
B00000110, B00000000,
+
B00000100, B00000000
+
};
+
+
byte const run5[] PROGMEM = {
+
13, 16,
+
B00000000, B00000000,
+
B00000000, B00110000,
+
B00000111, B11111000,
+
B00000111, B11111000,
+
B00000111, B11110000,
+
B00001111, B11100000,
+
B00000111, B00000000,
+
B00001111, B00000000,
+
B00001111, B00000000,
+
B00001111, B10000000,
+
B00011100, B00000000,
+
B00111000, B00000000,
+
B01110000, B00000000,
+
B11100000, B00000000,
+
B11000000, B00000000,
+
B10000000, B00000000
+
};
+
+
byte const run6[] PROGMEM = {
+
16, 16,
+
B00000000, B00000000,
+
B00000000, B00011100,
+
B00000000, B00111110,
+
B00000001, B11111110,
+
B00000000, B11100000,
+
B00000001, B11100000,
+
B00000001, B11111000,
+
B00000011, B00011100,
+
B00000110, B00111000,
+
B00000110, B01110000,
+
B00001100, B00100000,
+
B00111000, B00000000,
+
B01100000, B00000000,
+
B11000000, B00000000,
+
B10000000, B00000000,
+
B10000000, B00000000
+
};
+
+
byte const run7[] PROGMEM = {
+
18, 16,
+
B00000000, B00000011, B10000000,
+
B00000000, B01111011, B10000000,
+
B00000000, B01111111, B10000000,
+
B00000000, B00001111, B00100000,
+
B00000000, B00011001, B11000000,
+
B00000000, B00110000, B11000000,
+
B00000000, B01110000, B00000000,
+
B00000001, B11110000, B00000000,
+
B11111111, B10111000, B00000000,
+
B11111111, B00011100, B00000000,
+
B00000000, B00001110, B00000000,
+
B00000000, B00000111, B00000000,
+
B00000000, B00000011, B10000000,
+
B00000000, B00000001, B11000000,
+
B00000000, B00000000, B01000000,
+
B00000000, B00000000, B00000000
+
};
+
+
byte const run8[] PROGMEM = {
+
18, 16,
+
B00000000, B00000110, B00000000,
+
B00000001, B11101111, B00000000,
+
B00000001, B11111111, B00000000,
+
B00000000, B00111110, B00000000,
+
B00000000, B01111111, B11000000,
+
B00000000, B11100011, B10000000,
+
B00000001, B11000000, B00000000,
+
B00000011, B11100000, B00000000,
+
B11111111, B01110000, B00000000,
+
B11111110, B00111000, B00000000,
+
B00000000, B00011100, B00000000,
+
B00000000, B00000110, B00000000,
+
B00000000, B00000110, B00000000,
+
B00000000, B00000111, B00000000,
+
B00000000, B00000011, B00000000,
+
B00000000, B00000001, B00000000
+
};
+
+
byte const run9[] PROGMEM = {
+
16, 16,
+
B00000000, B00000000,
+
B00000000, B01001110,
+
B00000001, B11101110,
+
B00000011, B11111110,
+
B00000011, B11111110,
+
B00000001, B10111100,
+
B00000011, B00000000,
+
B00000111, B00000000,
+
B11111111, B10000000,
+
B11111100, B11000000,
+
B00000000, B11000000,
+
B00000000, B11000000,
+
B00000000, B11000000,
+
B00000000, B11000000,
+
B00000000, B11000000,
+
B00000000, B11000000
+
};
+
+
byte const run10[] PROGMEM = {
+
13, 16,
+
B00000000, B00000000,
+
B00000000, B00110000,
+
B00000000, B01111000,
+
B00000111, B11111000,
+
B00001111, B11111000,
+
B00000111, B11000000,
+
B00001110, B00000000,
+
B00001100, B00000000,
+
B00001100, B00000000,
+
B01111100, B00000000,
+
B11111100, B00000000,
+
B00011000, B00000000,
+
B00110000, B00000000,
+
B01110000, B00000000,
+
B01100000, B00000000,
+
B01000000, B00000000
+
};
+
+
Bitmap::ProgMem frames[] = {
+
run1,
+
run2,
+
run3,
+
run4,
+
run5,
+
run6,
+
run7,
+
run8,
+
run9,
+
run10
+
};
+
#define NUM_FRAMES (sizeof(frames) / sizeof(frames[0]))
+
unsigned int frame = 0;
+
+
#define ADVANCE_MS (1000 / NUM_FRAMES)
+
unsigned long lastFrame;
+
+
void setup() {
+
lastFrame = millis() - ADVANCE_MS;
+
}
+
+
void loop() {
+
if ((millis() - lastFrame) >= ADVANCE_MS) {
+
display.clear();
+
int x = (32 - pgm_read_byte(frames[frame])) / 2;
+
display.drawBitmap(x, 0, frames[frame]);
+
lastFrame += ADVANCE_MS;
+
frame = (frame + 1) % NUM_FRAMES;
+
}
+
display.loop();
+
}
+
+ + + + diff --git a/html/doxygen.css b/html/doxygen.css new file mode 100644 index 00000000..f0f36f89 --- /dev/null +++ b/html/doxygen.css @@ -0,0 +1,1366 @@ +/* The standard CSS for doxygen 1.8.6 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px 6px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view when not used as main index */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/html/doxygen.png b/html/doxygen.png new file mode 100644 index 00000000..3ff17d80 Binary files /dev/null and b/html/doxygen.png differ diff --git a/html/dynsections.js b/html/dynsections.js new file mode 100644 index 00000000..2f15470d --- /dev/null +++ b/html/dynsections.js @@ -0,0 +1,104 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} +function toggleLevel(level) +{ + $('table.directory tr').each(function(){ + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + +ArduinoLibs: File List + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
o*AES.h
o*AES128.cpp
o*AES192.cpp
o*AES256.cpp
o*AESCommon.cpp
o*Bitmap.cpp
o*Bitmap.h
o*BLAKE2b.cpp
o*BLAKE2b.h
o*BLAKE2s.cpp
o*BLAKE2s.h
o*BlinkLED.cpp
o*BlinkLED.h
o*BlockCipher.cpp
o*BlockCipher.h
o*BoolField.cpp
o*BoolField.h
o*CBC.cpp
o*CBC.h
o*CFB.cpp
o*CFB.h
o*ChaCha.cpp
o*ChaCha.h
o*Charlieplex.cpp
o*Charlieplex.h
o*ChaseLEDs.cpp
o*ChaseLEDs.h
o*Cipher.cpp
o*Cipher.h
o*Crypto.cpp
o*Crypto.h
o*CTR.cpp
o*CTR.h
o*Curve25519.cpp
o*Curve25519.h
o*DejaVuSans9.h
o*DejaVuSansBold9.h
o*DejaVuSansItalic9.h
o*DMD.cpp
o*DMD.h
o*DS1307RTC.cpp
o*DS1307RTC.h
o*DS3231RTC.cpp
o*DS3231RTC.h
o*DS3232RTC.cpp
o*DS3232RTC.h
o*EEPROM24.cpp
o*EEPROM24.h
o*Field.cpp
o*Field.h
o*Form.cpp
o*Form.h
o*Hash.cpp
o*Hash.h
o*I2CMaster.cpp
o*I2CMaster.h
o*IntField.cpp
o*IntField.h
o*IRreceiver.cpp
o*IRreceiver.h
o*KeccakCore.cpp
o*KeccakCore.h
o*LCD.cpp
o*LCD.h
o*ListField.cpp
o*ListField.h
o*Melody.cpp
o*Melody.h
o*Mono5x7.h
o*NoiseSource.cpp
o*NoiseSource.h
o*OFB.cpp
o*OFB.h
o*PowerSave.cpp
o*PowerSave.h
o*RC5.h
o*RingOscillatorNoiseSource.cpp
o*RingOscillatorNoiseSource.h
o*RNG.cpp
o*RNG.h
o*RTC.cpp
o*RTC.h
o*SHA1.cpp
o*SHA1.h
o*SHA256.cpp
o*SHA256.h
o*SHA3.cpp
o*SHA3.h
o*SHA512.cpp
o*SHA512.h
o*SoftI2C.cpp
o*SoftI2C.h
o*TextField.cpp
o*TextField.h
o*TimeField.cpp
o*TimeField.h
o*TransistorNoiseSource.cpp
\*TransistorNoiseSource.h
+
+
+ + + + diff --git a/html/ftv2blank.png b/html/ftv2blank.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/html/ftv2blank.png differ diff --git a/html/ftv2cl.png b/html/ftv2cl.png new file mode 100644 index 00000000..132f6577 Binary files /dev/null and b/html/ftv2cl.png differ diff --git a/html/ftv2doc.png b/html/ftv2doc.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/html/ftv2doc.png differ diff --git a/html/ftv2folderclosed.png b/html/ftv2folderclosed.png new file mode 100644 index 00000000..bb8ab35e Binary files /dev/null and b/html/ftv2folderclosed.png differ diff --git a/html/ftv2folderopen.png b/html/ftv2folderopen.png new file mode 100644 index 00000000..d6c7f676 Binary files /dev/null and b/html/ftv2folderopen.png differ diff --git a/html/ftv2lastnode.png b/html/ftv2lastnode.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/html/ftv2lastnode.png differ diff --git a/html/ftv2link.png b/html/ftv2link.png new file mode 100644 index 00000000..17edabff Binary files /dev/null and b/html/ftv2link.png differ diff --git a/html/ftv2mlastnode.png b/html/ftv2mlastnode.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/html/ftv2mlastnode.png differ diff --git a/html/ftv2mnode.png b/html/ftv2mnode.png new file mode 100644 index 00000000..0b63f6d3 Binary files /dev/null and b/html/ftv2mnode.png differ diff --git a/html/ftv2mo.png b/html/ftv2mo.png new file mode 100644 index 00000000..4bfb80f7 Binary files /dev/null and b/html/ftv2mo.png differ diff --git a/html/ftv2node.png b/html/ftv2node.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/html/ftv2node.png differ diff --git a/html/ftv2ns.png b/html/ftv2ns.png new file mode 100644 index 00000000..72e3d71c Binary files /dev/null and b/html/ftv2ns.png differ diff --git a/html/ftv2plastnode.png b/html/ftv2plastnode.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/html/ftv2plastnode.png differ diff --git a/html/ftv2pnode.png b/html/ftv2pnode.png new file mode 100644 index 00000000..c6ee22f9 Binary files /dev/null and b/html/ftv2pnode.png differ diff --git a/html/ftv2splitbar.png b/html/ftv2splitbar.png new file mode 100644 index 00000000..fe895f2c Binary files /dev/null and b/html/ftv2splitbar.png differ diff --git a/html/ftv2vertline.png b/html/ftv2vertline.png new file mode 100644 index 00000000..63c605bb Binary files /dev/null and b/html/ftv2vertline.png differ diff --git a/html/functions.html b/html/functions.html new file mode 100644 index 00000000..3a542917 --- /dev/null +++ b/html/functions.html @@ -0,0 +1,180 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+
+ + + + diff --git a/html/functions_b.html b/html/functions_b.html new file mode 100644 index 00000000..61a49bf2 --- /dev/null +++ b/html/functions_b.html @@ -0,0 +1,189 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- b -

+
+ + + + diff --git a/html/functions_c.html b/html/functions_c.html new file mode 100644 index 00000000..4b6ef0dd --- /dev/null +++ b/html/functions_c.html @@ -0,0 +1,211 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- c -

+
+ + + + diff --git a/html/functions_d.html b/html/functions_d.html new file mode 100644 index 00000000..3ce51de0 --- /dev/null +++ b/html/functions_d.html @@ -0,0 +1,254 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- d -

+
+ + + + diff --git a/html/functions_e.html b/html/functions_e.html new file mode 100644 index 00000000..988f02c1 --- /dev/null +++ b/html/functions_e.html @@ -0,0 +1,192 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- e -

+
+ + + + diff --git a/html/functions_enum.html b/html/functions_enum.html new file mode 100644 index 00000000..a3c4e997 --- /dev/null +++ b/html/functions_enum.html @@ -0,0 +1,112 @@ + + + + + + +ArduinoLibs: Class Members - Enumerations + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+ + + + diff --git a/html/functions_eval.html b/html/functions_eval.html new file mode 100644 index 00000000..b4e2de51 --- /dev/null +++ b/html/functions_eval.html @@ -0,0 +1,115 @@ + + + + + + +ArduinoLibs: Class Members - Enumerator + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+ + + + diff --git a/html/functions_f.html b/html/functions_f.html new file mode 100644 index 00000000..aba841d7 --- /dev/null +++ b/html/functions_f.html @@ -0,0 +1,189 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- f -

+
+ + + + diff --git a/html/functions_func.html b/html/functions_func.html new file mode 100644 index 00000000..aefcc298 --- /dev/null +++ b/html/functions_func.html @@ -0,0 +1,173 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- a -

+
+ + + + diff --git a/html/functions_func_b.html b/html/functions_func_b.html new file mode 100644 index 00000000..2d111f5b --- /dev/null +++ b/html/functions_func_b.html @@ -0,0 +1,179 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- b -

+
+ + + + diff --git a/html/functions_func_c.html b/html/functions_func_c.html new file mode 100644 index 00000000..b3da58f8 --- /dev/null +++ b/html/functions_func_c.html @@ -0,0 +1,207 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- c -

+
+ + + + diff --git a/html/functions_func_d.html b/html/functions_func_d.html new file mode 100644 index 00000000..bcf05dff --- /dev/null +++ b/html/functions_func_d.html @@ -0,0 +1,237 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- d -

+
+ + + + diff --git a/html/functions_func_e.html b/html/functions_func_e.html new file mode 100644 index 00000000..34280164 --- /dev/null +++ b/html/functions_func_e.html @@ -0,0 +1,191 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- e -

+
+ + + + diff --git a/html/functions_func_f.html b/html/functions_func_f.html new file mode 100644 index 00000000..464fe535 --- /dev/null +++ b/html/functions_func_f.html @@ -0,0 +1,182 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- f -

+
+ + + + diff --git a/html/functions_func_g.html b/html/functions_func_g.html new file mode 100644 index 00000000..899390c6 --- /dev/null +++ b/html/functions_func_g.html @@ -0,0 +1,137 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- g -

+
+ + + + diff --git a/html/functions_func_h.html b/html/functions_func_h.html new file mode 100644 index 00000000..b24279e7 --- /dev/null +++ b/html/functions_func_h.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- h -

+
+ + + + diff --git a/html/functions_func_i.html b/html/functions_func_i.html new file mode 100644 index 00000000..32c21629 --- /dev/null +++ b/html/functions_func_i.html @@ -0,0 +1,178 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- i -

+
+ + + + diff --git a/html/functions_func_k.html b/html/functions_func_k.html new file mode 100644 index 00000000..45852bce --- /dev/null +++ b/html/functions_func_k.html @@ -0,0 +1,149 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- k -

+
+ + + + diff --git a/html/functions_func_l.html b/html/functions_func_l.html new file mode 100644 index 00000000..f8e16f1c --- /dev/null +++ b/html/functions_func_l.html @@ -0,0 +1,159 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- l -

+
+ + + + diff --git a/html/functions_func_m.html b/html/functions_func_m.html new file mode 100644 index 00000000..a5ef2b3f --- /dev/null +++ b/html/functions_func_m.html @@ -0,0 +1,150 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- m -

+
+ + + + diff --git a/html/functions_func_n.html b/html/functions_func_n.html new file mode 100644 index 00000000..0a26e918 --- /dev/null +++ b/html/functions_func_n.html @@ -0,0 +1,146 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- n -

+
+ + + + diff --git a/html/functions_func_o.html b/html/functions_func_o.html new file mode 100644 index 00000000..9f71ab9d --- /dev/null +++ b/html/functions_func_o.html @@ -0,0 +1,149 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- o -

+
+ + + + diff --git a/html/functions_func_p.html b/html/functions_func_p.html new file mode 100644 index 00000000..452ad531 --- /dev/null +++ b/html/functions_func_p.html @@ -0,0 +1,161 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- p -

+
+ + + + diff --git a/html/functions_func_r.html b/html/functions_func_r.html new file mode 100644 index 00000000..63cdafa3 --- /dev/null +++ b/html/functions_func_r.html @@ -0,0 +1,213 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- r -

+
+ + + + diff --git a/html/functions_func_s.html b/html/functions_func_s.html new file mode 100644 index 00000000..e08b5131 --- /dev/null +++ b/html/functions_func_s.html @@ -0,0 +1,343 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- s -

+
+ + + + diff --git a/html/functions_func_t.html b/html/functions_func_t.html new file mode 100644 index 00000000..948725b8 --- /dev/null +++ b/html/functions_func_t.html @@ -0,0 +1,155 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- t -

+
+ + + + diff --git a/html/functions_func_u.html b/html/functions_func_u.html new file mode 100644 index 00000000..9041bfcd --- /dev/null +++ b/html/functions_func_u.html @@ -0,0 +1,148 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- u -

+
+ + + + diff --git a/html/functions_func_v.html b/html/functions_func_v.html new file mode 100644 index 00000000..662d03f0 --- /dev/null +++ b/html/functions_func_v.html @@ -0,0 +1,141 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- v -

+
+ + + + diff --git a/html/functions_func_w.html b/html/functions_func_w.html new file mode 100644 index 00000000..493ba0f1 --- /dev/null +++ b/html/functions_func_w.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- w -

+
+ + + + diff --git a/html/functions_func_~.html b/html/functions_func_~.html new file mode 100644 index 00000000..18c8e9ad --- /dev/null +++ b/html/functions_func_~.html @@ -0,0 +1,200 @@ + + + + + + +ArduinoLibs: Class Members - Functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+  + +

- ~ -

+
+ + + + diff --git a/html/functions_g.html b/html/functions_g.html new file mode 100644 index 00000000..3261bd72 --- /dev/null +++ b/html/functions_g.html @@ -0,0 +1,138 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- g -

+
+ + + + diff --git a/html/functions_h.html b/html/functions_h.html new file mode 100644 index 00000000..f703b4c4 --- /dev/null +++ b/html/functions_h.html @@ -0,0 +1,170 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- h -

+
+ + + + diff --git a/html/functions_i.html b/html/functions_i.html new file mode 100644 index 00000000..85693672 --- /dev/null +++ b/html/functions_i.html @@ -0,0 +1,182 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- i -

+
+ + + + diff --git a/html/functions_k.html b/html/functions_k.html new file mode 100644 index 00000000..98b3901c --- /dev/null +++ b/html/functions_k.html @@ -0,0 +1,150 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- k -

+
+ + + + diff --git a/html/functions_l.html b/html/functions_l.html new file mode 100644 index 00000000..2d8ca2a6 --- /dev/null +++ b/html/functions_l.html @@ -0,0 +1,160 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- l -

+
+ + + + diff --git a/html/functions_m.html b/html/functions_m.html new file mode 100644 index 00000000..e6c1a508 --- /dev/null +++ b/html/functions_m.html @@ -0,0 +1,158 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- m -

+
+ + + + diff --git a/html/functions_n.html b/html/functions_n.html new file mode 100644 index 00000000..fb662768 --- /dev/null +++ b/html/functions_n.html @@ -0,0 +1,153 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- n -

+
+ + + + diff --git a/html/functions_o.html b/html/functions_o.html new file mode 100644 index 00000000..6abbf5e0 --- /dev/null +++ b/html/functions_o.html @@ -0,0 +1,150 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- o -

+
+ + + + diff --git a/html/functions_p.html b/html/functions_p.html new file mode 100644 index 00000000..645ea309 --- /dev/null +++ b/html/functions_p.html @@ -0,0 +1,165 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- p -

+
+ + + + diff --git a/html/functions_r.html b/html/functions_r.html new file mode 100644 index 00000000..191d67c7 --- /dev/null +++ b/html/functions_r.html @@ -0,0 +1,214 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- r -

+
+ + + + diff --git a/html/functions_s.html b/html/functions_s.html new file mode 100644 index 00000000..92bf3f42 --- /dev/null +++ b/html/functions_s.html @@ -0,0 +1,354 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- s -

+
+ + + + diff --git a/html/functions_t.html b/html/functions_t.html new file mode 100644 index 00000000..acf2ce17 --- /dev/null +++ b/html/functions_t.html @@ -0,0 +1,156 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- t -

+
+ + + + diff --git a/html/functions_type.html b/html/functions_type.html new file mode 100644 index 00000000..62b722e7 --- /dev/null +++ b/html/functions_type.html @@ -0,0 +1,115 @@ + + + + + + +ArduinoLibs: Class Members - Typedefs + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+ + + + diff --git a/html/functions_u.html b/html/functions_u.html new file mode 100644 index 00000000..94448e07 --- /dev/null +++ b/html/functions_u.html @@ -0,0 +1,149 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- u -

+
+ + + + diff --git a/html/functions_v.html b/html/functions_v.html new file mode 100644 index 00000000..eee7fa36 --- /dev/null +++ b/html/functions_v.html @@ -0,0 +1,142 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- v -

+
+ + + + diff --git a/html/functions_vars.html b/html/functions_vars.html new file mode 100644 index 00000000..b964fe62 --- /dev/null +++ b/html/functions_vars.html @@ -0,0 +1,164 @@ + + + + + + +ArduinoLibs: Class Members - Variables + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+ + + + diff --git a/html/functions_w.html b/html/functions_w.html new file mode 100644 index 00000000..ff5812a3 --- /dev/null +++ b/html/functions_w.html @@ -0,0 +1,172 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- w -

+
+ + + + diff --git a/html/functions_y.html b/html/functions_y.html new file mode 100644 index 00000000..b9f032dd --- /dev/null +++ b/html/functions_y.html @@ -0,0 +1,138 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- y -

+
+ + + + diff --git a/html/functions_~.html b/html/functions_~.html new file mode 100644 index 00000000..e16ab1c1 --- /dev/null +++ b/html/functions_~.html @@ -0,0 +1,201 @@ + + + + + + +ArduinoLibs: Class Members + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- ~ -

+
+ + + + diff --git a/html/group__power__save.html b/html/group__power__save.html new file mode 100644 index 00000000..54d0f30d --- /dev/null +++ b/html/group__power__save.html @@ -0,0 +1,209 @@ + + + + + + +ArduinoLibs: Power saving utility functions + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+ +
+
Power saving utility functions
+
+
+ + + + + +

+Enumerations

enum  SleepDuration {
+  SLEEP_15_MS, +SLEEP_30_MS, +SLEEP_60_MS, +SLEEP_120_MS, +
+  SLEEP_250_MS, +SLEEP_500_MS, +SLEEP_1_SEC, +SLEEP_2_SEC, +
+  SLEEP_4_SEC, +SLEEP_8_SEC +
+ }
 Duration to put the CPU to sleep with sleepFor(). More...
 
+ + + + + + + +

+Functions

void sleepFor (SleepDuration duration, uint8_t mode)
 Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detector will be disabled during sleep mode. More...
 
+void unusedPin (uint8_t pin)
 Marks an I/O pin as unused.This function sets pin to be an input with pullups enabled, which will reduce power consumption compared to pins that are left floating.
 
+

Detailed Description

+

The functions in this module assist with reducing power consumption on Arduino boards by disabling features that are not used or putting the device to sleep when it is inactive.

+

Enumeration Type Documentation

+ +
+
+ + + + +
enum SleepDuration
+
+ +

Duration to put the CPU to sleep with sleepFor().

+
See Also
sleepFor()
+ + + + + + + + + + + +
Enumerator
SLEEP_15_MS  +

Sleep for 15 milliseconds.

+
SLEEP_30_MS  +

Sleep for 30 milliseconds.

+
SLEEP_60_MS  +

Sleep for 60 milliseconds.

+
SLEEP_120_MS  +

Sleep for 120 milliseconds.

+
SLEEP_250_MS  +

Sleep for 250 milliseconds.

+
SLEEP_500_MS  +

Sleep for 500 milliseconds.

+
SLEEP_1_SEC  +

Sleep for 1 second.

+
SLEEP_2_SEC  +

Sleep for 2 seconds.

+
SLEEP_4_SEC  +

Sleep for 4 seconds.

+
SLEEP_8_SEC  +

Sleep for 8 seconds.

+
+ +

Definition at line 38 of file PowerSave.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
void sleepFor (SleepDuration duration,
uint8_t mode 
)
+
+ +

Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detector will be disabled during sleep mode.

+

The mode parameter indicates the mode to use when the device is sleeping. The default is SLEEP_MODE_IDLE.

+ +

Definition at line 132 of file PowerSave.cpp.

+ +
+
+
+ + + + diff --git a/html/hierarchy.html b/html/hierarchy.html new file mode 100644 index 00000000..b4cd135f --- /dev/null +++ b/html/hierarchy.html @@ -0,0 +1,157 @@ + + + + + + +ArduinoLibs: Class Hierarchy + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
oCBitmapRepresents a monochrome bitmap within main memory
|\CDMDHandle large dot matrix displays composed of LED's
oCBlinkLEDBlink a LED on a digital output pin
oCBlockCipherAbstract base class for block ciphers
|\CAESCommonAbstract base class for AES block ciphers
| oCAES128AES block cipher with 128-bit keys
| oCAES192AES block cipher with 192-bit keys
| \CAES256AES block cipher with 256-bit keys
oCCharlieplexManage an array of LED's in a charlieplexed arrangement
oCChaseLEDsChase LED's on output pins in a defined sequence
oCCipherAbstract base class for stream ciphers
|oCCBCCommonConcrete base class to assist with implementing CBC for 128-bit block ciphers
||\CCBC< T >Implementation of the Cipher Block Chaining (CBC) mode for 128-bit block ciphers
|oCCFBCommonConcrete base class to assist with implementing CFB for 128-bit block ciphers
||\CCFB< T >Implementation of the Cipher Feedback (CFB) mode for 128-bit block ciphers
|oCChaChaChaCha stream cipher
|oCCTRCommonConcrete base class to assist with implementing CTR mode for 128-bit block ciphers
||\CCTR< T >Implementation of the Counter (CTR) mode for 128-bit block ciphers
|\COFBCommonConcrete base class to assist with implementing OFB for 128-bit block ciphers
| \COFB< T >Implementation of the Output Feedback (OFB) mode for 128-bit block ciphers
oCCurve25519Diffie-Hellman key agreement based on the elliptic curve modulo 2^255 - 19
oCEEPROM24Reading and writing EEPROM's from the 24LCXX family
oCFieldManages a single data input/output field within a Form
|oCBoolFieldField that manages the input of a boolean value
|oCIntFieldField that manages the input of an integer value
|oCListFieldField that manages selection from a static list of items
|oCTextFieldField that displays a read-only text value
|\CTimeFieldField that manages the display and editing of a time value
oCFormManager for a form containing data input/output fields
oCHashAbstract base class for cryptographic hash algorithms
|oCBLAKE2bBLAKE2b hash algorithm
|oCBLAKE2sBLAKE2s hash algorithm
|oCSHA1SHA-1 hash algorithm
|oCSHA256SHA-256 hash algorithm
|oCSHA3_256SHA3-256 hash algorithm
|oCSHA3_512SHA3-512 hash algorithm
|\CSHA512SHA-512 hash algorithm
oCI2CMasterAbstract base class for I2C master implementations
|\CSoftI2CBit-banged implementation of an I2C master
oCIRreceiverManages the reception of RC-5 commands from an infrared remote control
oCKeccakCoreKeccak core sponge function
oCLiquidCrystal
|\CLCDEnhanced library for Freetronics 16x2 LCD shields
oCMelodyPlays a melody on a digital output pin using tone()
oCNoiseSourceAbstract base class for random noise sources
|oCRingOscillatorNoiseSourceProcesses the signal from a ring oscillator based noise source
|\CTransistorNoiseSourceProcesses the signal from a transistor-based noise source
oCRNGClassPseudo random number generator suitable for cryptography
oCRTCBase class for realtime clock handlers
|oCDS1307RTCCommunicates with a DS1307 realtime clock chip via I2C
|oCDS3231RTCCommunicates with a DS3231 realtime clock chip via I2C
|\CDS3232RTCCommunicates with a DS3232 realtime clock chip via I2C
oCRTCAlarmStores alarm information from a realtime clock chip
oCRTCDateStores date information from a realtime clock chip
\CRTCTimeStores time information from a realtime clock chip
+
+
+ + + + diff --git a/html/index.html b/html/index.html new file mode 100644 index 00000000..02b8f383 --- /dev/null +++ b/html/index.html @@ -0,0 +1,160 @@ + + + + + + +ArduinoLibs: Main Page + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + +
+ +
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
+ + +
+ +
+ +
+
+
ArduinoLibs Documentation
+
+
+

This distribution contains a bunch of libraries and example applications that I have made for Arduino, covering a variety of tasks from blinking LED's to LCD's and RTC-based alarm clocks. They are distributed under the terms of the MIT license, with the source code available from github.

+

For more information on these libraries, to report bugs, or to suggest improvements, please contact the author Rhys Weatherley via email.

+

+LCD Shield

+
    +
  • LCD class to manage the extended features of the Freetronics and DFRobot LCD shields.
  • +
  • Form and Field classes to build simple property sheet UI's on LCD displays.
  • +
  • Hello World example for the Freetronics LCD shield.
  • +
  • Form example for LCD displays.
  • +
+

+Freetronics Large Dot Matrix Display (DMD)

+
    +
  • DMD class to manage the initialize of the display.
  • +
  • Bitmap class to manage drawing to in-memory bitmaps and the DMD display.
  • +
  • Demo that shows off various bitmap drawing features.
  • +
  • RunningFigure example that demonstrates how to draw and animate bitmaps.
  • +
  • Snake game that combines the dot matrix display with IRreceiver to make a simple video game.
  • +
+

+BlinkLED Utility Library

+
    +
  • BlinkLED class that simplifies the process of blinking a LED connected to a output pin.
  • +
  • ChaseLEDs class that simplifies the process of performing a LED chase over several output pins.
  • +
  • Charlieplex class that manages a matrix of LED's arranged in a Charlieplexing arrangement.
  • +
  • Blink example of using BlinkLED.
  • +
  • Cylon example of using ChaseLEDs to simulate the Cylon eye effect from Battlestar Galactica.
  • +
  • StarTrek example for lighting a starship Enterprise model kit.
  • +
  • Charlieplex example.
  • +
+

+I2C Utility Library

+
    +
  • I2CMaster abstract class that provides an improved API for implementing an I2C master.
  • +
  • SoftI2C class that implements the master side of the I2C protocol in software on any arbitrary pair of pins for DATA and CLOCK. This class supports both 7-bit and 10-bit I2C addresses.
  • +
  • EEPROM24 class for reading and writing 24LCXX family EEPROM's.
  • +
+

+Realtime Clock Library

+
    +
  • RTC class that acts as a base for all realtime clock implementations, including support for configuring alarms and storing clock settings. The default implementation simulates the time and date based on the value of millis().
  • +
  • DS1307RTC class that talks to the DS1307 realtime clock chip via I2C.
  • +
  • DS3231RTC class that talks to the DS3231 realtime clock chip via I2C.
  • +
  • DS3232RTC class that talks to the DS3232 realtime clock chip via I2C.
  • +
  • Alarm Clock example that uses the DS1307 or DS3232 realtime clock and the LCD library to implement an alarm clock.
  • +
+

+Cryptographic Library

+ +

More information can be found on the Cryptographic Library page.

+

+Infrared Control Library

+
    +
  • IRreceiver class that receives incoming RC-5 commands from an infrared remote control.
  • +
  • DumpIR example that dumps all incoming RC-5 commands.
  • +
  • Snake game that combines DMD with an infrared remote control to make a simple video game.
  • +
+

+Other

+ +
+ + + + diff --git a/html/ir-dumpir_8dox.html b/html/ir-dumpir_8dox.html new file mode 100644 index 00000000..f96ced0b --- /dev/null +++ b/html/ir-dumpir_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: ir-dumpir.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+
+
ir-dumpir.dox File Reference
+
+
+
+ + + + diff --git a/html/ir-snake_8dox.html b/html/ir-snake_8dox.html new file mode 100644 index 00000000..eb0807d5 --- /dev/null +++ b/html/ir-snake_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: ir-snake.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+
+
ir-snake.dox File Reference
+
+
+
+ + + + diff --git a/html/ir_dumpir.html b/html/ir_dumpir.html new file mode 100644 index 00000000..33c11893 --- /dev/null +++ b/html/ir_dumpir.html @@ -0,0 +1,291 @@ + + + + + + +ArduinoLibs: Dumping Infrared Remote Control Codes + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + +
+ +
+ +
+
+
+
Dumping Infrared Remote Control Codes
+
+
+

This example uses the IRreceiver class to dump commands that are received from an infrared remote control that is compatible with the Philips RC-5 protocol. Commands are dumped to the serial port. The example needs a 3-pin infrared receiver connected to D2, GND, and 5V:

+
+irchip.jpg +
+

The full source code for the example follows:

+
/* This example is placed into the public domain */
+
+
#include <IRreceiver.h>
+
+ +
+
static const char *systems[32] = {
+
"TV",
+
"TV2",
+
"TXT",
+
"TV_EXT",
+
"LV",
+
"VCR",
+
"VCR2",
+
"Sys7",
+
"SAT",
+
"VCR_EXT",
+
"SAT2",
+
"Sys11",
+
"CD_VIDEO",
+
"Sys13",
+
"CD_PHOTO",
+
"Sys15",
+
"PREAMP",
+
"RADIO",
+
"REC",
+
"PREAMP2",
+
"CD",
+
"COMBI",
+
"AUDIO_SAT",
+
"REC2",
+
"Sys24",
+
"Sys25",
+
"CD_R",
+
"Sys27",
+
"Sys28",
+
"Sys29",
+
"Sys30",
+
"Sys31"
+
};
+
+
// Selection of TV, VCR, and CD commands to assist with command identification.
+
// May not be correct for all system types.
+
static const char *commands[128] = {
+
"0",
+
"1",
+
"2",
+
"3",
+
"4",
+
"5",
+
"6",
+
"7",
+
"8",
+
"9",
+
"123",
+
"11",
+
"STANDBY",
+
"MUTE",
+
"PREFERENCES",
+
"DISPLAY_INFO",
+
"INC_VOLUME",
+
"DEC_VOLUME",
+
"INC_BRIGHTNESS",
+
"DEC_BRIGHTNESS",
+
"INC_SATURATION",
+
"DEC_SATURATION",
+
"INC_BASS",
+
"DEC_BASS",
+
"INC_TREBLE",
+
"DEC_TREBLE",
+
"BALANCE_LEFT",
+
"BALANCE_RIGHT",
+
"INC_CONTRAST",
+
"DEC_CONTRAST",
+
"SEARCH_UP",
+
"DEC_TINT",
+
"CHANNEL_UP",
+
"CHANNEL_DOWN",
+
"CHANNEL_LAST",
+
"STEREO_SELECT",
+
"STEREO_SPATIAL",
+
"STEREO_TOGGLE",
+
"SLEEP_TIMER",
+
"INC_TINT",
+
"SWITCH_RF",
+
"STORE",
+
"TIME",
+
"INC_SCAN",
+
"DEC_SCAN",
+
"TRAY",
+
"SECONDARY_MENU",
+
"CLOCK",
+
"PAUSE",
+
"ERASE",
+
"REWIND",
+
"GOTO",
+
"WIND",
+
"PLAY",
+
"STOP",
+
"RECORD",
+
"EXTERNAL_1",
+
"EXTERNAL_2",
+
"CLEAR_MEMORY",
+
"VIEW_DATA",
+
"12",
+
"SYSTEM_STANDBY",
+
"CRISP",
+
"TRANSMIT_MODE",
+
"Cmd64",
+
"Cmd65",
+
"Cmd66",
+
"Cmd67",
+
"Cmd68",
+
"Cmd69",
+
"AUDIO_RESPONSE",
+
"DIM",
+
"Cmd72",
+
"Cmd73",
+
"Cmd74",
+
"Cmd75",
+
"Cmd76",
+
"INC_LINEAR",
+
"DEC_LINEAR",
+
"SOUND_FUNCTIONS",
+
"UP",
+
"DOWN",
+
"MENU_ON",
+
"MENU_OFF",
+
"AV_STATUS",
+
"LEFT",
+
"RIGHT",
+
"OK",
+
"PIP",
+
"PIP_SHIFT",
+
"PIP_SWAP",
+
"PIP_STROBE",
+
"PIP_MULTI_STROBE",
+
"PIP_FREEZE_MAIN",
+
"PIP_MULTI_SCAN",
+
"PIP_SOURCE",
+
"PIP_MOSAIC",
+
"PIP_NOISE",
+
"PIP_STORE",
+
"PIP_PHOTO_FINISH",
+
"PIP_RECALL",
+
"PIP_FREEZE",
+
"PIP_UP",
+
"PIP_DOWN",
+
"PIP_SIZE",
+
"VERSION_FUNCTIONS",
+
"COLOR_KEY",
+
"RED",
+
"GREEN",
+
"YELLOW",
+
"CYAN",
+
"INDEX",
+
"NEXT_OPTION",
+
"PREVIOUS_OPTION",
+
"Cmd114",
+
"Cmd115",
+
"Cmd116",
+
"Cmd117",
+
"SUBMODE",
+
"OPTIONS",
+
"FADE",
+
"Cmd121",
+
"STORE_OPEN_CLOSE",
+
"CONNECT_EURO",
+
"DISCONNECT_EURO",
+
"Cmd125",
+
"Cmd126",
+
"Cmd127"
+
};
+
+
void setup() {
+
Serial.begin(9600);
+
}
+
+
void loop() {
+
int cmd = ir.command();
+
if (cmd >= 0) {
+
Serial.print("IR system=");
+
Serial.print(ir.system());
+
Serial.print(" (RC5_SYS_");
+
Serial.print(systems[ir.system()]);
+
Serial.print("), command=");
+
Serial.print(cmd & 0x7F);
+
Serial.print(" (RC5_");
+
Serial.print(commands[cmd & 0x7F]);
+
Serial.print(")");
+ +
Serial.println(", auto-repeat");
+
else
+
Serial.println();
+
}
+
}
+
+ + + + diff --git a/html/ir_snake.html b/html/ir_snake.html new file mode 100644 index 00000000..e727c261 --- /dev/null +++ b/html/ir_snake.html @@ -0,0 +1,281 @@ + + + + + + +ArduinoLibs: Snake Video Game Using an Infrared Remote Control + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + +
+ +
+ +
+
+
+
Snake Video Game Using an Infrared Remote Control
+
+
+

This example demonstrates the use of the DMD and IRreceiver classes. The full source code follows:

+
/*
+
* Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
*
+
* Permission is hereby granted, free of charge, to any person obtaining a
+
* copy of this software and associated documentation files (the "Software"),
+
* to deal in the Software without restriction, including without limitation
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
* and/or sell copies of the Software, and to permit persons to whom the
+
* Software is furnished to do so, subject to the following conditions:
+
*
+
* The above copyright notice and this permission notice shall be included
+
* in all copies or substantial portions of the Software.
+
*
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
* DEALINGS IN THE SOFTWARE.
+
*/
+
+
#include <IRreceiver.h>
+
#include <DMD.h>
+
#include <Mono5x7.h>
+
+
#define SNAKE_ADVANCE_TIME 150
+
#define SNAKE_BLINK_TIME 500
+
#define SNAKE_INC_STEPS 5
+
#define SNAKE_MAX_LENGTH 50
+
#define SNAKE_START_LENGTH 10
+
+
struct Point
+
{
+
int x, y;
+
};
+
+
DMD display;
+ +
bool paused;
+
bool gameOver;
+
bool waitForStart;
+
bool snakeDrawn;
+
unsigned long lastChange;
+
Point direction;
+
Point snakeParts[SNAKE_MAX_LENGTH];
+
int snakeLength;
+
int incStep;
+
+
ISR(TIMER1_OVF_vect)
+
{
+
display.refresh();
+
}
+
+
void setup() {
+
display.enableTimer1();
+
display.setFont(Mono5x7);
+
startGame();
+
}
+
+
void drawSnake(Bitmap::Color color) {
+
for (int index = 0; index < snakeLength; ++index)
+
display.setPixel(snakeParts[index].x, snakeParts[index].y, color);
+
}
+
+
void loop() {
+
// Handle the "Game Over" state. Any key press starts a new game.
+
int cmd = ir.command();
+
if (gameOver) {
+
if (cmd != -1 && (cmd & IRreceiver::AUTO_REPEAT) == 0)
+
startGame();
+
return;
+
}
+
+
// Pause the game if waiting for the first start. While waiting,
+
// blink the location of the snake to help the player get their bearings.
+
if (waitForStart) {
+
if (cmd == -1) {
+
if ((millis() - lastChange) >= SNAKE_BLINK_TIME) {
+
snakeDrawn = !snakeDrawn;
+
drawSnake(snakeDrawn ? Bitmap::White : Bitmap::Black);
+
lastChange += SNAKE_BLINK_TIME;
+
}
+
return;
+
}
+
drawSnake(Bitmap::White);
+
waitForStart = false;
+
snakeDrawn = true;
+
lastChange = millis();
+
}
+
+
// Process commands from the player.
+
switch (cmd) {
+
+
// Both arrow keys and numbers can be used to control the direction,
+
// in case the remote control does not have arrow keys.
+
case RC5_LEFT: case RC5_4:
+
changeDirection(-1, 0);
+
break;
+
case RC5_RIGHT: case RC5_6:
+
changeDirection(1, 0);
+
break;
+
case RC5_UP: case RC5_2:
+
changeDirection(0, -1);
+
break;
+
case RC5_DOWN: case RC5_8:
+
changeDirection(0, 1);
+
break;
+
+
case RC5_PAUSE: case RC5_PLAY: case RC5_0:
+
// Pause or resume the game.
+
paused = !paused;
+
lastChange = millis();
+
break;
+
+
case RC5_STOP: case RC5_STANDBY:
+
// Stop the game and start a new one.
+
startGame();
+
break;
+
}
+
+
// Advance the snake position if not paused and the timeout has expired.
+
if (!paused && (millis() - lastChange) >= SNAKE_ADVANCE_TIME) {
+
++incStep;
+
advanceSnake(incStep >= SNAKE_INC_STEPS);
+
lastChange += SNAKE_ADVANCE_TIME;
+
}
+
}
+
+
void startGame() {
+
randomSeed(micros() + analogRead(A0)); // Analog read adds some noise.
+
display.clear();
+
display.drawRect(0, 0, display.width() - 1, display.height() - 1);
+
for (int count = 0; count < 10; ++count) {
+
int x, y;
+
if (random(0, 2) == 0) {
+
x = random(1, display.width() - 5);
+
y = random(1, display.height() - 1);
+
display.drawLine(x, y, x + 4, y);
+
} else {
+
x = random(1, display.width() - 1);
+
y = random(1, display.height() - 3);
+
display.drawLine(x, y, x, y + 2);
+
}
+
}
+
paused = false;
+
gameOver = false;
+
waitForStart = true;
+
snakeDrawn = true;
+
lastChange = millis();
+
direction.x = 1;
+
direction.y = 0;
+
incStep = 0;
+
snakeLength = SNAKE_START_LENGTH;
+
for (int index = 0; index < snakeLength; ++index) {
+
snakeParts[index].x = 3 + index;
+
snakeParts[index].y = 4;
+
display.setPixel
+
(snakeParts[index].x, snakeParts[index].y, Bitmap::White);
+
}
+
}
+
+
void changeDirection(int x, int y) {
+
direction.x = x;
+
direction.y = y;
+
}
+
+
void advanceSnake(bool increase) {
+
int x = snakeParts[snakeLength - 1].x + direction.x;
+
int y = snakeParts[snakeLength - 1].y + direction.y;
+
if (display.pixel(x, y) == Bitmap::White) {
+
gameOver = true;
+
display.clear();
+
display.drawText(5, 0, "Game");
+
display.drawText(3, 8, "Over!");
+
return;
+
}
+
if (!increase || snakeLength >= SNAKE_MAX_LENGTH) {
+
display.setPixel(snakeParts[0].x, snakeParts[0].y, Bitmap::Black);
+
for (int index = 0; index < snakeLength - 1; ++index)
+
snakeParts[index] = snakeParts[index + 1];
+
} else {
+
++snakeLength;
+
}
+
snakeParts[snakeLength - 1].x = x;
+
snakeParts[snakeLength - 1].y = y;
+
display.setPixel(x, y, Bitmap::White);
+
if (increase)
+
incStep = 0;
+
}
+
+ + + + diff --git a/html/irchip.jpg b/html/irchip.jpg new file mode 100644 index 00000000..912f86b6 Binary files /dev/null and b/html/irchip.jpg differ diff --git a/html/jquery.js b/html/jquery.js new file mode 100644 index 00000000..6aa2e4c2 --- /dev/null +++ b/html/jquery.js @@ -0,0 +1,39 @@ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType; +if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1 +},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av); +ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length; +if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b +})}})(window); +/*! + PowerTip - v1.2.0 - 2013-04-03 + http://stevenbenner.github.com/jquery-powertip/ + Copyright (c) 2013 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ +(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(k){var A=k(document),s=k(window),w=k("body");var n="displayController",e="hasActiveHover",d="forcedOpen",u="hasMouseMove",f="mouseOnToPopup",g="originalTitle",y="powertip",o="powertipjq",l="powertiptarget",E=180/Math.PI;var c={isTipOpen:false,isFixedTipOpen:false,isClosing:false,tipOpenImminent:false,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,mouseTrackingActive:false,delayInProgress:false,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0};var p={none:0,top:1,bottom:2,left:4,right:8};k.fn.powerTip=function(F,N){if(!this.length){return this}if(k.type(F)==="string"&&k.powerTip[F]){return k.powerTip[F].call(this,this,N)}var O=k.extend({},k.fn.powerTip.defaults,F),G=new x(O);h();this.each(function M(){var R=k(this),Q=R.data(y),P=R.data(o),T=R.data(l),S;if(R.data(n)){k.powerTip.destroy(R)}S=R.attr("title");if(!Q&&!T&&!P&&S){R.data(y,S);R.data(g,S);R.removeAttr("title")}R.data(n,new t(R,O,G))});if(!O.manual){this.on({"mouseenter.powertip":function J(P){k.powerTip.show(this,P)},"mouseleave.powertip":function L(){k.powerTip.hide(this)},"focus.powertip":function K(){k.powerTip.show(this)},"blur.powertip":function H(){k.powerTip.hide(this,true)},"keydown.powertip":function I(P){if(P.keyCode===27){k.powerTip.hide(this,true)}}})}return this};k.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false};k.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};k.powerTip={show:function z(F,G){if(G){i(G);c.previousX=G.pageX;c.previousY=G.pageY;k(F).data(n).show()}else{k(F).first().data(n).show(true,true)}return F},reposition:function r(F){k(F).first().data(n).resetPosition();return F},hide:function D(G,F){if(G){k(G).first().data(n).hide(F)}else{if(c.activeHover){c.activeHover.data(n).hide(true)}}return G},destroy:function C(G){k(G).off(".powertip").each(function F(){var I=k(this),H=[g,n,e,d];if(I.data(g)){I.attr("title",I.data(g));H.push(y)}I.removeData(H)});return G}};k.powerTip.showTip=k.powerTip.show;k.powerTip.closeTip=k.powerTip.hide;function b(){var F=this;F.top="auto";F.left="auto";F.right="auto";F.bottom="auto";F.set=function(H,G){if(k.isNumeric(G)){F[H]=Math.round(G)}}}function t(K,N,F){var J=null;function L(P,Q){M();if(!K.data(e)){if(!P){c.tipOpenImminent=true;J=setTimeout(function O(){J=null;I()},N.intentPollInterval)}else{if(Q){K.data(d,true)}F.showTip(K)}}}function G(P){M();c.tipOpenImminent=false;if(K.data(e)){K.data(d,false);if(!P){c.delayInProgress=true;J=setTimeout(function O(){J=null;F.hideTip(K);c.delayInProgress=false},N.closeDelay)}else{F.hideTip(K)}}}function I(){var Q=Math.abs(c.previousX-c.currentX),O=Math.abs(c.previousY-c.currentY),P=Q+O;if(P",{id:Q.popupId});if(w.length===0){w=k("body")}w.append(O)}if(Q.followMouse){if(!O.data(u)){A.on("mousemove",M);s.on("scroll",M);O.data(u,true)}}if(Q.mouseOnToPopup){O.on({mouseenter:function L(){if(O.data(f)){if(c.activeHover){c.activeHover.data(n).cancel()}}},mouseleave:function N(){if(c.activeHover){c.activeHover.data(n).hide()}}})}function I(S){S.data(e,true);O.queue(function R(T){H(S);T()})}function H(S){var U;if(!S.data(e)){return}if(c.isTipOpen){if(!c.isClosing){K(c.activeHover)}O.delay(100).queue(function R(V){H(S);V()});return}S.trigger("powerTipPreRender");U=B(S);if(U){O.empty().append(U)}else{return}S.trigger("powerTipRender");c.activeHover=S;c.isTipOpen=true;O.data(f,Q.mouseOnToPopup);if(!Q.followMouse){G(S);c.isFixedTipOpen=true}else{M()}O.fadeIn(Q.fadeInTime,function T(){if(!c.desyncTimeout){c.desyncTimeout=setInterval(J,500)}S.trigger("powerTipOpen")})}function K(R){c.isClosing=true;c.activeHover=null;c.isTipOpen=false;c.desyncTimeout=clearInterval(c.desyncTimeout);R.data(e,false);R.data(d,false);O.fadeOut(Q.fadeOutTime,function S(){var T=new b();c.isClosing=false;c.isFixedTipOpen=false;O.removeClass();T.set("top",c.currentY+Q.offset);T.set("left",c.currentX+Q.offset);O.css(T);R.trigger("powerTipClose")})}function M(){if(!c.isFixedTipOpen&&(c.isTipOpen||(c.tipOpenImminent&&O.data(u)))){var R=O.outerWidth(),V=O.outerHeight(),U=new b(),S,T;U.set("top",c.currentY+Q.offset);U.set("left",c.currentX+Q.offset);S=m(U,R,V);if(S!==p.none){T=a(S);if(T===1){if(S===p.right){U.set("left",c.windowWidth-R)}else{if(S===p.bottom){U.set("top",c.scrollTop+c.windowHeight-V)}}}else{U.set("left",c.currentX-R-Q.offset);U.set("top",c.currentY-V-Q.offset)}}O.css(U)}}function G(S){var R,T;if(Q.smartPlacement){R=k.fn.powerTip.smartPlacementLists[Q.placement];k.each(R,function(U,W){var V=m(F(S,W),O.outerWidth(),O.outerHeight());T=W;if(V===p.none){return false}})}else{F(S,Q.placement);T=Q.placement}O.addClass(T)}function F(U,T){var R=0,S,W,V=new b();V.set("top",0);V.set("left",0);O.css(V);do{S=O.outerWidth();W=O.outerHeight();V=P.compute(U,T,S,W,Q.offset);O.css(V)}while(++R<=5&&(S!==O.outerWidth()||W!==O.outerHeight()));return V}function J(){var R=false;if(c.isTipOpen&&!c.isClosing&&!c.delayInProgress){if(c.activeHover.data(e)===false||c.activeHover.is(":disabled")){R=true}else{if(!v(c.activeHover)&&!c.activeHover.is(":focus")&&!c.activeHover.data(d)){if(O.data(f)){if(!v(O)){R=true}}else{R=true}}}if(R){K(c.activeHover)}}}this.showTip=I;this.hideTip=K;this.resetPosition=G}function q(F){return window.SVGElement&&F[0] instanceof SVGElement}function h(){if(!c.mouseTrackingActive){c.mouseTrackingActive=true;k(function H(){c.scrollLeft=s.scrollLeft();c.scrollTop=s.scrollTop();c.windowWidth=s.width();c.windowHeight=s.height()});A.on("mousemove",i);s.on({resize:function G(){c.windowWidth=s.width();c.windowHeight=s.height()},scroll:function F(){var I=s.scrollLeft(),J=s.scrollTop();if(I!==c.scrollLeft){c.currentX+=I-c.scrollLeft;c.scrollLeft=I}if(J!==c.scrollTop){c.currentY+=J-c.scrollTop;c.scrollTop=J}}})}}function i(F){c.currentX=F.pageX;c.currentY=F.pageY}function v(F){var H=F.offset(),J=F[0].getBoundingClientRect(),I=J.right-J.left,G=J.bottom-J.top;return c.currentX>=H.left&&c.currentX<=H.left+I&&c.currentY>=H.top&&c.currentY<=H.top+G}function B(I){var G=I.data(y),F=I.data(o),K=I.data(l),H,J;if(G){if(k.isFunction(G)){G=G.call(I[0])}J=G}else{if(F){if(k.isFunction(F)){F=F.call(I[0])}if(F.length>0){J=F.clone(true,true)}}else{if(K){H=k("#"+K);if(H.length>0){J=H.html()}}}}return J}function m(M,L,K){var G=c.scrollTop,J=c.scrollLeft,I=G+c.windowHeight,F=J+c.windowWidth,H=p.none;if(M.topI||Math.abs(M.bottom-c.windowHeight)>I){H|=p.bottom}if(M.leftF){H|=p.left}if(M.left+L>F||M.right + + + + + +ArduinoLibs: lcd-form.dox File Reference + + + + + + + + + +
+
+
+ + + + + +
+
ArduinoLibs +
+
+ + + + + + + + + + +
+ +
+ + +
+
+
lcd-form.dox File Reference
+
+
+
+ + + + diff --git a/html/lcd-helloworld_8dox.html b/html/lcd-helloworld_8dox.html new file mode 100644 index 00000000..f2521d80 --- /dev/null +++ b/html/lcd-helloworld_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: lcd-helloworld.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+
+
lcd-helloworld.dox File Reference
+
+
+
+ + + + diff --git a/html/lcd_form.html b/html/lcd_form.html new file mode 100644 index 00000000..53e0cff2 --- /dev/null +++ b/html/lcd_form.html @@ -0,0 +1,224 @@ + + + + + + +ArduinoLibs: Form example for LCD displays + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + +
+ +
+ +
+
+
+
Form example for LCD displays
+
+
+

The Form and Field classes simplify the process of building user interfaces for Arduino projects that use a Freetronics LCD shield. That shield has a 16x2 LCD display and five buttons for Up, Down, Left, Right, and Select.

+

The user interface is organised as a "form" which consists of one or more "fields" that display or modify a single program parameter. The Left and Right buttons are used to navigate between fields, and the Up and Down buttons are used to modify the value of the currently-displayed field.

+
+FormText.png +
+

We start by including the classes from the library that we will need:

+
#include <LCD.h>
+
#include <Form.h>
+
#include <TextField.h>
+
#include <TimeField.h>
+
#include <IntField.h>
+
#include <BoolField.h>
+

+

Next, we initialize the LCD display, create the main form, and populate it with fields:

+
LCD lcd;
+
Form mainForm(lcd);
+
TextField welcomeField(mainForm, "Form example", "v1.0");
+
TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
+
IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
+
BoolField ledField(mainForm, "Status LED", "On", "Off", true);
+
TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
+

+

Each field has a specific type, which may be one of the following classes:

+
    +
  • BoolField displays a boolean on/off value with the Up and Down buttons used to toggle its state.
  • +
  • IntField displays an integer value within a specified range, with the Up and Down buttons used to modify the value.
  • +
  • TextField displays a read-only value, which is typically used for status messages and program results.
  • +
  • TimeField displays a time in hours, minutes, and seconds. The field may be either read-only or writable. Writable time fields can be modified with the Up, Down, Left, and Right buttons to select a specific duration.
  • +
+

Returning to our example, the above code creates the following fields:

+
    +
  • welcomeField to display the program's name and version.
  • +
  • timeField to display the number of seconds since reset, wrapping around after 24 hours. This field is read-only.
  • +
  • volumeField which displays a volume between 0 and 100, with an Up/Down step of 5, and a suffix of "%".
  • +
  • ledField which displays the current boolean state of the status LED on D13; the LED will change state when the user toggles the field's value.
  • +
  • durationField which displays a read-write time field for selecting a duration between 0 and 24 hours.
  • +
+

Now that we have defined our form, we need to initialize the program and show the form for the first time:

+
#define STATUS_LED 13
+
+
void setup() {
+
// Status LED initially on.
+
pinMode(STATUS_LED, OUTPUT);
+
digitalWrite(STATUS_LED, HIGH);
+
+
// Enable the screen saver, which will automatically blank the screen after 10 seconds.
+
// The screen will wake up again when a button is pressed or lcd.display() is called.
+ +
+
// Show the main form for the first time.
+
mainForm.show();
+
}
+

+

An application can have multiple forms, but only one can be shown at any given time. To switch to another form, call Form::hide() on the old form and Form::show() on the new form.

+

All that remains is to define our application's loop function which retrieves button events from LCD::getButton() and dispatches them to the form:

+
void loop() {
+
// Update the number of seconds since reset:
+
timeField.setValue(millis() / 1000);
+
+
// Dispatch button events to the main form.
+
int event = lcd.getButton();
+
if (mainForm.dispatch(event) == FORM_CHANGED) {
+
if (mainForm.isCurrent(ledField)) {
+
if (ledField.value())
+
digitalWrite(STATUS_LED, HIGH);
+
else
+
digitalWrite(STATUS_LED, LOW);
+
}
+
}
+
}
+

+

The full source code for the example follows:

+
/*
+
This example demonstrates how to use the Form and Field classes from the
+
LCD library to provide a simple UI on the 16x2 LCD display.
+
+
This example is placed into the public domain.
+
*/
+
+
// include the library code:
+
#include <LCD.h>
+
#include <Form.h>
+
#include <TextField.h>
+
#include <TimeField.h>
+
#include <IntField.h>
+
#include <BoolField.h>
+
+
// Initialize the LCD
+
LCD lcd;
+
+
// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
+
// other pin (e.g. A1), then you will need to initialize the shield with something like:
+
// LCD lcd(A1);
+
// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
+
+
// Create the main form and its fields.
+
Form mainForm(lcd);
+
TextField welcomeField(mainForm, "Form example", "v1.0");
+
TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
+
IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
+
BoolField ledField(mainForm, "Status LED", "On", "Off", true);
+
TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
+
+
#define STATUS_LED 13
+
+
void setup() {
+
// Status LED initially on.
+
pinMode(STATUS_LED, OUTPUT);
+
digitalWrite(STATUS_LED, HIGH);
+
+
// Enable the screen saver, which will automatically blank the screen after 10 seconds.
+
// The screen will wake up again when a button is pressed or lcd.display() is called.
+ +
+
// Show the main form for the first time.
+
mainForm.show();
+
}
+
+
void loop() {
+
// Update the number of seconds since reset:
+
timeField.setValue(millis() / 1000);
+
+
// Dispatch button events to the main form.
+
int event = lcd.getButton();
+
if (mainForm.dispatch(event) == FORM_CHANGED) {
+
if (mainForm.isCurrent(ledField)) {
+
if (ledField.value())
+
digitalWrite(STATUS_LED, HIGH);
+
else
+
digitalWrite(STATUS_LED, LOW);
+
}
+
}
+
}
+
+
+ + + + diff --git a/html/lcd_hello_world.html b/html/lcd_hello_world.html new file mode 100644 index 00000000..991a111f --- /dev/null +++ b/html/lcd_hello_world.html @@ -0,0 +1,174 @@ + + + + + + +ArduinoLibs: Hello World for Freetronics LCD + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + +
+ +
+ +
+
+
+
Hello World for Freetronics LCD
+
+
+

The LCD class provides an enhanced version of the standard Arduino LiquidCrystal library that supports the additional features of the Freetronics LCD shield; namely the back light and the Up, Down, Left, Right, and Select buttons. This tutorial explains how to use the LCD class to perform basic text output and to use the enhanced shield features.

+
+HelloWorld.png +
+

We start by including the library and initializing it:

+
#include <LCD.h>
+
LCD lcd;
+

+

Unlike the LiquidCrystal library we don't normally need to specify the pin assignments for this shield. The one exception is when the shield is used with the USBDroid and the D9 pin is reassigned as described on this page. In that case, the initialization sequence would look something like this instead:

+
LCD lcd(A1);
+

The next step is to enable the screen saver and print some text in the setup function:

+
void setup() {
+ +
lcd.print("hello, world!");
+
}
+

+

The screen saver is a built-in feature of the LCD class that turns off the display and the back light after a specific timeout (the default is 10 seconds). Pressing any of the keys on the shield or calling LCD::display() will wake up the screen again.

+

In the program's loop function we print the number of seconds since startup to the second line of the LCD display:

+
void loop() {
+
lcd.setCursor(0, 1);
+
lcd.print(millis() / 1000);
+

+

We then print the name of the button that is currently pressed:

+
lcd.setCursor(8, 1);
+
int button = lcd.getButton();
+
if (button == LCD_BUTTON_LEFT)
+
lcd.print("LEFT");
+
else if (button == LCD_BUTTON_RIGHT)
+
lcd.print("RIGHT");
+
else if (button == LCD_BUTTON_UP)
+
lcd.print("UP");
+
else if (button == LCD_BUTTON_DOWN)
+
lcd.print("DOWN");
+
else if (button == LCD_BUTTON_SELECT)
+
lcd.print("SELECT");
+
else if (button < 0) // button release
+
lcd.print(" ");
+
}
+

+

The LCD::getButton() function returns the key that has been pressed or released, or LCD_BUTTON_NONE if no key has been pressed or released this time through the loop.

+

The full source code for the example follows:

+
/*
+
This example demonstrates how to use the LCD library, which extends the
+
standard LiquidCrystal library to provide support for the Freetronics back light
+
and Up/Down/Left/Right/Select buttons. More information on the shield here:
+
+
http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
+
+
This example is placed into the public domain.
+
*/
+
+
#include <LCD.h>
+
LCD lcd;
+
+
// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
+
// other pin (e.g. A1), then you will need to initialize the shield with something like:
+
// LCD lcd(A1);
+
// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
+
+
void setup() {
+ +
lcd.print("hello, world!");
+
}
+
+
void loop() {
+
lcd.setCursor(0, 1);
+
lcd.print(millis() / 1000);
+
+
lcd.setCursor(8, 1);
+
int button = lcd.getButton();
+
if (button == LCD_BUTTON_LEFT)
+
lcd.print("LEFT");
+
else if (button == LCD_BUTTON_RIGHT)
+
lcd.print("RIGHT");
+
else if (button == LCD_BUTTON_UP)
+
lcd.print("UP");
+
else if (button == LCD_BUTTON_DOWN)
+
lcd.print("DOWN");
+
else if (button == LCD_BUTTON_SELECT)
+
lcd.print("SELECT");
+
else if (button < 0) // button release
+
lcd.print(" ");
+
}
+
+
+ + + + diff --git a/html/mainpage_8dox.html b/html/mainpage_8dox.html new file mode 100644 index 00000000..49e453b1 --- /dev/null +++ b/html/mainpage_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: mainpage.dox File Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+
+
mainpage.dox File Reference
+
+
+
+ + + + diff --git a/html/modules.html b/html/modules.html new file mode 100644 index 00000000..98d71dba --- /dev/null +++ b/html/modules.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: Modules + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + +
+ + + + +
+ +
+ +
+
+
Modules
+
+
+
Here is a list of all modules:
+
+ + + + diff --git a/html/nav_f.png b/html/nav_f.png new file mode 100644 index 00000000..72a58a52 Binary files /dev/null and b/html/nav_f.png differ diff --git a/html/nav_g.png b/html/nav_g.png new file mode 100644 index 00000000..2093a237 Binary files /dev/null and b/html/nav_g.png differ diff --git a/html/nav_h.png b/html/nav_h.png new file mode 100644 index 00000000..33389b10 Binary files /dev/null and b/html/nav_h.png differ diff --git a/html/open.png b/html/open.png new file mode 100644 index 00000000..30f75c7e Binary files /dev/null and b/html/open.png differ diff --git a/html/pages.html b/html/pages.html new file mode 100644 index 00000000..d3022691 --- /dev/null +++ b/html/pages.html @@ -0,0 +1,108 @@ + + + + + + +ArduinoLibs: Related Pages + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + +
+ + + + +
+ +
+ +
+
+
Related Pages
+
+ + + + + diff --git a/html/radio_controller.png b/html/radio_controller.png new file mode 100644 index 00000000..6325bf40 Binary files /dev/null and b/html/radio_controller.png differ diff --git a/html/ring_oscillator.png b/html/ring_oscillator.png new file mode 100644 index 00000000..c0939bc3 Binary files /dev/null and b/html/ring_oscillator.png differ diff --git a/html/ring_oscillator_basic.png b/html/ring_oscillator_basic.png new file mode 100644 index 00000000..896fe0ac Binary files /dev/null and b/html/ring_oscillator_basic.png differ diff --git a/html/ring_oscillator_multi.png b/html/ring_oscillator_multi.png new file mode 100644 index 00000000..d8324d6f Binary files /dev/null and b/html/ring_oscillator_multi.png differ diff --git a/html/ring_oscillator_sampled.png b/html/ring_oscillator_sampled.png new file mode 100644 index 00000000..0cd3d071 Binary files /dev/null and b/html/ring_oscillator_sampled.png differ diff --git a/html/search/all_0.html b/html/search/all_0.html new file mode 100644 index 00000000..17b6da85 --- /dev/null +++ b/html/search/all_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_0.js b/html/search/all_0.js new file mode 100644 index 00000000..02e008ed --- /dev/null +++ b/html/search/all_0.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['addfield',['addField',['../classForm.html#a5cb056ace428e75e321610555bfecac7',1,'Form']]], + ['addnoisesource',['addNoiseSource',['../classRNGClass.html#aacf23b192b0e4cc8726d9abe05f5a9db',1,'RNGClass']]], + ['adjustdays',['adjustDays',['../classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d',1,'RTC']]], + ['adjustmonths',['adjustMonths',['../classRTC.html#aeca597e6e37a05716e664242f9cfc5f4',1,'RTC']]], + ['adjustyears',['adjustYears',['../classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d',1,'RTC']]], + ['advance',['advance',['../classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b',1,'ChaseLEDs']]], + ['advancetime',['advanceTime',['../classChaseLEDs.html#aed060c51bb63dd8065be89f895989700',1,'ChaseLEDs']]], + ['aes128',['AES128',['../classAES128.html',1,'AES128'],['../classAES128.html#af826ce33301767919bb60f27ad3ff693',1,'AES128::AES128()']]], + ['aes192',['AES192',['../classAES192.html',1,'AES192'],['../classAES192.html#a6f8e457cfffdc12f7dd829e3ac4585ce',1,'AES192::AES192()']]], + ['aes256',['AES256',['../classAES256.html',1,'AES256'],['../classAES256.html#a3b2cbe56f03a87ec4260be4f8914fb02',1,'AES256::AES256()']]], + ['aescommon',['AESCommon',['../classAESCommon.html',1,'AESCommon'],['../classAESCommon.html#acf224a392659429bac80dc68c7471b21',1,'AESCommon::AESCommon()']]], + ['alarm_2dclock_2edox',['alarm-clock.dox',['../alarm-clock_8dox.html',1,'']]], + ['alarm_20clock',['Alarm Clock',['../alarm_clock.html',1,'']]], + ['alarm_5fcount',['ALARM_COUNT',['../classRTC.html#aee5ae8f600ee5296e65635c0d836fca3',1,'RTC']]], + ['auto_5frepeat',['AUTO_REPEAT',['../classIRreceiver.html#a9c37631cc1291dc47cabcfef2f631cf9',1,'IRreceiver']]], + ['available',['available',['../classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf',1,'EEPROM24::available()'],['../classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833',1,'I2CMaster::available()'],['../classSoftI2C.html#a849af91018caedbb82e83f02c543305e',1,'SoftI2C::available()'],['../classRNGClass.html#a49e3231ba65a5e4b045bc90976e0a659',1,'RNGClass::available()']]] +]; diff --git a/html/search/all_1.html b/html/search/all_1.html new file mode 100644 index 00000000..e2906449 --- /dev/null +++ b/html/search/all_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_1.js b/html/search/all_1.js new file mode 100644 index 00000000..de6a37b3 --- /dev/null +++ b/html/search/all_1.js @@ -0,0 +1,22 @@ +var searchData= +[ + ['backlightoff',['BacklightOff',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c',1,'LCD']]], + ['backlightonselect',['BacklightOnSelect',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35',1,'LCD']]], + ['backlightpin',['backlightPin',['../classLCD.html#a171f59ba80e7775ebd3a399f56482a9c',1,'LCD']]], + ['begin',['begin',['../classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8',1,'RNGClass']]], + ['bitmap',['Bitmap',['../classBitmap.html',1,'Bitmap'],['../classBitmap.html#a40526748415c8bbc58a8510d636c20f4',1,'Bitmap::Bitmap()']]], + ['bitsperpixel',['bitsPerPixel',['../classBitmap.html#ad18d3d5a1e77d541a95e93ad1f958411',1,'Bitmap']]], + ['black',['Black',['../classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc',1,'Bitmap']]], + ['blake2b',['BLAKE2b',['../classBLAKE2b.html',1,'BLAKE2b'],['../classBLAKE2b.html#a19b3b751809905a5587468f0d6c666ff',1,'BLAKE2b::BLAKE2b()']]], + ['blake2s',['BLAKE2s',['../classBLAKE2s.html',1,'BLAKE2s'],['../classBLAKE2s.html#a7345f4e08c19d7a8c278282b46df21a2',1,'BLAKE2s::BLAKE2s()']]], + ['blink_2dblink_2edox',['blink-blink.dox',['../blink-blink_8dox.html',1,'']]], + ['blink_2dcharlieplex_2edox',['blink-charlieplex.dox',['../blink-charlieplex_8dox.html',1,'']]], + ['blink_2dcylon_2edox',['blink-cylon.dox',['../blink-cylon_8dox.html',1,'']]], + ['blink_2dstartrek_2edox',['blink-startrek.dox',['../blink-startrek_8dox.html',1,'']]], + ['blinking_20led_20example',['Blinking LED Example',['../blink_blink.html',1,'']]], + ['blinkled',['BlinkLED',['../classBlinkLED.html',1,'BlinkLED'],['../classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f',1,'BlinkLED::BlinkLED()']]], + ['blockcipher',['BlockCipher',['../classBlockCipher.html',1,'BlockCipher'],['../classBlockCipher.html#adc3d7cba116cbea9ad017f4cded6fe2f',1,'BlockCipher::BlockCipher()']]], + ['blocksize',['blockSize',['../classAESCommon.html#ae26afdcc6d18e8888974acae16df1413',1,'AESCommon::blockSize()'],['../classBLAKE2b.html#abec1b2320c3afaed12a29cf081b95fe2',1,'BLAKE2b::blockSize()'],['../classBLAKE2s.html#a9b5403734c20a0591d72a98912e4a305',1,'BLAKE2s::blockSize()'],['../classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0',1,'BlockCipher::blockSize()'],['../classHash.html#a4e4297812e3483410556830fe5d47bdf',1,'Hash::blockSize()'],['../classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a',1,'KeccakCore::blockSize()'],['../classSHA1.html#a816e3fd1a02cf1ecc67866cd8c7c309a',1,'SHA1::blockSize()'],['../classSHA256.html#a71bbd9064f9d6191d0647f867953a858',1,'SHA256::blockSize()'],['../classSHA3__256.html#a88a50ab6c2d4ad105cda2dd504d96e7c',1,'SHA3_256::blockSize()'],['../classSHA3__512.html#a4493a717bad8fa5cd35fe3aa36f25ab3',1,'SHA3_512::blockSize()'],['../classSHA512.html#acf8b9bcb6be91ee70acc3700a2ffa1a1',1,'SHA512::blockSize()']]], + ['boolfield',['BoolField',['../classBoolField.html',1,'BoolField'],['../classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998',1,'BoolField::BoolField(const String &label)'],['../classBoolField.html#a49aad212ed18f84baa105c24e86281d9',1,'BoolField::BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)']]], + ['bytecount',['byteCount',['../classDS1307RTC.html#a93c25269a9b78ab3331354db26672248',1,'DS1307RTC::byteCount()'],['../classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e',1,'DS3232RTC::byteCount()'],['../classRTC.html#acfdebfb449710e44e11f9a3675e14fd8',1,'RTC::byteCount()']]] +]; diff --git a/html/search/all_10.html b/html/search/all_10.html new file mode 100644 index 00000000..c55c8367 --- /dev/null +++ b/html/search/all_10.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_10.js b/html/search/all_10.js new file mode 100644 index 00000000..245dfd07 --- /dev/null +++ b/html/search/all_10.js @@ -0,0 +1,80 @@ +var searchData= +[ + ['star_20trek_20example',['Star Trek Example',['../blink_startrek.html',1,'']]], + ['snake_20video_20game_20using_20an_20infrared_20remote_20control',['Snake Video Game Using an Infrared Remote Control',['../ir_snake.html',1,'']]], + ['save',['save',['../classRNGClass.html#a139584fb249148e2058d1d645d090db7',1,'RNGClass']]], + ['screensavermode',['ScreenSaverMode',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28',1,'LCD::ScreenSaverMode()'],['../classLCD.html#a1917fa285f81f476b4c7cc20d15456b8',1,'LCD::screenSaverMode() const ']]], + ['scroll',['scroll',['../classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a',1,'Bitmap::scroll(int dx, int dy, Color fillColor=Black)'],['../classBitmap.html#af79ad4432297ff453fddc55625fec485',1,'Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)']]], + ['second',['second',['../structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91',1,'RTCTime::second()'],['../structRTCAlarm.html#ab749e3695ee5c5dd703aec71f72d46a1',1,'RTCAlarm::second()']]], + ['seed_5fsize',['SEED_SIZE',['../classRNGClass.html#ae3a013bfc73795fd26ee36e70d89f4c2',1,'RNGClass']]], + ['setadvancetime',['setAdvanceTime',['../classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7',1,'ChaseLEDs']]], + ['setalarm',['setAlarm',['../classDS3231RTC.html#adb8b36354f00ea0a862cce6b1805d4c0',1,'DS3231RTC']]], + ['setautosavetime',['setAutoSaveTime',['../classRNGClass.html#a5848e87a5f2f0302c88b0377f0e3366d',1,'RNGClass']]], + ['setbacklightpin',['setBacklightPin',['../classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8',1,'LCD']]], + ['setblinkrate',['setBlinkRate',['../classBlinkLED.html#a47f95624881063aa91c0066ed2c92258',1,'BlinkLED']]], + ['setblockcipher',['setBlockCipher',['../classCBCCommon.html#a0b7631244b0c2c954cfdb50eb32f7db1',1,'CBCCommon::setBlockCipher()'],['../classCFBCommon.html#a9161530f456efacb64f5008fdb1a460c',1,'CFBCommon::setBlockCipher()'],['../classCTRCommon.html#a6c409c4ec1f99e0cb751196d891dc228',1,'CTRCommon::setBlockCipher()'],['../classOFBCommon.html#a0053e2566a88859effffacbf1e4ade04',1,'OFBCommon::setBlockCipher()']]], + ['setcapacity',['setCapacity',['../classKeccakCore.html#ab3c1905f2002e49aca085d6f0b5546f7',1,'KeccakCore']]], + ['setcounter',['setCounter',['../classChaCha.html#acab9109b7189ea88d9e5417a3a209eac',1,'ChaCha']]], + ['setcountersize',['setCounterSize',['../classCTRCommon.html#ae2bc6b33a864412598b426320d853337',1,'CTRCommon']]], + ['setcurrentfield',['setCurrentField',['../classForm.html#ae6004fedfa07191ffd47d7b12370b4e5',1,'Form']]], + ['setdoublebuffer',['setDoubleBuffer',['../classDMD.html#a6fbdcf8832f91d02500cb7a9b84d2723',1,'DMD']]], + ['setfalselabel',['setFalseLabel',['../classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a',1,'BoolField']]], + ['setfont',['setFont',['../classBitmap.html#a64d7a9651d5c385a044cc910a3b82837',1,'Bitmap']]], + ['sethmackey',['setHMACKey',['../classKeccakCore.html#aeff6b3357916bf426b60d3629db52628',1,'KeccakCore']]], + ['setholdtime',['setHoldTime',['../classCharlieplex.html#a8502f4c752faba37023ced587695f6a4',1,'Charlieplex']]], + ['setitems',['setItems',['../classListField.html#ae6709bce9355451b651893691456704e',1,'ListField']]], + ['setiv',['setIV',['../classCBCCommon.html#ac7a586217835055b3a354bb932db160c',1,'CBCCommon::setIV()'],['../classCFBCommon.html#a597040eb7df40adbbef94b4c3975cd80',1,'CFBCommon::setIV()'],['../classChaCha.html#a734f3246b1e6810c63637b8cda26b259',1,'ChaCha::setIV()'],['../classCipher.html#a3777acd8ff776a4e945bb7c9f2d044d9',1,'Cipher::setIV()'],['../classCTRCommon.html#aad289af3eb013cb3ffda6d7e8e8b3d04',1,'CTRCommon::setIV()'],['../classOFBCommon.html#a4a35364cf30d78f1968cc00803686caf',1,'OFBCommon::setIV()']]], + ['setkey',['setKey',['../classAES128.html#a42d7548eb5084a2c3e2d5aa5f6f98ba4',1,'AES128::setKey()'],['../classAES192.html#a4ab37cff19fb05ceef1533ebc5e37cde',1,'AES192::setKey()'],['../classAES256.html#a6af085d2d6a730ff1e025f982121bbda',1,'AES256::setKey()'],['../classBlockCipher.html#a9a05307664469777592799c8f77397c4',1,'BlockCipher::setKey()'],['../classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37',1,'CBCCommon::setKey()'],['../classCFBCommon.html#a45b9be25fb96f0e3ca5211b064e2baea',1,'CFBCommon::setKey()'],['../classChaCha.html#a6b2bdffbd3705e388bb458edb2f40c90',1,'ChaCha::setKey()'],['../classCipher.html#a0dfe133bda81dfa680b668f5908ccbe5',1,'Cipher::setKey()'],['../classCTRCommon.html#a79da937dc2c444a174176beab33c055a',1,'CTRCommon::setKey()'],['../classOFBCommon.html#ac3a98e81d95ebc6c883baef5f4cfbefb',1,'OFBCommon::setKey()']]], + ['setlabel',['setLabel',['../classField.html#ad4ea63599d780c35b296cf2840b69f7b',1,'Field']]], + ['setled',['setLed',['../classCharlieplex.html#ab103c9687a0890faf72e4da79e3de0a5',1,'Charlieplex']]], + ['setloopcount',['setLoopCount',['../classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b',1,'Melody']]], + ['setloopduration',['setLoopDuration',['../classMelody.html#ae88ad06c2acb728f56dd213d5dad6006',1,'Melody']]], + ['setmaxhours',['setMaxHours',['../classTimeField.html#a7ac124eb9dde01c18c711c421736b5ed',1,'TimeField']]], + ['setmaxvalue',['setMaxValue',['../classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1',1,'IntField']]], + ['setmelody',['setMelody',['../classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254',1,'Melody']]], + ['setminvalue',['setMinValue',['../classIntField.html#afffe7be6721a043cec7a5a85c19e0ada',1,'IntField']]], + ['setnumrounds',['setNumRounds',['../classChaCha.html#a1a0911e0be8f4590d7fb76884d98c541',1,'ChaCha']]], + ['setpixel',['setPixel',['../classBitmap.html#aac994b75418e7d37ec66829437329114',1,'Bitmap']]], + ['setpwmled',['setPwmLed',['../classCharlieplex.html#a605a302e13005a1aa3d68d0e22bc474b',1,'Charlieplex']]], + ['setreadonly',['setReadOnly',['../classTimeField.html#a3f002a0729e90e88d04025908be102fe',1,'TimeField']]], + ['setscreensavermode',['setScreenSaverMode',['../classLCD.html#a56d1f68532c779c65fbbd071fb444801',1,'LCD']]], + ['setstate',['setState',['../classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4',1,'BlinkLED']]], + ['setstepvalue',['setStepValue',['../classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb',1,'IntField']]], + ['setsuffix',['setSuffix',['../classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd',1,'IntField']]], + ['setsystemfilter',['setSystemFilter',['../classIRreceiver.html#a920828f1411fa12d1856cd933066bd08',1,'IRreceiver']]], + ['settextcolor',['setTextColor',['../classBitmap.html#a8e225a4f188269bb18265ae4b49de0a3',1,'Bitmap']]], + ['settruelabel',['setTrueLabel',['../classBoolField.html#a803fc8c39765da4a44af01d925cd4194',1,'BoolField']]], + ['setvalue',['setValue',['../classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577',1,'BoolField::setValue()'],['../classIntField.html#aed421e2c52946f2c7643534b4f6f13f7',1,'IntField::setValue()'],['../classListField.html#a266193631e897fb0b46e1270b1d0eb24',1,'ListField::setValue()'],['../classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033',1,'TextField::setValue()'],['../classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1',1,'TimeField::setValue()']]], + ['sha1',['SHA1',['../classSHA1.html',1,'SHA1'],['../classSHA1.html#ad49a5108ffd6996b1133bf41224ff726',1,'SHA1::SHA1()']]], + ['sha256',['SHA256',['../classSHA256.html',1,'SHA256'],['../classSHA256.html#ab672831c542df07ff03ded25760feec2',1,'SHA256::SHA256()']]], + ['sha3_5f256',['SHA3_256',['../classSHA3__256.html',1,'SHA3_256'],['../classSHA3__256.html#ac091b276c6d80a981fa64a9e8c68ca87',1,'SHA3_256::SHA3_256()']]], + ['sha3_5f512',['SHA3_512',['../classSHA3__512.html',1,'SHA3_512'],['../classSHA3__512.html#a5f8bc4180e9d19597f499468098a82a4',1,'SHA3_512::SHA3_512()']]], + ['sha512',['SHA512',['../classSHA512.html',1,'SHA512'],['../classSHA512.html#a520d966d99c0008e3cc58bd3b77dafcd',1,'SHA512::SHA512()']]], + ['show',['show',['../classForm.html#a9e8d718ab55a8034c22c606ccfa90d65',1,'Form']]], + ['size',['size',['../classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c',1,'EEPROM24']]], + ['sleep_5f120_5fms',['SLEEP_120_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a96fa577b54aa6f2341ea5ddd839aa8bc',1,'PowerSave.h']]], + ['sleep_5f15_5fms',['SLEEP_15_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a3d16487a7386c6348f1c1d886564e3c4',1,'PowerSave.h']]], + ['sleep_5f1_5fsec',['SLEEP_1_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a92310daf29e5899770b80c1c4e850b9b',1,'PowerSave.h']]], + ['sleep_5f250_5fms',['SLEEP_250_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36abcbf68cfdb688220da61ac98b1a2ec69',1,'PowerSave.h']]], + ['sleep_5f2_5fsec',['SLEEP_2_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a04571aa0b801c28cd756513303b229cd',1,'PowerSave.h']]], + ['sleep_5f30_5fms',['SLEEP_30_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36af31050c5ef733b3e231920143b041825',1,'PowerSave.h']]], + ['sleep_5f4_5fsec',['SLEEP_4_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a4cba1036d7a69225110b68b372f10410',1,'PowerSave.h']]], + ['sleep_5f500_5fms',['SLEEP_500_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36aa49e4d5f92a5f48070dde0babf75a9b0',1,'PowerSave.h']]], + ['sleep_5f60_5fms',['SLEEP_60_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a716f5a9f35e77a2d334ad71f05bd5fdc',1,'PowerSave.h']]], + ['sleep_5f8_5fsec',['SLEEP_8_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a8c47dd1ef81c2f41da7525b5ee4bfc3a',1,'PowerSave.h']]], + ['sleepduration',['SleepDuration',['../group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36',1,'PowerSave.h']]], + ['sleepfor',['sleepFor',['../group__power__save.html#ga95c1666038493a7f95be6768882eebad',1,'sleepFor(SleepDuration duration, uint8_t mode): PowerSave.cpp'],['../group__power__save.html#ga95c1666038493a7f95be6768882eebad',1,'sleepFor(SleepDuration duration, uint8_t mode=0): PowerSave.cpp']]], + ['softi2c',['SoftI2C',['../classSoftI2C.html',1,'SoftI2C'],['../classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc',1,'SoftI2C::SoftI2C()']]], + ['startread',['startRead',['../classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde',1,'I2CMaster::startRead()'],['../classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3',1,'SoftI2C::startRead()']]], + ['startwrite',['startWrite',['../classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35',1,'I2CMaster::startWrite()'],['../classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9',1,'SoftI2C::startWrite()']]], + ['state',['state',['../classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233',1,'BlinkLED']]], + ['stepvalue',['stepValue',['../classIntField.html#a49025ee3473fe066a6a6c546af98bfbd',1,'IntField']]], + ['stir',['stir',['../classNoiseSource.html#a7ce647815524fe84f562aca5256e12f3',1,'NoiseSource::stir()'],['../classRingOscillatorNoiseSource.html#ad71698b5c92b41eef2f1322999b3eff9',1,'RingOscillatorNoiseSource::stir()'],['../classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02',1,'RNGClass::stir()'],['../classTransistorNoiseSource.html#add25c6a14b0506bc30ca781f2d923917',1,'TransistorNoiseSource::stir()']]], + ['stop',['stop',['../classMelody.html#ac0c552233c41d85f2766d2e4df376b2b',1,'Melody']]], + ['stride',['stride',['../classBitmap.html#af30df263729385ea2330effe3c80a1bc',1,'Bitmap']]], + ['suffix',['suffix',['../classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05',1,'IntField']]], + ['swapbuffers',['swapBuffers',['../classDMD.html#a80269ccd44b3ef9ee15f0a1009b7a60a',1,'DMD']]], + ['swapbuffersandcopy',['swapBuffersAndCopy',['../classDMD.html#a0b1771cf790b2b62eea55e56b02e3736',1,'DMD']]], + ['system',['system',['../classIRreceiver.html#a19e9334ae97812fa85078507d105478f',1,'IRreceiver']]], + ['systemfilter',['systemFilter',['../classIRreceiver.html#a2c6adc404f71f263ba535ec1ed9cff1a',1,'IRreceiver']]] +]; diff --git a/html/search/all_11.html b/html/search/all_11.html new file mode 100644 index 00000000..6f3943a9 --- /dev/null +++ b/html/search/all_11.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_11.js b/html/search/all_11.js new file mode 100644 index 00000000..f67bae63 --- /dev/null +++ b/html/search/all_11.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['textcolor',['textColor',['../classBitmap.html#ab6e5f5744fd2f18478aac428b751d848',1,'Bitmap']]], + ['textfield',['TextField',['../classTextField.html',1,'TextField'],['../classTextField.html#a5108741ab147b2cd5a399fefbe0a2382',1,'TextField::TextField(const String &label)'],['../classTextField.html#a24096a344d9161b2c99ce724ec2ee93c',1,'TextField::TextField(Form &form, const String &label, const String &value)']]], + ['textheight',['textHeight',['../classBitmap.html#a628bb694fcfe6eab619a4f1e152d41c4',1,'Bitmap']]], + ['textwidth',['textWidth',['../classBitmap.html#a0f7607b1c7867987f4500d490a666e8a',1,'Bitmap::textWidth(const char *str, int len=-1) const '],['../classBitmap.html#a8ca70aa0f8f722a228358bffe794e925',1,'Bitmap::textWidth(const String &str, int start=0, int len=-1) const ']]], + ['timefield',['TimeField',['../classTimeField.html',1,'TimeField'],['../classTimeField.html#a138e2425379705828a87eb2d8a836431',1,'TimeField::TimeField(const String &label)'],['../classTimeField.html#a87f222bc098367963ed21a7edc4624de',1,'TimeField::TimeField(Form &form, const String &label, int maxHours, bool readOnly)']]], + ['transistornoisesource',['TransistorNoiseSource',['../classTransistorNoiseSource.html',1,'TransistorNoiseSource'],['../classTransistorNoiseSource.html#a05bab61c301a5397021048c95ca3107d',1,'TransistorNoiseSource::TransistorNoiseSource()']]], + ['truelabel',['trueLabel',['../classBoolField.html#a9972030beec6e007b556c6eb652e163d',1,'BoolField']]] +]; diff --git a/html/search/all_12.html b/html/search/all_12.html new file mode 100644 index 00000000..3c7c89ef --- /dev/null +++ b/html/search/all_12.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_12.js b/html/search/all_12.js new file mode 100644 index 00000000..4d6b3005 --- /dev/null +++ b/html/search/all_12.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['unusedpin',['unusedPin',['../group__power__save.html#ga6dbe8e20a70e83cf5b068177675ec792',1,'PowerSave.h']]], + ['update',['update',['../classBLAKE2b.html#a468e48c66ce1738e11c922d133135069',1,'BLAKE2b::update()'],['../classBLAKE2s.html#aa192da2fa044b03cccaf11e87fdf9911',1,'BLAKE2s::update()'],['../classHash.html#aec9761ee427d122e7450de8df200265c',1,'Hash::update()'],['../classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed',1,'KeccakCore::update()'],['../classSHA1.html#aec77fbc5015f82bbf7055e535085656a',1,'SHA1::update()'],['../classSHA256.html#a555bf8efb17afd4842d2e55a1f39f27b',1,'SHA256::update()'],['../classSHA3__256.html#a8356957ea403c5da326fc6899b91ea71',1,'SHA3_256::update()'],['../classSHA3__512.html#a0563e4c87150e6019671b4fe92fd63a4',1,'SHA3_512::update()'],['../classSHA512.html#a7d37a20d7ab431ab15d094f768b6a695',1,'SHA512::update()']]], + ['updatecursor',['updateCursor',['../classField.html#afc612378167be0e7f8a6f8395b3537bd',1,'Field']]] +]; diff --git a/html/search/all_13.html b/html/search/all_13.html new file mode 100644 index 00000000..0bd629b8 --- /dev/null +++ b/html/search/all_13.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_13.js b/html/search/all_13.js new file mode 100644 index 00000000..46d0b7fe --- /dev/null +++ b/html/search/all_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['value',['value',['../classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39',1,'BoolField::value()'],['../classIntField.html#a2fb650827ce8cb4662253bb6c32acb52',1,'IntField::value()'],['../classListField.html#aab8477757cd89bacd242c85bac2dccb1',1,'ListField::value()'],['../classTextField.html#a124764b6fc7c19aaf683f72cd42636b1',1,'TextField::value()'],['../classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f',1,'TimeField::value()']]] +]; diff --git a/html/search/all_14.html b/html/search/all_14.html new file mode 100644 index 00000000..2ad638b2 --- /dev/null +++ b/html/search/all_14.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_14.js b/html/search/all_14.js new file mode 100644 index 00000000..4166a089 --- /dev/null +++ b/html/search/all_14.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['white',['White',['../classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7',1,'Bitmap']]], + ['width',['width',['../classBitmap.html#a76c3b49e535761f07c553e7336daf523',1,'Bitmap']]], + ['wrap',['WRAP',['../classRTC.html#a02ace2d775063be9a99035851c9274eb',1,'RTC']]], + ['write',['write',['../classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8',1,'EEPROM24::write(unsigned long address, uint8_t value)'],['../classEEPROM24.html#a3d918ed34da7ca6d21a776c0614eebf3',1,'EEPROM24::write(unsigned long address, const void *data, size_t length)'],['../classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960',1,'I2CMaster::write()'],['../classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73',1,'SoftI2C::write()']]], + ['writealarm',['writeAlarm',['../classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75',1,'DS1307RTC::writeAlarm()'],['../classDS3231RTC.html#a1ed8945018024816600f709c6eb0c749',1,'DS3231RTC::writeAlarm()'],['../classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75',1,'DS3232RTC::writeAlarm()'],['../classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e',1,'RTC::writeAlarm()']]], + ['writebyte',['writeByte',['../classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6',1,'DS1307RTC::writeByte()'],['../classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a',1,'DS3232RTC::writeByte()'],['../classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749',1,'RTC::writeByte()']]], + ['writedate',['writeDate',['../classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230',1,'DS1307RTC::writeDate()'],['../classDS3231RTC.html#a450a143514a5aa228f8ef7a23d83d036',1,'DS3231RTC::writeDate()'],['../classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed',1,'DS3232RTC::writeDate()'],['../classRTC.html#ae667600d05c8e7b06a93574dd068a4d7',1,'RTC::writeDate()']]], + ['writetime',['writeTime',['../classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8',1,'DS1307RTC::writeTime()'],['../classDS3231RTC.html#ae9bee8f68f9e124562230175ca9d15c3',1,'DS3231RTC::writeTime()'],['../classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78',1,'DS3232RTC::writeTime()'],['../classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e',1,'RTC::writeTime()']]] +]; diff --git a/html/search/all_15.html b/html/search/all_15.html new file mode 100644 index 00000000..d3b5274b --- /dev/null +++ b/html/search/all_15.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_15.js b/html/search/all_15.js new file mode 100644 index 00000000..d4472111 --- /dev/null +++ b/html/search/all_15.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['year',['year',['../structRTCDate.html#a7d31822daff3c3fc947386abd897732f',1,'RTCDate']]] +]; diff --git a/html/search/all_16.html b/html/search/all_16.html new file mode 100644 index 00000000..b4e3666f --- /dev/null +++ b/html/search/all_16.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_16.js b/html/search/all_16.js new file mode 100644 index 00000000..4bc2b6bb --- /dev/null +++ b/html/search/all_16.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['_7eaescommon',['~AESCommon',['../classAESCommon.html#a8f67970c86c23affb0297fc1bb10fad8',1,'AESCommon']]], + ['_7ebitmap',['~Bitmap',['../classBitmap.html#a72d2a301ec1eb1c8d0f3d64823659a8e',1,'Bitmap']]], + ['_7eblake2b',['~BLAKE2b',['../classBLAKE2b.html#ad0287d7284000ff236153e6afa0130f1',1,'BLAKE2b']]], + ['_7eblake2s',['~BLAKE2s',['../classBLAKE2s.html#a4b3187ecaa3d3c8febfbb40c0f779aa7',1,'BLAKE2s']]], + ['_7eblockcipher',['~BlockCipher',['../classBlockCipher.html#acec1bc4faeaa6dda2d91bffd79a988f9',1,'BlockCipher']]], + ['_7ecbccommon',['~CBCCommon',['../classCBCCommon.html#a45a91367531b4692b3bb7237ab6e9015',1,'CBCCommon']]], + ['_7ecfbcommon',['~CFBCommon',['../classCFBCommon.html#ae200d7b876a1f154bcdb1cdf33d3be54',1,'CFBCommon']]], + ['_7echarlieplex',['~Charlieplex',['../classCharlieplex.html#a4dbe37ccba8ba18139f4e710afdcd103',1,'Charlieplex']]], + ['_7ecipher',['~Cipher',['../classCipher.html#a84bdea765f7e35aa5b5950dd2853a383',1,'Cipher']]], + ['_7edmd',['~DMD',['../classDMD.html#a7b37e05584d3e0308163700920df99b2',1,'DMD']]], + ['_7efield',['~Field',['../classField.html#a45d6e6d09b8f8e46de62b40119d62c60',1,'Field']]], + ['_7eform',['~Form',['../classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f',1,'Form']]], + ['_7ehash',['~Hash',['../classHash.html#a4e4b4797dda8678aaed058bae155813e',1,'Hash']]], + ['_7ekeccakcore',['~KeccakCore',['../classKeccakCore.html#a4579e3a9b24f1d615fa8d660c23e77a4',1,'KeccakCore']]], + ['_7enoisesource',['~NoiseSource',['../classNoiseSource.html#a4eca1e894a5d719fb9bf4df34a791cdb',1,'NoiseSource']]], + ['_7eofbcommon',['~OFBCommon',['../classOFBCommon.html#aae7435157e51bf977d3481e94e17ae01',1,'OFBCommon']]], + ['_7erngclass',['~RNGClass',['../classRNGClass.html#aef3ee2fb14a39caf650dc90a0226dd31',1,'RNGClass']]], + ['_7esha1',['~SHA1',['../classSHA1.html#a8485d7c14fa29286cd3c7acfe438606d',1,'SHA1']]], + ['_7esha256',['~SHA256',['../classSHA256.html#ad82f2925b612de315b289017e023a73b',1,'SHA256']]], + ['_7esha3_5f256',['~SHA3_256',['../classSHA3__256.html#a835d09eb88d477cd162330c493cbdf64',1,'SHA3_256']]], + ['_7esha3_5f512',['~SHA3_512',['../classSHA3__512.html#a327005ebc8c0768118ec7d334c583f85',1,'SHA3_512']]], + ['_7esha512',['~SHA512',['../classSHA512.html#a777ec274fa838684b0208369c5f66391',1,'SHA512']]] +]; diff --git a/html/search/all_2.html b/html/search/all_2.html new file mode 100644 index 00000000..95ded122 --- /dev/null +++ b/html/search/all_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_2.js b/html/search/all_2.js new file mode 100644 index 00000000..6ea117ce --- /dev/null +++ b/html/search/all_2.js @@ -0,0 +1,29 @@ +var searchData= +[ + ['charlieplexing_20example',['Charlieplexing Example',['../blink_charlieplex.html',1,'']]], + ['cylon_20eyes_20example',['Cylon Eyes Example',['../blink_cylon.html',1,'']]], + ['calibrating',['calibrating',['../classNoiseSource.html#ac8ac086f830efb5ffe3e8d506aa61c85',1,'NoiseSource::calibrating()'],['../classRingOscillatorNoiseSource.html#ade7f7ed390e23722347b3c207912b3f9',1,'RingOscillatorNoiseSource::calibrating()'],['../classTransistorNoiseSource.html#a9244b327c291c737396e769da9c66af9',1,'TransistorNoiseSource::calibrating()']]], + ['capacity',['capacity',['../classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e',1,'KeccakCore']]], + ['cbc',['CBC',['../classCBC.html',1,'CBC< T >'],['../classCBC.html#ae22d0d9347d5f3c97328e643a9b29ecb',1,'CBC::CBC()']]], + ['cbccommon',['CBCCommon',['../classCBCCommon.html',1,'CBCCommon'],['../classCBCCommon.html#a7575b369910e05f54e76698dd04bfa05',1,'CBCCommon::CBCCommon()']]], + ['cfb',['CFB',['../classCFB.html',1,'CFB< T >'],['../classCFB.html#a26a027614d027162c67085a58b512318',1,'CFB::CFB()']]], + ['cfbcommon',['CFBCommon',['../classCFBCommon.html',1,'CFBCommon'],['../classCFBCommon.html#adad0210430c83817c993bdca30d562a6',1,'CFBCommon::CFBCommon()']]], + ['chacha',['ChaCha',['../classChaCha.html',1,'ChaCha'],['../classChaCha.html#a5831811b705d3c80e97f0242597f0c7e',1,'ChaCha::ChaCha()']]], + ['charlieplex',['Charlieplex',['../classCharlieplex.html',1,'Charlieplex'],['../classCharlieplex.html#abfb0d0456bcbadbf60c21f615adacdbd',1,'Charlieplex::Charlieplex()']]], + ['charwidth',['charWidth',['../classBitmap.html#a9b79ac13077ca865e4515510297780bd',1,'Bitmap']]], + ['chaseleds',['ChaseLEDs',['../classChaseLEDs.html',1,'ChaseLEDs'],['../classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78',1,'ChaseLEDs::ChaseLEDs()']]], + ['cipher',['Cipher',['../classCipher.html',1,'Cipher'],['../classCipher.html#a6a61077eca3ccd5900f92ceac58fb09c',1,'Cipher::Cipher()']]], + ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classSHA1.html#a41a159d6565b04d3f620dcd720faaf3f',1,'SHA1::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()']]], + ['color',['Color',['../classBitmap.html#a88d386944a7017aa776a177b10d8b2ba',1,'Bitmap']]], + ['command',['command',['../classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda',1,'IRreceiver']]], + ['copy',['copy',['../classBitmap.html#ab22fe1f3871934987a670b559f67c67c',1,'Bitmap']]], + ['count',['count',['../classCharlieplex.html#a5008aa4143d381ce34a3aed1a3843e4e',1,'Charlieplex']]], + ['cryptographic_20library',['Cryptographic Library',['../crypto.html',1,'']]], + ['crypto_2drng_2dring_2edox',['crypto-rng-ring.dox',['../crypto-rng-ring_8dox.html',1,'']]], + ['crypto_2drng_2edox',['crypto-rng.dox',['../crypto-rng_8dox.html',1,'']]], + ['crypto_2edox',['crypto.dox',['../crypto_8dox.html',1,'']]], + ['ctr',['CTR',['../classCTR.html',1,'CTR< T >'],['../classCTR.html#a7025ab5d79f0f0763f751aeabc425ca9',1,'CTR::CTR()']]], + ['ctrcommon',['CTRCommon',['../classCTRCommon.html',1,'CTRCommon'],['../classCTRCommon.html#abeb01342f17023e99776001d397c51ff',1,'CTRCommon::CTRCommon()']]], + ['currentfield',['currentField',['../classForm.html#a85a219a73294cef1f89a2182b5c25bf8',1,'Form']]], + ['curve25519',['Curve25519',['../classCurve25519.html',1,'']]] +]; diff --git a/html/search/all_3.html b/html/search/all_3.html new file mode 100644 index 00000000..4d312d03 --- /dev/null +++ b/html/search/all_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_3.js b/html/search/all_3.js new file mode 100644 index 00000000..47be02fc --- /dev/null +++ b/html/search/all_3.js @@ -0,0 +1,41 @@ +var searchData= +[ + ['data',['data',['../classBitmap.html#a5eeed27c176eb6e4a2c39ea83444e27d',1,'Bitmap::data()'],['../classBitmap.html#a20fea2a946545aa3b5edd78245149e5f',1,'Bitmap::data() const ']]], + ['day',['day',['../structRTCDate.html#a2d68ff3fb90240df522b41222362704c',1,'RTCDate::day()'],['../structRTCAlarm.html#a9cbc0c2bd8cee02917539af77e845fc4',1,'RTCAlarm::day()']]], + ['dayofweek',['dayOfWeek',['../classRTC.html#a525a9c1dad89613708f47a683eb316aa',1,'RTC::dayOfWeek(const RTCDate *date)'],['../classRTC.html#ab2ca0cbee608ec32d3d6e04d40298f11',1,'RTC::DayOfWeek()']]], + ['decrement',['DECREMENT',['../classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f',1,'RTC']]], + ['decrypt',['decrypt',['../classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6',1,'CBCCommon::decrypt()'],['../classCFBCommon.html#aaaa3d61c5743e30e355207c193c0b0ef',1,'CFBCommon::decrypt()'],['../classChaCha.html#a1f54b2b51b59428010f81a6c4dc4e42c',1,'ChaCha::decrypt()'],['../classCipher.html#ac6099d1a0d7f2ff67b0e4ccb4a17eb08',1,'Cipher::decrypt()'],['../classCTRCommon.html#a0943387cf1124258389702e0690740fe',1,'CTRCommon::decrypt()'],['../classOFBCommon.html#aeb3636d7175b150e2bf16367e51c2e36',1,'OFBCommon::decrypt()']]], + ['decryptblock',['decryptBlock',['../classAESCommon.html#a95a806adf42f975765ff62907efdc639',1,'AESCommon::decryptBlock()'],['../classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c',1,'BlockCipher::decryptBlock()']]], + ['defaultfield',['defaultField',['../classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b',1,'Form']]], + ['destroy',['destroy',['../classRNGClass.html#a9901367d86f2303a59bbc12fe91cad00',1,'RNGClass']]], + ['dh1',['dh1',['../classCurve25519.html#a2b6911583d17ea9a36bbbb40d58b3d89',1,'Curve25519']]], + ['dh2',['dh2',['../classCurve25519.html#a14022d6ac68ec691ffb0247275078ab9',1,'Curve25519']]], + ['disable32khzoutput',['disable32kHzOutput',['../classDS3231RTC.html#a7c9c197c6f27c26e0cb9c5ddc95633c8',1,'DS3231RTC::disable32kHzOutput()'],['../classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb',1,'DS3232RTC::disable32kHzOutput()']]], + ['disablealarm',['disableAlarm',['../classDS3231RTC.html#a21e2667c53d30aa425043ec08a117c47',1,'DS3231RTC']]], + ['disablealarminterrupts',['disableAlarmInterrupts',['../classDS3231RTC.html#a245a56a9396ef49a4e089d743c759cdb',1,'DS3231RTC::disableAlarmInterrupts()'],['../classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9',1,'DS3232RTC::disableAlarmInterrupts()']]], + ['disablescreensaver',['disableScreenSaver',['../classLCD.html#a85c3a4694b105731404df36e35e5b26e',1,'LCD']]], + ['disabletimer1',['disableTimer1',['../classDMD.html#a39af27e216f654ecc7e60b0614cb6b33',1,'DMD']]], + ['disabletimer2',['disableTimer2',['../classDMD.html#a52fe885bfb380b74df54c96221811cff',1,'DMD']]], + ['dispatch',['dispatch',['../classBoolField.html#af793bafc1193d79b495c2ede711bca57',1,'BoolField::dispatch()'],['../classField.html#a061bd1ed4d8b079df86465df8facd3b3',1,'Field::dispatch()'],['../classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee',1,'Form::dispatch()'],['../classIntField.html#a01a17d5a89c76c42c4f0516984ce653f',1,'IntField::dispatch()'],['../classListField.html#a5d752bd561cde735b175bcdfda55832a',1,'ListField::dispatch()'],['../classTimeField.html#a9b953d9abdbe960a3fa34938462832e5',1,'TimeField::dispatch()']]], + ['display',['display',['../classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89',1,'LCD']]], + ['displayoff',['DisplayOff',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f',1,'LCD']]], + ['dmd',['DMD',['../classDMD.html',1,'DMD'],['../classDMD.html#affd37accffe951c8878434dfa1245809',1,'DMD::DMD()']]], + ['dmd_2ddemo_2edox',['dmd-demo.dox',['../dmd-demo_8dox.html',1,'']]], + ['dmd_2drunning_2dfigure_2edox',['dmd-running-figure.dox',['../dmd-running-figure_8dox.html',1,'']]], + ['dot_20matrix_20display_20demo',['Dot Matrix Display Demo',['../dmd_demo.html',1,'']]], + ['doublebuffer',['doubleBuffer',['../classDMD.html#aab1f3ba29c053d630ae12865d22166ec',1,'DMD']]], + ['dow',['dow',['../structRTCAlarm.html#a764061bcf84755b4b9db07dead0d46b9',1,'RTCAlarm']]], + ['drawbitmap',['drawBitmap',['../classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72',1,'Bitmap::drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)'],['../classBitmap.html#a5e4f23e8f14e193410b5f071149401e4',1,'Bitmap::drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)']]], + ['drawchar',['drawChar',['../classBitmap.html#a1a11f29863ee7f36a3b15c91963102bd',1,'Bitmap']]], + ['drawcircle',['drawCircle',['../classBitmap.html#a933763a4f3cba79fbcf97ae6d0a864aa',1,'Bitmap']]], + ['drawfilledcircle',['drawFilledCircle',['../classBitmap.html#a757291b9a39bcb0d64ac98d3a2fa061b',1,'Bitmap']]], + ['drawfilledrect',['drawFilledRect',['../classBitmap.html#a568acbca3818dd85dd62fff6d0b36ffb',1,'Bitmap']]], + ['drawinvertedbitmap',['drawInvertedBitmap',['../classBitmap.html#a4321640464bc08b60348c09bff01b86a',1,'Bitmap::drawInvertedBitmap(int x, int y, const Bitmap &bitmap)'],['../classBitmap.html#a2e862b72c2d6471af737fac320472d69',1,'Bitmap::drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)']]], + ['drawline',['drawLine',['../classBitmap.html#aa0a84f3694e343d68e7021552c69f767',1,'Bitmap']]], + ['drawrect',['drawRect',['../classBitmap.html#aac61e3f7f625db568e37d88b52b3b2fc',1,'Bitmap']]], + ['drawtext',['drawText',['../classBitmap.html#a3e9bcbfb584d5020bd6f0a313ee275f0',1,'Bitmap::drawText(int x, int y, const char *str, int len=-1)'],['../classBitmap.html#a802f5d6bd19a3727670e61e7a88a0cac',1,'Bitmap::drawText(int x, int y, const String &str, int start=0, int len=-1)']]], + ['ds1307rtc',['DS1307RTC',['../classDS1307RTC.html',1,'DS1307RTC'],['../classDS1307RTC.html#a092805d75bea323dc4be062638bff866',1,'DS1307RTC::DS1307RTC()']]], + ['ds3231rtc',['DS3231RTC',['../classDS3231RTC.html',1,'DS3231RTC'],['../classDS3231RTC.html#a45df320cabed4ea2d5c34b437eda7e9f',1,'DS3231RTC::DS3231RTC()']]], + ['ds3232rtc',['DS3232RTC',['../classDS3232RTC.html',1,'DS3232RTC'],['../classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb',1,'DS3232RTC::DS3232RTC()']]], + ['dumping_20infrared_20remote_20control_20codes',['Dumping Infrared Remote Control Codes',['../ir_dumpir.html',1,'']]] +]; diff --git a/html/search/all_4.html b/html/search/all_4.html new file mode 100644 index 00000000..d72a9104 --- /dev/null +++ b/html/search/all_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_4.js b/html/search/all_4.js new file mode 100644 index 00000000..0b66d295 --- /dev/null +++ b/html/search/all_4.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['eeprom24',['EEPROM24',['../classEEPROM24.html',1,'EEPROM24'],['../classEEPROM24.html#ae8547f6ff7711496e1959ee24a142995',1,'EEPROM24::EEPROM24()']]], + ['enable32khzoutput',['enable32kHzOutput',['../classDS3231RTC.html#a032cf784eb82ccf6ff0a9745b47ac86b',1,'DS3231RTC::enable32kHzOutput()'],['../classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a',1,'DS3232RTC::enable32kHzOutput()']]], + ['enablealarm',['enableAlarm',['../classDS3231RTC.html#ad0a0614c48d4f809fee6017cd7350372',1,'DS3231RTC']]], + ['enablealarminterrupts',['enableAlarmInterrupts',['../classDS3231RTC.html#a0e9509219b2c7259accd68a55aaa5faf',1,'DS3231RTC::enableAlarmInterrupts()'],['../classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9',1,'DS3232RTC::enableAlarmInterrupts()']]], + ['enablescreensaver',['enableScreenSaver',['../classLCD.html#af9a2326d034fa159d384ec16223c924f',1,'LCD']]], + ['enabletimer1',['enableTimer1',['../classDMD.html#a4c3b04b384f3d656a9b59690836775e2',1,'DMD']]], + ['enabletimer2',['enableTimer2',['../classDMD.html#a5469775db7fafebca2cdbc6a6372fb97',1,'DMD']]], + ['encrypt',['encrypt',['../classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147',1,'CBCCommon::encrypt()'],['../classCFBCommon.html#a57af3692389bed300d3cfdf351351c51',1,'CFBCommon::encrypt()'],['../classChaCha.html#acd4fff140b8871c233d9a31abf753ed8',1,'ChaCha::encrypt()'],['../classCipher.html#ad2832bd61039d61560e34ea3382ca562',1,'Cipher::encrypt()'],['../classCTRCommon.html#a201bda584d111552ce8ec09fac759963',1,'CTRCommon::encrypt()'],['../classOFBCommon.html#a984d81a460e0799895b19dc48c3b5cf8',1,'OFBCommon::encrypt()']]], + ['encryptblock',['encryptBlock',['../classAESCommon.html#a2d95f6159abfcd92b5841f9018e44296',1,'AESCommon::encryptBlock()'],['../classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33',1,'BlockCipher::encryptBlock()']]], + ['endwrite',['endWrite',['../classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41',1,'I2CMaster::endWrite()'],['../classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3',1,'SoftI2C::endWrite()']]], + ['enterfield',['enterField',['../classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09',1,'BoolField::enterField()'],['../classField.html#aa032bbeacb405c56546cb56fbbee94f5',1,'Field::enterField()'],['../classIntField.html#a51d9127b660e8dd7f87718acd230202a',1,'IntField::enterField()'],['../classListField.html#a191b79b460e45cf48e04b04eface2888',1,'ListField::enterField()'],['../classTextField.html#aa78f1354f9240b64fabd6f996e312f32',1,'TextField::enterField()'],['../classTimeField.html#ae914d6b870283a334d2d669460f7646b',1,'TimeField::enterField()']]], + ['eval',['eval',['../classCurve25519.html#a2e4b7dd83a019b32c76584c99bfda21a',1,'Curve25519']]], + ['exitfield',['exitField',['../classField.html#ad6805c75ee1e62f8cd8bd550c4530c07',1,'Field::exitField()'],['../classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541',1,'TimeField::exitField()']]], + ['extract',['extract',['../classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f',1,'KeccakCore']]] +]; diff --git a/html/search/all_5.html b/html/search/all_5.html new file mode 100644 index 00000000..99ef7267 --- /dev/null +++ b/html/search/all_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_5.js b/html/search/all_5.js new file mode 100644 index 00000000..e940fe1c --- /dev/null +++ b/html/search/all_5.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['falselabel',['falseLabel',['../classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01',1,'BoolField']]], + ['field',['Field',['../classField.html',1,'Field'],['../classField.html#ac4ea0d104376233c3f0bfc080ec8564e',1,'Field::Field(const String &label)'],['../classField.html#a7e2bdb203ddfd9219696f263c1731fe7',1,'Field::Field(Form &form, const String &label)']]], + ['fill',['fill',['../classBitmap.html#a99da820f9280aace6b512801d5a5e2b2',1,'Bitmap::fill(int x, int y, int width, int height, Color color)'],['../classBitmap.html#ac661adab340858b541a2fe44e6303f56',1,'Bitmap::fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)']]], + ['finalize',['finalize',['../classBLAKE2b.html#a0cd8146b7868bd0f4c24a3856f106d17',1,'BLAKE2b::finalize()'],['../classBLAKE2s.html#a751a3d772cbe1cd1dad83dbd09853b1b',1,'BLAKE2s::finalize()'],['../classHash.html#a09b3ccec22763fc86b1415695862977c',1,'Hash::finalize()'],['../classSHA1.html#a5a6a8a6169aa48e0bccadb22a149ab7c',1,'SHA1::finalize()'],['../classSHA256.html#a695157bcdf5495ba892ebac309f3abd6',1,'SHA256::finalize()'],['../classSHA3__256.html#a8fe7cad1f83bd1bae1a0d521324247a1',1,'SHA3_256::finalize()'],['../classSHA3__512.html#ac0227aafb5f047bb50f0bd84df0b4b5b',1,'SHA3_512::finalize()'],['../classSHA512.html#afc136ad0e77de527b031db3fb8b32464',1,'SHA512::finalize()']]], + ['finalizehmac',['finalizeHMAC',['../classBLAKE2b.html#a29fafbba26e3c1d896b4d4c428f7d52a',1,'BLAKE2b::finalizeHMAC()'],['../classBLAKE2s.html#a3f910f3bd48cc4a9c5330c31bcda31fc',1,'BLAKE2s::finalizeHMAC()'],['../classHash.html#aab42fa5420cc0bda4321a3d3866cfd06',1,'Hash::finalizeHMAC()'],['../classSHA1.html#a791db53fe9d6cc0e383b25f1da0a97b8',1,'SHA1::finalizeHMAC()'],['../classSHA256.html#a28bc2510c5bdaf210a012f9f21a753cd',1,'SHA256::finalizeHMAC()'],['../classSHA3__256.html#a001215fa1b7d2c30717b4b5b1618d68c',1,'SHA3_256::finalizeHMAC()'],['../classSHA3__512.html#a25c9d2da26d01d46ba6b72c8a7905ea0',1,'SHA3_512::finalizeHMAC()'],['../classSHA512.html#a1fe9533f0d3dfdb426eb3dc4bdc31904',1,'SHA512::finalizeHMAC()']]], + ['firedalarm',['firedAlarm',['../classDS3231RTC.html#a6a5b3717ff65528de566c021eb821b94',1,'DS3231RTC::firedAlarm()'],['../classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3',1,'DS3232RTC::firedAlarm()']]], + ['flags',['flags',['../structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e',1,'RTCAlarm']]], + ['font',['Font',['../classBitmap.html#a456f7d6da03189c1e7148563a891b3cf',1,'Bitmap::Font()'],['../classBitmap.html#a7bf0a232b4bd12573cc570cc0edef47c',1,'Bitmap::font() const ']]], + ['form',['Form',['../classForm.html',1,'Form'],['../classForm.html#ad30836b22edde707a52d94090b716996',1,'Form::Form()'],['../classField.html#a27427319be1cc92db3128637d8884ee5',1,'Field::form()']]], + ['formathmackey',['formatHMACKey',['../classHash.html#ab6f40c9af91dc3d738d9fcce59af63cc',1,'Hash']]], + ['fromrgb',['fromRGB',['../classDMD.html#a557412f734fc4596e1102bf71e110ea0',1,'DMD']]], + ['form_20example_20for_20lcd_20displays',['Form example for LCD displays',['../lcd_form.html',1,'']]] +]; diff --git a/html/search/all_6.html b/html/search/all_6.html new file mode 100644 index 00000000..6133ab3a --- /dev/null +++ b/html/search/all_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_6.js b/html/search/all_6.js new file mode 100644 index 00000000..42fa73bb --- /dev/null +++ b/html/search/all_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['generating_20random_20numbers',['Generating random numbers',['../crypto_rng.html',1,'']]], + ['getbutton',['getButton',['../classLCD.html#ac1e80e2603bd1cf0276c36092c416292',1,'LCD']]] +]; diff --git a/html/search/all_7.html b/html/search/all_7.html new file mode 100644 index 00000000..57481259 --- /dev/null +++ b/html/search/all_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_7.js b/html/search/all_7.js new file mode 100644 index 00000000..a119e28d --- /dev/null +++ b/html/search/all_7.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['hash',['Hash',['../classHash.html',1,'Hash'],['../classHash.html#af482880ad75b67a09d2dcb5e86244d80',1,'Hash::Hash()']]], + ['hashcore',['hashCore',['../classChaCha.html#a41ac3262e52ff49dcd916d0b3b2e2038',1,'ChaCha']]], + ['hashsize',['hashSize',['../classBLAKE2b.html#a7555de16f6918ab820170a7ed3098c89',1,'BLAKE2b::hashSize()'],['../classBLAKE2s.html#af9f50aac096f92ba27b1b2dd48df4c52',1,'BLAKE2s::hashSize()'],['../classHash.html#adcdd30de3e5ecaa2f798c0c5644d9ef8',1,'Hash::hashSize()'],['../classSHA1.html#ab8cdb7233a8b81be07877049960ddfdd',1,'SHA1::hashSize()'],['../classSHA256.html#a103d5bc5ced792464a82cb1d7986de94',1,'SHA256::hashSize()'],['../classSHA3__256.html#a2c5c08119d5ad853021f929a763784f3',1,'SHA3_256::hashSize()'],['../classSHA3__512.html#a9f13e4d2b99dd204e96b11142e9c1803',1,'SHA3_512::hashSize()'],['../classSHA512.html#a6ab3cc1e172eecf4796e4cac629e0a44',1,'SHA512::hashSize()']]], + ['hasupdates',['hasUpdates',['../classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0',1,'DS1307RTC::hasUpdates()'],['../classDS3231RTC.html#a180bea03bd68df8f696e529cd1582095',1,'DS3231RTC::hasUpdates()'],['../classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc',1,'DS3232RTC::hasUpdates()'],['../classRTC.html#a3690761f29654a2c9e676fcbfa32dd30',1,'RTC::hasUpdates()']]], + ['height',['height',['../classBitmap.html#adcd4e3dc7594421e647b0f52da9a41a3',1,'Bitmap']]], + ['hide',['hide',['../classForm.html#a88b9146a3f68e837c5e831203096f9e9',1,'Form']]], + ['holdtime',['holdTime',['../classCharlieplex.html#abb429659a7b1ee4c7306ea659050cb30',1,'Charlieplex']]], + ['hour',['hour',['../structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4',1,'RTCTime::hour()'],['../structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692',1,'RTCAlarm::hour()']]], + ['hello_20world_20for_20freetronics_20lcd',['Hello World for Freetronics LCD',['../lcd_hello_world.html',1,'']]] +]; diff --git a/html/search/all_8.html b/html/search/all_8.html new file mode 100644 index 00000000..0179bdd4 --- /dev/null +++ b/html/search/all_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_8.js b/html/search/all_8.js new file mode 100644 index 00000000..350eec6b --- /dev/null +++ b/html/search/all_8.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['i2cmaster',['I2CMaster',['../classI2CMaster.html',1,'']]], + ['increment',['INCREMENT',['../classRTC.html#aacbe3ebbf893685950b05327c11d5c37',1,'RTC']]], + ['intfield',['IntField',['../classIntField.html',1,'IntField'],['../classIntField.html#a9df274c4100ed37d2d78738f09fc53b6',1,'IntField::IntField(const String &label)'],['../classIntField.html#a10c9c958bcde276698f1f1f9bff949dd',1,'IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)'],['../classIntField.html#a2b99fa19be6a0ed01ddc4939352b372e',1,'IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)']]], + ['invert',['invert',['../classBitmap.html#a6d85556bcc9fac91d33f0f6f7a6430dd',1,'Bitmap']]], + ['ir_2ddumpir_2edox',['ir-dumpir.dox',['../ir-dumpir_8dox.html',1,'']]], + ['ir_2dsnake_2edox',['ir-snake.dox',['../ir-snake_8dox.html',1,'']]], + ['irreceiver',['IRreceiver',['../classIRreceiver.html',1,'IRreceiver'],['../classIRreceiver.html#a06eccb8b8311eac395e4b20c4e0163e3',1,'IRreceiver::IRreceiver()']]], + ['iscurrent',['isCurrent',['../classField.html#a25d86a67b321e8c642edf75a10a35f72',1,'Field::isCurrent()'],['../classForm.html#a48fb77f93e77b28b0397b59e1e9bf789',1,'Form::isCurrent()']]], + ['ispaused',['isPaused',['../classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8',1,'BlinkLED']]], + ['isplaying',['isPlaying',['../classMelody.html#ad38db3338ed87d72238c0ea9440c633c',1,'Melody']]], + ['isrealtime',['isRealTime',['../classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd',1,'DS1307RTC::isRealTime()'],['../classDS3231RTC.html#a2fa6fdd1f9e2b2b99be077c73639dce0',1,'DS3231RTC::isRealTime()'],['../classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4',1,'DS3232RTC::isRealTime()']]], + ['isscreensaved',['isScreenSaved',['../classLCD.html#af5d5ca618a3161aa352027b58fe09d0e',1,'LCD']]], + ['isvalid',['isValid',['../classBitmap.html#a3846a240722e847d3cf11f701da1ce7b',1,'Bitmap']]], + ['isvisible',['isVisible',['../classForm.html#a3101f288e3e5aa8307c57f35861ad587',1,'Form']]], + ['items',['items',['../classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0',1,'ListField']]], + ['ivsize',['ivSize',['../classCBCCommon.html#a016277533730284a38bb6ad8cd6f91ce',1,'CBCCommon::ivSize()'],['../classCFBCommon.html#a55db1be69de87aafe5601d31be918ebb',1,'CFBCommon::ivSize()'],['../classChaCha.html#afaa3df343a7d07976bd7e03a0c1bf43c',1,'ChaCha::ivSize()'],['../classCipher.html#ab8b53ddc4ce431f03c2a1903d70ace9c',1,'Cipher::ivSize()'],['../classCTRCommon.html#a98c1717d11d8da8e1fa108607358774a',1,'CTRCommon::ivSize()'],['../classOFBCommon.html#a67b4639aaece17a796fcba3a2ce8b43c',1,'OFBCommon::ivSize()']]] +]; diff --git a/html/search/all_9.html b/html/search/all_9.html new file mode 100644 index 00000000..cd46d440 --- /dev/null +++ b/html/search/all_9.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_9.js b/html/search/all_9.js new file mode 100644 index 00000000..0e0b10de --- /dev/null +++ b/html/search/all_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['keccakcore',['KeccakCore',['../classKeccakCore.html',1,'KeccakCore'],['../classKeccakCore.html#a850c8e85bdb6b347411239716535d9c9',1,'KeccakCore::KeccakCore()']]], + ['keysize',['keySize',['../classAES128.html#aa871832a156f0ea61b964e489670ae9d',1,'AES128::keySize()'],['../classAES192.html#ade28843e51e262b30eb55791c83fd791',1,'AES192::keySize()'],['../classAES256.html#af8ed6412bae6fc78274f60344899366a',1,'AES256::keySize()'],['../classBlockCipher.html#afde6004a859e015d877eab3c37042a0f',1,'BlockCipher::keySize()'],['../classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e',1,'CBCCommon::keySize()'],['../classCFBCommon.html#a82899da983bc70bc8152ee67f424552e',1,'CFBCommon::keySize()'],['../classChaCha.html#af286083291fab2bd36dc7ad1f54d5cd7',1,'ChaCha::keySize()'],['../classCipher.html#a4cea432ea0278c865441f17cbb88b1ab',1,'Cipher::keySize()'],['../classCTRCommon.html#a29ce8e13a302350397fc6790a686bea2',1,'CTRCommon::keySize()'],['../classOFBCommon.html#a76ea9f9ea9dd137778338813e534a8ce',1,'OFBCommon::keySize()']]] +]; diff --git a/html/search/all_a.html b/html/search/all_a.html new file mode 100644 index 00000000..eab65530 --- /dev/null +++ b/html/search/all_a.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_a.js b/html/search/all_a.js new file mode 100644 index 00000000..151e1cdf --- /dev/null +++ b/html/search/all_a.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['label',['label',['../classField.html#aaa861ef917130c989a955bc75c683afe',1,'Field']]], + ['lcd',['LCD',['../classLCD.html',1,'LCD'],['../classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8',1,'LCD::LCD()'],['../classLCD.html#a067bc741cf27f143aba5d9f147908401',1,'LCD::LCD(uint8_t pin9)'],['../classLCD.html#a203d268bef6c61fa293562dbb0e9f51e',1,'LCD::LCD(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)'],['../classField.html#a5cf21bf958a71e51feac9e1bf9f599d1',1,'Field::lcd()']]], + ['lcd_2dform_2edox',['lcd-form.dox',['../lcd-form_8dox.html',1,'']]], + ['lcd_2dhelloworld_2edox',['lcd-helloworld.dox',['../lcd-helloworld_8dox.html',1,'']]], + ['led',['led',['../classCharlieplex.html#a90fd09f24b62424b0b7b8bcdb0140b9d',1,'Charlieplex']]], + ['listfield',['ListField',['../classListField.html',1,'ListField'],['../classListField.html#a118501da7edb0b0bc6b493734975b4e9',1,'ListField::ListField(const String &label)'],['../classListField.html#aa303898a1f74b52c1c4982653de488b7',1,'ListField::ListField(Form &form, const String &label, ListItems items, int value=0)']]], + ['loop',['loop',['../classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e',1,'BlinkLED::loop()'],['../classCharlieplex.html#a8313edeacd8387c428b8299d52584d6a',1,'Charlieplex::loop()'],['../classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786',1,'ChaseLEDs::loop()'],['../classDMD.html#a2c74a0845ef6080056b972d490648114',1,'DMD::loop()'],['../classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13',1,'RNGClass::loop()']]], + ['loopcount',['loopCount',['../classMelody.html#ab78253ae9abc8478b05f415f5d878a60',1,'Melody']]] +]; diff --git a/html/search/all_b.html b/html/search/all_b.html new file mode 100644 index 00000000..a2c161e0 --- /dev/null +++ b/html/search/all_b.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_b.js b/html/search/all_b.js new file mode 100644 index 00000000..8bf258d3 --- /dev/null +++ b/html/search/all_b.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['mainpage_2edox',['mainpage.dox',['../mainpage_8dox.html',1,'']]], + ['maxhours',['maxHours',['../classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7',1,'TimeField']]], + ['maxtransfersize',['maxTransferSize',['../classI2CMaster.html#a3cd0cea8169ac4e6dd6f39fd6cfb1926',1,'I2CMaster::maxTransferSize()'],['../classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4',1,'SoftI2C::maxTransferSize()']]], + ['maxvalue',['maxValue',['../classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad',1,'IntField']]], + ['melody',['Melody',['../classMelody.html',1,'Melody'],['../classMelody.html#a9edc4165a49368dd5d78eedf982c38b9',1,'Melody::Melody()']]], + ['minute',['minute',['../structRTCTime.html#acf2161ca037080dc4b767e636ad8db84',1,'RTCTime::minute()'],['../structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe',1,'RTCAlarm::minute()']]], + ['minvalue',['minValue',['../classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb',1,'IntField']]], + ['month',['month',['../structRTCDate.html#a6e6196059b36186041a5312400ea9202',1,'RTCDate']]] +]; diff --git a/html/search/all_c.html b/html/search/all_c.html new file mode 100644 index 00000000..bdd3ee2c --- /dev/null +++ b/html/search/all_c.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_c.js b/html/search/all_c.js new file mode 100644 index 00000000..82456dfc --- /dev/null +++ b/html/search/all_c.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['nextfield',['nextField',['../classForm.html#a788a186ea4a7ebd75283a948ca45f4d1',1,'Form']]], + ['no_5ftemperature',['NO_TEMPERATURE',['../classRTC.html#a9ed5480b362a83f1f45c4d3bcf7c3bf8',1,'RTC']]], + ['nodisplay',['noDisplay',['../classLCD.html#af3974da6d988ba2d21c25135ada12108',1,'LCD']]], + ['nofill',['NoFill',['../classBitmap.html#aa89170263dc1f51f6366c1907119715e',1,'Bitmap']]], + ['noisesource',['NoiseSource',['../classNoiseSource.html',1,'NoiseSource'],['../classNoiseSource.html#a601479b7d8cc215f97f2f8a18d3ef4c2',1,'NoiseSource::NoiseSource()']]], + ['numrounds',['numRounds',['../classChaCha.html#a0a73d3623da377bc593876156768dd72',1,'ChaCha']]] +]; diff --git a/html/search/all_d.html b/html/search/all_d.html new file mode 100644 index 00000000..d5109336 --- /dev/null +++ b/html/search/all_d.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_d.js b/html/search/all_d.js new file mode 100644 index 00000000..ba80b033 --- /dev/null +++ b/html/search/all_d.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['ofb',['OFB',['../classOFB.html',1,'OFB< T >'],['../classOFB.html#a0b71b5cbcf01254799cd5eb37074a8cb',1,'OFB::OFB()']]], + ['ofbcommon',['OFBCommon',['../classOFBCommon.html',1,'OFBCommon'],['../classOFBCommon.html#a7f7e0cffcd7e2d7e06b7b1ae978a8f7d',1,'OFBCommon::OFBCommon()']]], + ['offtime',['offTime',['../classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc',1,'BlinkLED']]], + ['ontime',['onTime',['../classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb',1,'BlinkLED']]], + ['output',['output',['../classNoiseSource.html#a1af7449a5ae4a8acd34ac218c9eec6c1',1,'NoiseSource']]] +]; diff --git a/html/search/all_e.html b/html/search/all_e.html new file mode 100644 index 00000000..3cda0172 --- /dev/null +++ b/html/search/all_e.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_e.js b/html/search/all_e.js new file mode 100644 index 00000000..411aa530 --- /dev/null +++ b/html/search/all_e.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['pad',['pad',['../classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7',1,'KeccakCore']]], + ['pagesize',['pageSize',['../classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a',1,'EEPROM24']]], + ['pause',['pause',['../classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a',1,'BlinkLED']]], + ['pixel',['pixel',['../classBitmap.html#a35aa38b377d509d6c4f061a0b988d203',1,'Bitmap']]], + ['play',['play',['../classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5',1,'Melody']]], + ['playonce',['playOnce',['../classMelody.html#aecc9185c9cb1246e8a55521b17d72932',1,'Melody']]], + ['power_20saving_20utility_20functions',['Power saving utility functions',['../group__power__save.html',1,'']]], + ['prevfield',['prevField',['../classForm.html#acb080fe4f4631e9060e6efab8eaa0a90',1,'Form']]], + ['previouspin',['previousPin',['../classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525',1,'ChaseLEDs']]], + ['progmem',['ProgMem',['../classBitmap.html#a2fcc98fd7580932b218134126a29ce43',1,'Bitmap']]], + ['pwmled',['pwmLed',['../classCharlieplex.html#a89312f2fd1d27c4e56346ed9cccfb9f6',1,'Charlieplex']]] +]; diff --git a/html/search/all_f.html b/html/search/all_f.html new file mode 100644 index 00000000..7419b029 --- /dev/null +++ b/html/search/all_f.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/all_f.js b/html/search/all_f.js new file mode 100644 index 00000000..d247dd23 --- /dev/null +++ b/html/search/all_f.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['ring_20oscillator_20noise_20sources',['Ring Oscillator Noise Sources',['../crypto_rng_ring.html',1,'']]], + ['running_20figure_20example',['Running figure example',['../dmd_running_figure.html',1,'']]], + ['rand',['rand',['../classRNGClass.html#a418a833cf18198fd7e5d6dbd78c99c29',1,'RNGClass']]], + ['read',['read',['../classEEPROM24.html#a960971377d4decb122ff38d12603e586',1,'EEPROM24::read(unsigned long address)'],['../classEEPROM24.html#a63e23dc014415f947975359ac09f627e',1,'EEPROM24::read(unsigned long address, void *data, size_t length)'],['../classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd',1,'I2CMaster::read()'],['../classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc',1,'SoftI2C::read()']]], + ['readalarm',['readAlarm',['../classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a',1,'DS1307RTC::readAlarm()'],['../classDS3231RTC.html#aab56929e759a49a90785729cceb72f2e',1,'DS3231RTC::readAlarm()'],['../classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873',1,'DS3232RTC::readAlarm()'],['../classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66',1,'RTC::readAlarm()']]], + ['readbyte',['readByte',['../classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a',1,'DS1307RTC::readByte()'],['../classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7',1,'DS3232RTC::readByte()'],['../classRTC.html#a0f47b10b436e3f9d36e04ec907579431',1,'RTC::readByte()']]], + ['readdate',['readDate',['../classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4',1,'DS1307RTC::readDate()'],['../classDS3231RTC.html#a498a1a37b78993ab52780198c5b4a9df',1,'DS3231RTC::readDate()'],['../classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca',1,'DS3232RTC::readDate()'],['../classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e',1,'RTC::readDate()']]], + ['readonly',['readOnly',['../classTimeField.html#aa0795c873ba9941c8a1a3bf8c06668f1',1,'TimeField']]], + ['readtemperature',['readTemperature',['../classDS3231RTC.html#ad1dcb7897fd14ae745720a19fbe71e37',1,'DS3231RTC::readTemperature()'],['../classDS3232RTC.html#a0faf40c25ab019a326a60f301c2bb41b',1,'DS3232RTC::readTemperature()'],['../classRTC.html#aeca3c8387332e8cabfd09c1806276e5a',1,'RTC::readTemperature()']]], + ['readtime',['readTime',['../classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6',1,'DS1307RTC::readTime()'],['../classDS3231RTC.html#a3a2c448b152c401fb598c487ef0ed288',1,'DS3231RTC::readTime()'],['../classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747',1,'DS3232RTC::readTime()'],['../classRTC.html#aaf0a5c1f32f210a49718d148620b5bec',1,'RTC::readTime()']]], + ['refresh',['refresh',['../classCharlieplex.html#a3c961bfff866e400dad371f0376f096b',1,'Charlieplex::refresh()'],['../classDMD.html#a9e4bf2a9d247312d35c1401ff61261c8',1,'DMD::refresh()']]], + ['removefield',['removeField',['../classForm.html#a7abd717029f9b19ee7318470072cd697',1,'Form']]], + ['reset',['reset',['../classBLAKE2b.html#a917beae2ca6e9831a35717a526089e8a',1,'BLAKE2b::reset()'],['../classBLAKE2b.html#a9afd8ec05ccfa08a922de74461e45387',1,'BLAKE2b::reset(uint8_t outputLength)'],['../classBLAKE2s.html#a778776d15316c182fdb2df5a89b3ca02',1,'BLAKE2s::reset()'],['../classBLAKE2s.html#a91ba6bc39e42002ac61114ced1d0af6d',1,'BLAKE2s::reset(uint8_t outputLength)'],['../classHash.html#a7b94309acaa5f52386785fb780e5be61',1,'Hash::reset()'],['../classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b',1,'KeccakCore::reset()'],['../classSHA1.html#ab71aaf39ed956320054861a2fbfa454f',1,'SHA1::reset()'],['../classSHA256.html#ad9d80d8fdccffb15497bd36285afce65',1,'SHA256::reset()'],['../classSHA3__256.html#a57b5f29347a733e04fe47d60621f3202',1,'SHA3_256::reset()'],['../classSHA3__512.html#a435746d5a8b012f7c65050337cc4a23f',1,'SHA3_512::reset()'],['../classSHA512.html#a0d009e8d9157c3f14323e68631c33e97',1,'SHA512::reset()']]], + ['resethmac',['resetHMAC',['../classBLAKE2b.html#acb1ca4081c509d1c34b3aee465cd4494',1,'BLAKE2b::resetHMAC()'],['../classBLAKE2s.html#a7f9745854704b34a508497105ca5e2fd',1,'BLAKE2s::resetHMAC()'],['../classHash.html#adf50359c1f525af884721cc9034e7945',1,'Hash::resetHMAC()'],['../classSHA1.html#ad0a09a5100d59ff90c04ed5d4071b606',1,'SHA1::resetHMAC()'],['../classSHA256.html#a2271683d6f1c7c103272f1dec55a6871',1,'SHA256::resetHMAC()'],['../classSHA3__256.html#a324fe4d268bbf23d7b492033fe3bc632',1,'SHA3_256::resetHMAC()'],['../classSHA3__512.html#aac7133f420f2be0288965c2e863f389b',1,'SHA3_512::resetHMAC()'],['../classSHA512.html#a2427ad8bf8b6958df91bd5806986167c',1,'SHA512::resetHMAC()']]], + ['resume',['resume',['../classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252',1,'BlinkLED']]], + ['ringoscillatornoisesource',['RingOscillatorNoiseSource',['../classRingOscillatorNoiseSource.html',1,'']]], + ['rngclass',['RNGClass',['../classRNGClass.html',1,'RNGClass'],['../classRNGClass.html#acbcf327242f51ae2d9209aeaa45e30e9',1,'RNGClass::RNGClass()']]], + ['rtc',['RTC',['../classRTC.html',1,'RTC'],['../classRTC.html#ada31c5120d18d2dd2863b3d440308da2',1,'RTC::RTC()']]], + ['rtcalarm',['RTCAlarm',['../structRTCAlarm.html',1,'']]], + ['rtcdate',['RTCDate',['../structRTCDate.html',1,'']]], + ['rtctime',['RTCTime',['../structRTCTime.html',1,'']]], + ['run',['run',['../classMelody.html#ad1103b970be1f59058cc7d927be68955',1,'Melody']]] +]; diff --git a/html/search/classes_0.html b/html/search/classes_0.html new file mode 100644 index 00000000..fabdc036 --- /dev/null +++ b/html/search/classes_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_0.js b/html/search/classes_0.js new file mode 100644 index 00000000..7a28eaaf --- /dev/null +++ b/html/search/classes_0.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['aes128',['AES128',['../classAES128.html',1,'']]], + ['aes192',['AES192',['../classAES192.html',1,'']]], + ['aes256',['AES256',['../classAES256.html',1,'']]], + ['aescommon',['AESCommon',['../classAESCommon.html',1,'']]] +]; diff --git a/html/search/classes_1.html b/html/search/classes_1.html new file mode 100644 index 00000000..800b6ae1 --- /dev/null +++ b/html/search/classes_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_1.js b/html/search/classes_1.js new file mode 100644 index 00000000..a4c04b63 --- /dev/null +++ b/html/search/classes_1.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['bitmap',['Bitmap',['../classBitmap.html',1,'']]], + ['blake2b',['BLAKE2b',['../classBLAKE2b.html',1,'']]], + ['blake2s',['BLAKE2s',['../classBLAKE2s.html',1,'']]], + ['blinkled',['BlinkLED',['../classBlinkLED.html',1,'']]], + ['blockcipher',['BlockCipher',['../classBlockCipher.html',1,'']]], + ['boolfield',['BoolField',['../classBoolField.html',1,'']]] +]; diff --git a/html/search/classes_2.html b/html/search/classes_2.html new file mode 100644 index 00000000..f65d263c --- /dev/null +++ b/html/search/classes_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_2.js b/html/search/classes_2.js new file mode 100644 index 00000000..44cdfad4 --- /dev/null +++ b/html/search/classes_2.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['cbc',['CBC',['../classCBC.html',1,'']]], + ['cbccommon',['CBCCommon',['../classCBCCommon.html',1,'']]], + ['cfb',['CFB',['../classCFB.html',1,'']]], + ['cfbcommon',['CFBCommon',['../classCFBCommon.html',1,'']]], + ['chacha',['ChaCha',['../classChaCha.html',1,'']]], + ['charlieplex',['Charlieplex',['../classCharlieplex.html',1,'']]], + ['chaseleds',['ChaseLEDs',['../classChaseLEDs.html',1,'']]], + ['cipher',['Cipher',['../classCipher.html',1,'']]], + ['ctr',['CTR',['../classCTR.html',1,'']]], + ['ctrcommon',['CTRCommon',['../classCTRCommon.html',1,'']]], + ['curve25519',['Curve25519',['../classCurve25519.html',1,'']]] +]; diff --git a/html/search/classes_3.html b/html/search/classes_3.html new file mode 100644 index 00000000..927e837f --- /dev/null +++ b/html/search/classes_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_3.js b/html/search/classes_3.js new file mode 100644 index 00000000..469aa29c --- /dev/null +++ b/html/search/classes_3.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['dmd',['DMD',['../classDMD.html',1,'']]], + ['ds1307rtc',['DS1307RTC',['../classDS1307RTC.html',1,'']]], + ['ds3231rtc',['DS3231RTC',['../classDS3231RTC.html',1,'']]], + ['ds3232rtc',['DS3232RTC',['../classDS3232RTC.html',1,'']]] +]; diff --git a/html/search/classes_4.html b/html/search/classes_4.html new file mode 100644 index 00000000..a447290e --- /dev/null +++ b/html/search/classes_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_4.js b/html/search/classes_4.js new file mode 100644 index 00000000..10123575 --- /dev/null +++ b/html/search/classes_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['eeprom24',['EEPROM24',['../classEEPROM24.html',1,'']]] +]; diff --git a/html/search/classes_5.html b/html/search/classes_5.html new file mode 100644 index 00000000..63484c45 --- /dev/null +++ b/html/search/classes_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_5.js b/html/search/classes_5.js new file mode 100644 index 00000000..048263d1 --- /dev/null +++ b/html/search/classes_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['field',['Field',['../classField.html',1,'']]], + ['form',['Form',['../classForm.html',1,'']]] +]; diff --git a/html/search/classes_6.html b/html/search/classes_6.html new file mode 100644 index 00000000..f3d70354 --- /dev/null +++ b/html/search/classes_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_6.js b/html/search/classes_6.js new file mode 100644 index 00000000..779a6d47 --- /dev/null +++ b/html/search/classes_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hash',['Hash',['../classHash.html',1,'']]] +]; diff --git a/html/search/classes_7.html b/html/search/classes_7.html new file mode 100644 index 00000000..9e5f5c98 --- /dev/null +++ b/html/search/classes_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_7.js b/html/search/classes_7.js new file mode 100644 index 00000000..1639feb3 --- /dev/null +++ b/html/search/classes_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['i2cmaster',['I2CMaster',['../classI2CMaster.html',1,'']]], + ['intfield',['IntField',['../classIntField.html',1,'']]], + ['irreceiver',['IRreceiver',['../classIRreceiver.html',1,'']]] +]; diff --git a/html/search/classes_8.html b/html/search/classes_8.html new file mode 100644 index 00000000..82c35b32 --- /dev/null +++ b/html/search/classes_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_8.js b/html/search/classes_8.js new file mode 100644 index 00000000..989a3982 --- /dev/null +++ b/html/search/classes_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['keccakcore',['KeccakCore',['../classKeccakCore.html',1,'']]] +]; diff --git a/html/search/classes_9.html b/html/search/classes_9.html new file mode 100644 index 00000000..4e83ac82 --- /dev/null +++ b/html/search/classes_9.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_9.js b/html/search/classes_9.js new file mode 100644 index 00000000..cfd886c9 --- /dev/null +++ b/html/search/classes_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['lcd',['LCD',['../classLCD.html',1,'']]], + ['listfield',['ListField',['../classListField.html',1,'']]] +]; diff --git a/html/search/classes_a.html b/html/search/classes_a.html new file mode 100644 index 00000000..616feb69 --- /dev/null +++ b/html/search/classes_a.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_a.js b/html/search/classes_a.js new file mode 100644 index 00000000..a6451ed5 --- /dev/null +++ b/html/search/classes_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['melody',['Melody',['../classMelody.html',1,'']]] +]; diff --git a/html/search/classes_b.html b/html/search/classes_b.html new file mode 100644 index 00000000..44611522 --- /dev/null +++ b/html/search/classes_b.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_b.js b/html/search/classes_b.js new file mode 100644 index 00000000..d53a9846 --- /dev/null +++ b/html/search/classes_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['noisesource',['NoiseSource',['../classNoiseSource.html',1,'']]] +]; diff --git a/html/search/classes_c.html b/html/search/classes_c.html new file mode 100644 index 00000000..8f92c863 --- /dev/null +++ b/html/search/classes_c.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_c.js b/html/search/classes_c.js new file mode 100644 index 00000000..8f9a8c0f --- /dev/null +++ b/html/search/classes_c.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ofb',['OFB',['../classOFB.html',1,'']]], + ['ofbcommon',['OFBCommon',['../classOFBCommon.html',1,'']]] +]; diff --git a/html/search/classes_d.html b/html/search/classes_d.html new file mode 100644 index 00000000..9690cf0b --- /dev/null +++ b/html/search/classes_d.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_d.js b/html/search/classes_d.js new file mode 100644 index 00000000..18aec76c --- /dev/null +++ b/html/search/classes_d.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['ringoscillatornoisesource',['RingOscillatorNoiseSource',['../classRingOscillatorNoiseSource.html',1,'']]], + ['rngclass',['RNGClass',['../classRNGClass.html',1,'']]], + ['rtc',['RTC',['../classRTC.html',1,'']]], + ['rtcalarm',['RTCAlarm',['../structRTCAlarm.html',1,'']]], + ['rtcdate',['RTCDate',['../structRTCDate.html',1,'']]], + ['rtctime',['RTCTime',['../structRTCTime.html',1,'']]] +]; diff --git a/html/search/classes_e.html b/html/search/classes_e.html new file mode 100644 index 00000000..24a3ef3a --- /dev/null +++ b/html/search/classes_e.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_e.js b/html/search/classes_e.js new file mode 100644 index 00000000..d9a1790a --- /dev/null +++ b/html/search/classes_e.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['sha1',['SHA1',['../classSHA1.html',1,'']]], + ['sha256',['SHA256',['../classSHA256.html',1,'']]], + ['sha3_5f256',['SHA3_256',['../classSHA3__256.html',1,'']]], + ['sha3_5f512',['SHA3_512',['../classSHA3__512.html',1,'']]], + ['sha512',['SHA512',['../classSHA512.html',1,'']]], + ['softi2c',['SoftI2C',['../classSoftI2C.html',1,'']]] +]; diff --git a/html/search/classes_f.html b/html/search/classes_f.html new file mode 100644 index 00000000..cee523ad --- /dev/null +++ b/html/search/classes_f.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/classes_f.js b/html/search/classes_f.js new file mode 100644 index 00000000..57d4c0cb --- /dev/null +++ b/html/search/classes_f.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['textfield',['TextField',['../classTextField.html',1,'']]], + ['timefield',['TimeField',['../classTimeField.html',1,'']]], + ['transistornoisesource',['TransistorNoiseSource',['../classTransistorNoiseSource.html',1,'']]] +]; diff --git a/html/search/close.png b/html/search/close.png new file mode 100644 index 00000000..9342d3df Binary files /dev/null and b/html/search/close.png differ diff --git a/html/search/enums_0.html b/html/search/enums_0.html new file mode 100644 index 00000000..b4cbe1e3 --- /dev/null +++ b/html/search/enums_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/enums_0.js b/html/search/enums_0.js new file mode 100644 index 00000000..d73fdcec --- /dev/null +++ b/html/search/enums_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['dayofweek',['DayOfWeek',['../classRTC.html#ab2ca0cbee608ec32d3d6e04d40298f11',1,'RTC']]] +]; diff --git a/html/search/enums_1.html b/html/search/enums_1.html new file mode 100644 index 00000000..2af2a03e --- /dev/null +++ b/html/search/enums_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/enums_1.js b/html/search/enums_1.js new file mode 100644 index 00000000..cd712f20 --- /dev/null +++ b/html/search/enums_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['screensavermode',['ScreenSaverMode',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28',1,'LCD']]], + ['sleepduration',['SleepDuration',['../group__power__save.html#gabdc6266a040b28c4d79028ddb0ceae36',1,'PowerSave.h']]] +]; diff --git a/html/search/enumvalues_0.html b/html/search/enumvalues_0.html new file mode 100644 index 00000000..3e00fcf6 --- /dev/null +++ b/html/search/enumvalues_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/enumvalues_0.js b/html/search/enumvalues_0.js new file mode 100644 index 00000000..6512fd4b --- /dev/null +++ b/html/search/enumvalues_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['backlightoff',['BacklightOff',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a9931c078cfd1023c69f1da431f9a656c',1,'LCD']]], + ['backlightonselect',['BacklightOnSelect',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a781f3c5e42506bf4f86ba06d69b23d35',1,'LCD']]] +]; diff --git a/html/search/enumvalues_1.html b/html/search/enumvalues_1.html new file mode 100644 index 00000000..0e575c96 --- /dev/null +++ b/html/search/enumvalues_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/enumvalues_1.js b/html/search/enumvalues_1.js new file mode 100644 index 00000000..ed2e276d --- /dev/null +++ b/html/search/enumvalues_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['displayoff',['DisplayOff',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28a3f1e62d5fcd314d6ff067d3e74c4bf5f',1,'LCD']]] +]; diff --git a/html/search/enumvalues_2.html b/html/search/enumvalues_2.html new file mode 100644 index 00000000..e59f4acb --- /dev/null +++ b/html/search/enumvalues_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/enumvalues_2.js b/html/search/enumvalues_2.js new file mode 100644 index 00000000..8a0737e6 --- /dev/null +++ b/html/search/enumvalues_2.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['sleep_5f120_5fms',['SLEEP_120_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a96fa577b54aa6f2341ea5ddd839aa8bc',1,'PowerSave.h']]], + ['sleep_5f15_5fms',['SLEEP_15_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a3d16487a7386c6348f1c1d886564e3c4',1,'PowerSave.h']]], + ['sleep_5f1_5fsec',['SLEEP_1_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a92310daf29e5899770b80c1c4e850b9b',1,'PowerSave.h']]], + ['sleep_5f250_5fms',['SLEEP_250_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36abcbf68cfdb688220da61ac98b1a2ec69',1,'PowerSave.h']]], + ['sleep_5f2_5fsec',['SLEEP_2_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a04571aa0b801c28cd756513303b229cd',1,'PowerSave.h']]], + ['sleep_5f30_5fms',['SLEEP_30_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36af31050c5ef733b3e231920143b041825',1,'PowerSave.h']]], + ['sleep_5f4_5fsec',['SLEEP_4_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a4cba1036d7a69225110b68b372f10410',1,'PowerSave.h']]], + ['sleep_5f500_5fms',['SLEEP_500_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36aa49e4d5f92a5f48070dde0babf75a9b0',1,'PowerSave.h']]], + ['sleep_5f60_5fms',['SLEEP_60_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a716f5a9f35e77a2d334ad71f05bd5fdc',1,'PowerSave.h']]], + ['sleep_5f8_5fsec',['SLEEP_8_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a8c47dd1ef81c2f41da7525b5ee4bfc3a',1,'PowerSave.h']]] +]; diff --git a/html/search/files_0.html b/html/search/files_0.html new file mode 100644 index 00000000..c7aa36c9 --- /dev/null +++ b/html/search/files_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_0.js b/html/search/files_0.js new file mode 100644 index 00000000..6d45db61 --- /dev/null +++ b/html/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['alarm_2dclock_2edox',['alarm-clock.dox',['../alarm-clock_8dox.html',1,'']]] +]; diff --git a/html/search/files_1.html b/html/search/files_1.html new file mode 100644 index 00000000..eca1c805 --- /dev/null +++ b/html/search/files_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_1.js b/html/search/files_1.js new file mode 100644 index 00000000..d3fac326 --- /dev/null +++ b/html/search/files_1.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['blink_2dblink_2edox',['blink-blink.dox',['../blink-blink_8dox.html',1,'']]], + ['blink_2dcharlieplex_2edox',['blink-charlieplex.dox',['../blink-charlieplex_8dox.html',1,'']]], + ['blink_2dcylon_2edox',['blink-cylon.dox',['../blink-cylon_8dox.html',1,'']]], + ['blink_2dstartrek_2edox',['blink-startrek.dox',['../blink-startrek_8dox.html',1,'']]] +]; diff --git a/html/search/files_2.html b/html/search/files_2.html new file mode 100644 index 00000000..04a8a463 --- /dev/null +++ b/html/search/files_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_2.js b/html/search/files_2.js new file mode 100644 index 00000000..4f67a847 --- /dev/null +++ b/html/search/files_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['crypto_2drng_2dring_2edox',['crypto-rng-ring.dox',['../crypto-rng-ring_8dox.html',1,'']]], + ['crypto_2drng_2edox',['crypto-rng.dox',['../crypto-rng_8dox.html',1,'']]], + ['crypto_2edox',['crypto.dox',['../crypto_8dox.html',1,'']]] +]; diff --git a/html/search/files_3.html b/html/search/files_3.html new file mode 100644 index 00000000..0dc9a561 --- /dev/null +++ b/html/search/files_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_3.js b/html/search/files_3.js new file mode 100644 index 00000000..ea29379f --- /dev/null +++ b/html/search/files_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dmd_2ddemo_2edox',['dmd-demo.dox',['../dmd-demo_8dox.html',1,'']]], + ['dmd_2drunning_2dfigure_2edox',['dmd-running-figure.dox',['../dmd-running-figure_8dox.html',1,'']]] +]; diff --git a/html/search/files_4.html b/html/search/files_4.html new file mode 100644 index 00000000..891b5da3 --- /dev/null +++ b/html/search/files_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_4.js b/html/search/files_4.js new file mode 100644 index 00000000..6dc9646a --- /dev/null +++ b/html/search/files_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ir_2ddumpir_2edox',['ir-dumpir.dox',['../ir-dumpir_8dox.html',1,'']]], + ['ir_2dsnake_2edox',['ir-snake.dox',['../ir-snake_8dox.html',1,'']]] +]; diff --git a/html/search/files_5.html b/html/search/files_5.html new file mode 100644 index 00000000..1741195c --- /dev/null +++ b/html/search/files_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_5.js b/html/search/files_5.js new file mode 100644 index 00000000..23e81c68 --- /dev/null +++ b/html/search/files_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['lcd_2dform_2edox',['lcd-form.dox',['../lcd-form_8dox.html',1,'']]], + ['lcd_2dhelloworld_2edox',['lcd-helloworld.dox',['../lcd-helloworld_8dox.html',1,'']]] +]; diff --git a/html/search/files_6.html b/html/search/files_6.html new file mode 100644 index 00000000..262d3da2 --- /dev/null +++ b/html/search/files_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/files_6.js b/html/search/files_6.js new file mode 100644 index 00000000..a490ea9e --- /dev/null +++ b/html/search/files_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['mainpage_2edox',['mainpage.dox',['../mainpage_8dox.html',1,'']]] +]; diff --git a/html/search/functions_0.html b/html/search/functions_0.html new file mode 100644 index 00000000..16a5a527 --- /dev/null +++ b/html/search/functions_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_0.js b/html/search/functions_0.js new file mode 100644 index 00000000..9a816c0e --- /dev/null +++ b/html/search/functions_0.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['addfield',['addField',['../classForm.html#a5cb056ace428e75e321610555bfecac7',1,'Form']]], + ['addnoisesource',['addNoiseSource',['../classRNGClass.html#aacf23b192b0e4cc8726d9abe05f5a9db',1,'RNGClass']]], + ['adjustdays',['adjustDays',['../classRTC.html#adc29d7c43efc5a192d21965da5c3ee1d',1,'RTC']]], + ['adjustmonths',['adjustMonths',['../classRTC.html#aeca597e6e37a05716e664242f9cfc5f4',1,'RTC']]], + ['adjustyears',['adjustYears',['../classRTC.html#a31d10cb2f7cac8839bd4be2d858b802d',1,'RTC']]], + ['advance',['advance',['../classChaseLEDs.html#aa0f4e0bd07dd65ee5574e894a612486b',1,'ChaseLEDs']]], + ['advancetime',['advanceTime',['../classChaseLEDs.html#aed060c51bb63dd8065be89f895989700',1,'ChaseLEDs']]], + ['aes128',['AES128',['../classAES128.html#af826ce33301767919bb60f27ad3ff693',1,'AES128']]], + ['aes192',['AES192',['../classAES192.html#a6f8e457cfffdc12f7dd829e3ac4585ce',1,'AES192']]], + ['aes256',['AES256',['../classAES256.html#a3b2cbe56f03a87ec4260be4f8914fb02',1,'AES256']]], + ['aescommon',['AESCommon',['../classAESCommon.html#acf224a392659429bac80dc68c7471b21',1,'AESCommon']]], + ['available',['available',['../classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf',1,'EEPROM24::available()'],['../classI2CMaster.html#a6458fa99cfd9e6270ae6dff993955833',1,'I2CMaster::available()'],['../classSoftI2C.html#a849af91018caedbb82e83f02c543305e',1,'SoftI2C::available()'],['../classRNGClass.html#a49e3231ba65a5e4b045bc90976e0a659',1,'RNGClass::available()']]] +]; diff --git a/html/search/functions_1.html b/html/search/functions_1.html new file mode 100644 index 00000000..3b4eacfe --- /dev/null +++ b/html/search/functions_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_1.js b/html/search/functions_1.js new file mode 100644 index 00000000..dd549ca9 --- /dev/null +++ b/html/search/functions_1.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['backlightpin',['backlightPin',['../classLCD.html#a171f59ba80e7775ebd3a399f56482a9c',1,'LCD']]], + ['begin',['begin',['../classRNGClass.html#a7f1aab3c324f8e8a424d683425e0fcf8',1,'RNGClass']]], + ['bitmap',['Bitmap',['../classBitmap.html#a40526748415c8bbc58a8510d636c20f4',1,'Bitmap']]], + ['bitsperpixel',['bitsPerPixel',['../classBitmap.html#ad18d3d5a1e77d541a95e93ad1f958411',1,'Bitmap']]], + ['blake2b',['BLAKE2b',['../classBLAKE2b.html#a19b3b751809905a5587468f0d6c666ff',1,'BLAKE2b']]], + ['blake2s',['BLAKE2s',['../classBLAKE2s.html#a7345f4e08c19d7a8c278282b46df21a2',1,'BLAKE2s']]], + ['blinkled',['BlinkLED',['../classBlinkLED.html#afc33958651e7ce6dceb428ea654c2c2f',1,'BlinkLED']]], + ['blockcipher',['BlockCipher',['../classBlockCipher.html#adc3d7cba116cbea9ad017f4cded6fe2f',1,'BlockCipher']]], + ['blocksize',['blockSize',['../classAESCommon.html#ae26afdcc6d18e8888974acae16df1413',1,'AESCommon::blockSize()'],['../classBLAKE2b.html#abec1b2320c3afaed12a29cf081b95fe2',1,'BLAKE2b::blockSize()'],['../classBLAKE2s.html#a9b5403734c20a0591d72a98912e4a305',1,'BLAKE2s::blockSize()'],['../classBlockCipher.html#a7059a310487c128db034b0ce0ad425a0',1,'BlockCipher::blockSize()'],['../classHash.html#a4e4297812e3483410556830fe5d47bdf',1,'Hash::blockSize()'],['../classKeccakCore.html#a3742ed39151811b5d1c263c75ee5b20a',1,'KeccakCore::blockSize()'],['../classSHA1.html#a816e3fd1a02cf1ecc67866cd8c7c309a',1,'SHA1::blockSize()'],['../classSHA256.html#a71bbd9064f9d6191d0647f867953a858',1,'SHA256::blockSize()'],['../classSHA3__256.html#a88a50ab6c2d4ad105cda2dd504d96e7c',1,'SHA3_256::blockSize()'],['../classSHA3__512.html#a4493a717bad8fa5cd35fe3aa36f25ab3',1,'SHA3_512::blockSize()'],['../classSHA512.html#acf8b9bcb6be91ee70acc3700a2ffa1a1',1,'SHA512::blockSize()']]], + ['boolfield',['BoolField',['../classBoolField.html#a5d4382cdcdc989de0179d8f3f3a59998',1,'BoolField::BoolField(const String &label)'],['../classBoolField.html#a49aad212ed18f84baa105c24e86281d9',1,'BoolField::BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)']]], + ['bytecount',['byteCount',['../classDS1307RTC.html#a93c25269a9b78ab3331354db26672248',1,'DS1307RTC::byteCount()'],['../classDS3232RTC.html#a1319fe936dcb7e9d6bdf200b77a94f8e',1,'DS3232RTC::byteCount()'],['../classRTC.html#acfdebfb449710e44e11f9a3675e14fd8',1,'RTC::byteCount()']]] +]; diff --git a/html/search/functions_10.html b/html/search/functions_10.html new file mode 100644 index 00000000..52cb0d3c --- /dev/null +++ b/html/search/functions_10.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_10.js b/html/search/functions_10.js new file mode 100644 index 00000000..12dc6e54 --- /dev/null +++ b/html/search/functions_10.js @@ -0,0 +1,65 @@ +var searchData= +[ + ['save',['save',['../classRNGClass.html#a139584fb249148e2058d1d645d090db7',1,'RNGClass']]], + ['screensavermode',['screenSaverMode',['../classLCD.html#a1917fa285f81f476b4c7cc20d15456b8',1,'LCD']]], + ['scroll',['scroll',['../classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a',1,'Bitmap::scroll(int dx, int dy, Color fillColor=Black)'],['../classBitmap.html#af79ad4432297ff453fddc55625fec485',1,'Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)']]], + ['setadvancetime',['setAdvanceTime',['../classChaseLEDs.html#af560270f72302c19fb7f95002089c9d7',1,'ChaseLEDs']]], + ['setalarm',['setAlarm',['../classDS3231RTC.html#adb8b36354f00ea0a862cce6b1805d4c0',1,'DS3231RTC']]], + ['setautosavetime',['setAutoSaveTime',['../classRNGClass.html#a5848e87a5f2f0302c88b0377f0e3366d',1,'RNGClass']]], + ['setbacklightpin',['setBacklightPin',['../classLCD.html#a0b9b3b954290e7a3d94cdc829582b0a8',1,'LCD']]], + ['setblinkrate',['setBlinkRate',['../classBlinkLED.html#a47f95624881063aa91c0066ed2c92258',1,'BlinkLED']]], + ['setblockcipher',['setBlockCipher',['../classCBCCommon.html#a0b7631244b0c2c954cfdb50eb32f7db1',1,'CBCCommon::setBlockCipher()'],['../classCFBCommon.html#a9161530f456efacb64f5008fdb1a460c',1,'CFBCommon::setBlockCipher()'],['../classCTRCommon.html#a6c409c4ec1f99e0cb751196d891dc228',1,'CTRCommon::setBlockCipher()'],['../classOFBCommon.html#a0053e2566a88859effffacbf1e4ade04',1,'OFBCommon::setBlockCipher()']]], + ['setcapacity',['setCapacity',['../classKeccakCore.html#ab3c1905f2002e49aca085d6f0b5546f7',1,'KeccakCore']]], + ['setcounter',['setCounter',['../classChaCha.html#acab9109b7189ea88d9e5417a3a209eac',1,'ChaCha']]], + ['setcountersize',['setCounterSize',['../classCTRCommon.html#ae2bc6b33a864412598b426320d853337',1,'CTRCommon']]], + ['setcurrentfield',['setCurrentField',['../classForm.html#ae6004fedfa07191ffd47d7b12370b4e5',1,'Form']]], + ['setdoublebuffer',['setDoubleBuffer',['../classDMD.html#a6fbdcf8832f91d02500cb7a9b84d2723',1,'DMD']]], + ['setfalselabel',['setFalseLabel',['../classBoolField.html#ae6a29d27139fd78f2ca96152059fb30a',1,'BoolField']]], + ['setfont',['setFont',['../classBitmap.html#a64d7a9651d5c385a044cc910a3b82837',1,'Bitmap']]], + ['sethmackey',['setHMACKey',['../classKeccakCore.html#aeff6b3357916bf426b60d3629db52628',1,'KeccakCore']]], + ['setholdtime',['setHoldTime',['../classCharlieplex.html#a8502f4c752faba37023ced587695f6a4',1,'Charlieplex']]], + ['setitems',['setItems',['../classListField.html#ae6709bce9355451b651893691456704e',1,'ListField']]], + ['setiv',['setIV',['../classCBCCommon.html#ac7a586217835055b3a354bb932db160c',1,'CBCCommon::setIV()'],['../classCFBCommon.html#a597040eb7df40adbbef94b4c3975cd80',1,'CFBCommon::setIV()'],['../classChaCha.html#a734f3246b1e6810c63637b8cda26b259',1,'ChaCha::setIV()'],['../classCipher.html#a3777acd8ff776a4e945bb7c9f2d044d9',1,'Cipher::setIV()'],['../classCTRCommon.html#aad289af3eb013cb3ffda6d7e8e8b3d04',1,'CTRCommon::setIV()'],['../classOFBCommon.html#a4a35364cf30d78f1968cc00803686caf',1,'OFBCommon::setIV()']]], + ['setkey',['setKey',['../classAES128.html#a42d7548eb5084a2c3e2d5aa5f6f98ba4',1,'AES128::setKey()'],['../classAES192.html#a4ab37cff19fb05ceef1533ebc5e37cde',1,'AES192::setKey()'],['../classAES256.html#a6af085d2d6a730ff1e025f982121bbda',1,'AES256::setKey()'],['../classBlockCipher.html#a9a05307664469777592799c8f77397c4',1,'BlockCipher::setKey()'],['../classCBCCommon.html#add75ea4342a190e560cee26a8e9efc37',1,'CBCCommon::setKey()'],['../classCFBCommon.html#a45b9be25fb96f0e3ca5211b064e2baea',1,'CFBCommon::setKey()'],['../classChaCha.html#a6b2bdffbd3705e388bb458edb2f40c90',1,'ChaCha::setKey()'],['../classCipher.html#a0dfe133bda81dfa680b668f5908ccbe5',1,'Cipher::setKey()'],['../classCTRCommon.html#a79da937dc2c444a174176beab33c055a',1,'CTRCommon::setKey()'],['../classOFBCommon.html#ac3a98e81d95ebc6c883baef5f4cfbefb',1,'OFBCommon::setKey()']]], + ['setlabel',['setLabel',['../classField.html#ad4ea63599d780c35b296cf2840b69f7b',1,'Field']]], + ['setled',['setLed',['../classCharlieplex.html#ab103c9687a0890faf72e4da79e3de0a5',1,'Charlieplex']]], + ['setloopcount',['setLoopCount',['../classMelody.html#a507097a2e8ff51a5e9157e3a320ae35b',1,'Melody']]], + ['setloopduration',['setLoopDuration',['../classMelody.html#ae88ad06c2acb728f56dd213d5dad6006',1,'Melody']]], + ['setmaxhours',['setMaxHours',['../classTimeField.html#a7ac124eb9dde01c18c711c421736b5ed',1,'TimeField']]], + ['setmaxvalue',['setMaxValue',['../classIntField.html#a36cbd7c24480cc3fcf0c7634d5e22bf1',1,'IntField']]], + ['setmelody',['setMelody',['../classMelody.html#adb6ad8e8cfe8c9a137e470f4e85c7254',1,'Melody']]], + ['setminvalue',['setMinValue',['../classIntField.html#afffe7be6721a043cec7a5a85c19e0ada',1,'IntField']]], + ['setnumrounds',['setNumRounds',['../classChaCha.html#a1a0911e0be8f4590d7fb76884d98c541',1,'ChaCha']]], + ['setpixel',['setPixel',['../classBitmap.html#aac994b75418e7d37ec66829437329114',1,'Bitmap']]], + ['setpwmled',['setPwmLed',['../classCharlieplex.html#a605a302e13005a1aa3d68d0e22bc474b',1,'Charlieplex']]], + ['setreadonly',['setReadOnly',['../classTimeField.html#a3f002a0729e90e88d04025908be102fe',1,'TimeField']]], + ['setscreensavermode',['setScreenSaverMode',['../classLCD.html#a56d1f68532c779c65fbbd071fb444801',1,'LCD']]], + ['setstate',['setState',['../classBlinkLED.html#af904a345e56d49948a042ac439d0b9d4',1,'BlinkLED']]], + ['setstepvalue',['setStepValue',['../classIntField.html#a8fb6e207bd906062bb788e19dbe58bcb',1,'IntField']]], + ['setsuffix',['setSuffix',['../classIntField.html#a9324bba994389f3a4563d9c18bd2f1cd',1,'IntField']]], + ['setsystemfilter',['setSystemFilter',['../classIRreceiver.html#a920828f1411fa12d1856cd933066bd08',1,'IRreceiver']]], + ['settextcolor',['setTextColor',['../classBitmap.html#a8e225a4f188269bb18265ae4b49de0a3',1,'Bitmap']]], + ['settruelabel',['setTrueLabel',['../classBoolField.html#a803fc8c39765da4a44af01d925cd4194',1,'BoolField']]], + ['setvalue',['setValue',['../classBoolField.html#a080c575fd4a98e6afc4b9197fbab5577',1,'BoolField::setValue()'],['../classIntField.html#aed421e2c52946f2c7643534b4f6f13f7',1,'IntField::setValue()'],['../classListField.html#a266193631e897fb0b46e1270b1d0eb24',1,'ListField::setValue()'],['../classTextField.html#a24b98c5bb744331bf0a5facc8ea9c033',1,'TextField::setValue()'],['../classTimeField.html#a063b6df2bd6fa7970ee445ab4e5d1fc1',1,'TimeField::setValue()']]], + ['sha1',['SHA1',['../classSHA1.html#ad49a5108ffd6996b1133bf41224ff726',1,'SHA1']]], + ['sha256',['SHA256',['../classSHA256.html#ab672831c542df07ff03ded25760feec2',1,'SHA256']]], + ['sha3_5f256',['SHA3_256',['../classSHA3__256.html#ac091b276c6d80a981fa64a9e8c68ca87',1,'SHA3_256']]], + ['sha3_5f512',['SHA3_512',['../classSHA3__512.html#a5f8bc4180e9d19597f499468098a82a4',1,'SHA3_512']]], + ['sha512',['SHA512',['../classSHA512.html#a520d966d99c0008e3cc58bd3b77dafcd',1,'SHA512']]], + ['show',['show',['../classForm.html#a9e8d718ab55a8034c22c606ccfa90d65',1,'Form']]], + ['size',['size',['../classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c',1,'EEPROM24']]], + ['sleepfor',['sleepFor',['../group__power__save.html#ga95c1666038493a7f95be6768882eebad',1,'sleepFor(SleepDuration duration, uint8_t mode): PowerSave.cpp'],['../group__power__save.html#ga95c1666038493a7f95be6768882eebad',1,'sleepFor(SleepDuration duration, uint8_t mode=0): PowerSave.cpp']]], + ['softi2c',['SoftI2C',['../classSoftI2C.html#adb6e00ee3f930f1d32010a18feb5f6cc',1,'SoftI2C']]], + ['startread',['startRead',['../classI2CMaster.html#a4e5f1a1a4c2242699be5a35fc4872fde',1,'I2CMaster::startRead()'],['../classSoftI2C.html#aa0dafc067cfa374af75e060dca647ec3',1,'SoftI2C::startRead()']]], + ['startwrite',['startWrite',['../classI2CMaster.html#a01960fc821cb25e4c88c26d2c6107e35',1,'I2CMaster::startWrite()'],['../classSoftI2C.html#aa8a3219f4e6ff52306cc3c219f37d8f9',1,'SoftI2C::startWrite()']]], + ['state',['state',['../classBlinkLED.html#ab89b5b3435998ea6699d4bf94866e233',1,'BlinkLED']]], + ['stepvalue',['stepValue',['../classIntField.html#a49025ee3473fe066a6a6c546af98bfbd',1,'IntField']]], + ['stir',['stir',['../classNoiseSource.html#a7ce647815524fe84f562aca5256e12f3',1,'NoiseSource::stir()'],['../classRingOscillatorNoiseSource.html#ad71698b5c92b41eef2f1322999b3eff9',1,'RingOscillatorNoiseSource::stir()'],['../classRNGClass.html#ad99535ea23ae2fec55bdebb8c24def02',1,'RNGClass::stir()'],['../classTransistorNoiseSource.html#add25c6a14b0506bc30ca781f2d923917',1,'TransistorNoiseSource::stir()']]], + ['stop',['stop',['../classMelody.html#ac0c552233c41d85f2766d2e4df376b2b',1,'Melody']]], + ['stride',['stride',['../classBitmap.html#af30df263729385ea2330effe3c80a1bc',1,'Bitmap']]], + ['suffix',['suffix',['../classIntField.html#a1a1de6a1836dfdb820c92b7f188a1b05',1,'IntField']]], + ['swapbuffers',['swapBuffers',['../classDMD.html#a80269ccd44b3ef9ee15f0a1009b7a60a',1,'DMD']]], + ['swapbuffersandcopy',['swapBuffersAndCopy',['../classDMD.html#a0b1771cf790b2b62eea55e56b02e3736',1,'DMD']]], + ['system',['system',['../classIRreceiver.html#a19e9334ae97812fa85078507d105478f',1,'IRreceiver']]], + ['systemfilter',['systemFilter',['../classIRreceiver.html#a2c6adc404f71f263ba535ec1ed9cff1a',1,'IRreceiver']]] +]; diff --git a/html/search/functions_11.html b/html/search/functions_11.html new file mode 100644 index 00000000..5e91b098 --- /dev/null +++ b/html/search/functions_11.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_11.js b/html/search/functions_11.js new file mode 100644 index 00000000..db96fc6d --- /dev/null +++ b/html/search/functions_11.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['textcolor',['textColor',['../classBitmap.html#ab6e5f5744fd2f18478aac428b751d848',1,'Bitmap']]], + ['textfield',['TextField',['../classTextField.html#a5108741ab147b2cd5a399fefbe0a2382',1,'TextField::TextField(const String &label)'],['../classTextField.html#a24096a344d9161b2c99ce724ec2ee93c',1,'TextField::TextField(Form &form, const String &label, const String &value)']]], + ['textheight',['textHeight',['../classBitmap.html#a628bb694fcfe6eab619a4f1e152d41c4',1,'Bitmap']]], + ['textwidth',['textWidth',['../classBitmap.html#a0f7607b1c7867987f4500d490a666e8a',1,'Bitmap::textWidth(const char *str, int len=-1) const '],['../classBitmap.html#a8ca70aa0f8f722a228358bffe794e925',1,'Bitmap::textWidth(const String &str, int start=0, int len=-1) const ']]], + ['timefield',['TimeField',['../classTimeField.html#a138e2425379705828a87eb2d8a836431',1,'TimeField::TimeField(const String &label)'],['../classTimeField.html#a87f222bc098367963ed21a7edc4624de',1,'TimeField::TimeField(Form &form, const String &label, int maxHours, bool readOnly)']]], + ['transistornoisesource',['TransistorNoiseSource',['../classTransistorNoiseSource.html#a05bab61c301a5397021048c95ca3107d',1,'TransistorNoiseSource']]], + ['truelabel',['trueLabel',['../classBoolField.html#a9972030beec6e007b556c6eb652e163d',1,'BoolField']]] +]; diff --git a/html/search/functions_12.html b/html/search/functions_12.html new file mode 100644 index 00000000..1ab0742b --- /dev/null +++ b/html/search/functions_12.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_12.js b/html/search/functions_12.js new file mode 100644 index 00000000..4d6b3005 --- /dev/null +++ b/html/search/functions_12.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['unusedpin',['unusedPin',['../group__power__save.html#ga6dbe8e20a70e83cf5b068177675ec792',1,'PowerSave.h']]], + ['update',['update',['../classBLAKE2b.html#a468e48c66ce1738e11c922d133135069',1,'BLAKE2b::update()'],['../classBLAKE2s.html#aa192da2fa044b03cccaf11e87fdf9911',1,'BLAKE2s::update()'],['../classHash.html#aec9761ee427d122e7450de8df200265c',1,'Hash::update()'],['../classKeccakCore.html#aaaa0355ccec0f469ac8eb577bdf853ed',1,'KeccakCore::update()'],['../classSHA1.html#aec77fbc5015f82bbf7055e535085656a',1,'SHA1::update()'],['../classSHA256.html#a555bf8efb17afd4842d2e55a1f39f27b',1,'SHA256::update()'],['../classSHA3__256.html#a8356957ea403c5da326fc6899b91ea71',1,'SHA3_256::update()'],['../classSHA3__512.html#a0563e4c87150e6019671b4fe92fd63a4',1,'SHA3_512::update()'],['../classSHA512.html#a7d37a20d7ab431ab15d094f768b6a695',1,'SHA512::update()']]], + ['updatecursor',['updateCursor',['../classField.html#afc612378167be0e7f8a6f8395b3537bd',1,'Field']]] +]; diff --git a/html/search/functions_13.html b/html/search/functions_13.html new file mode 100644 index 00000000..724f5c10 --- /dev/null +++ b/html/search/functions_13.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_13.js b/html/search/functions_13.js new file mode 100644 index 00000000..46d0b7fe --- /dev/null +++ b/html/search/functions_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['value',['value',['../classBoolField.html#a9147826437fbaf9b29eda9dee9e37b39',1,'BoolField::value()'],['../classIntField.html#a2fb650827ce8cb4662253bb6c32acb52',1,'IntField::value()'],['../classListField.html#aab8477757cd89bacd242c85bac2dccb1',1,'ListField::value()'],['../classTextField.html#a124764b6fc7c19aaf683f72cd42636b1',1,'TextField::value()'],['../classTimeField.html#a400aaa72a83b3b872e1de1c3af1a240f',1,'TimeField::value()']]] +]; diff --git a/html/search/functions_14.html b/html/search/functions_14.html new file mode 100644 index 00000000..396906bd --- /dev/null +++ b/html/search/functions_14.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_14.js b/html/search/functions_14.js new file mode 100644 index 00000000..d62137ea --- /dev/null +++ b/html/search/functions_14.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['width',['width',['../classBitmap.html#a76c3b49e535761f07c553e7336daf523',1,'Bitmap']]], + ['write',['write',['../classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8',1,'EEPROM24::write(unsigned long address, uint8_t value)'],['../classEEPROM24.html#a3d918ed34da7ca6d21a776c0614eebf3',1,'EEPROM24::write(unsigned long address, const void *data, size_t length)'],['../classI2CMaster.html#a0bf6b84cb1e2b3a37a4a0260d0b6f960',1,'I2CMaster::write()'],['../classSoftI2C.html#ab46f0b6363c9cfe6fb3ab907956d5d73',1,'SoftI2C::write()']]], + ['writealarm',['writeAlarm',['../classDS1307RTC.html#a7354aed91d7c94d0d7b2144b1bf32c75',1,'DS1307RTC::writeAlarm()'],['../classDS3231RTC.html#a1ed8945018024816600f709c6eb0c749',1,'DS3231RTC::writeAlarm()'],['../classDS3232RTC.html#a8b0a65e0ac479aec8fad6ca3147dbe75',1,'DS3232RTC::writeAlarm()'],['../classRTC.html#a0e96c91efd9e7a6340effdae3eadf17e',1,'RTC::writeAlarm()']]], + ['writebyte',['writeByte',['../classDS1307RTC.html#a6ef435fd4aa4adf8eefdf8b1741f5ba6',1,'DS1307RTC::writeByte()'],['../classDS3232RTC.html#a9acebf12c5cecdd6d84e0ff9ed41765a',1,'DS3232RTC::writeByte()'],['../classRTC.html#a1cab6397ec04b1e2b3feea5b3cd1f749',1,'RTC::writeByte()']]], + ['writedate',['writeDate',['../classDS1307RTC.html#a4f7346be33612cf9ecd96080eb046230',1,'DS1307RTC::writeDate()'],['../classDS3231RTC.html#a450a143514a5aa228f8ef7a23d83d036',1,'DS3231RTC::writeDate()'],['../classDS3232RTC.html#a31c004a90c724979d8267c31f2dbf5ed',1,'DS3232RTC::writeDate()'],['../classRTC.html#ae667600d05c8e7b06a93574dd068a4d7',1,'RTC::writeDate()']]], + ['writetime',['writeTime',['../classDS1307RTC.html#a0a5d0d86a0345420ebb289ea724b19e8',1,'DS1307RTC::writeTime()'],['../classDS3231RTC.html#ae9bee8f68f9e124562230175ca9d15c3',1,'DS3231RTC::writeTime()'],['../classDS3232RTC.html#ab0ca13a8b80da856b37fc53b84e27c78',1,'DS3232RTC::writeTime()'],['../classRTC.html#a102e2ec15bf0273d8f7e9ce4b6dcc96e',1,'RTC::writeTime()']]] +]; diff --git a/html/search/functions_15.html b/html/search/functions_15.html new file mode 100644 index 00000000..2dee32be --- /dev/null +++ b/html/search/functions_15.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_15.js b/html/search/functions_15.js new file mode 100644 index 00000000..4bc2b6bb --- /dev/null +++ b/html/search/functions_15.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['_7eaescommon',['~AESCommon',['../classAESCommon.html#a8f67970c86c23affb0297fc1bb10fad8',1,'AESCommon']]], + ['_7ebitmap',['~Bitmap',['../classBitmap.html#a72d2a301ec1eb1c8d0f3d64823659a8e',1,'Bitmap']]], + ['_7eblake2b',['~BLAKE2b',['../classBLAKE2b.html#ad0287d7284000ff236153e6afa0130f1',1,'BLAKE2b']]], + ['_7eblake2s',['~BLAKE2s',['../classBLAKE2s.html#a4b3187ecaa3d3c8febfbb40c0f779aa7',1,'BLAKE2s']]], + ['_7eblockcipher',['~BlockCipher',['../classBlockCipher.html#acec1bc4faeaa6dda2d91bffd79a988f9',1,'BlockCipher']]], + ['_7ecbccommon',['~CBCCommon',['../classCBCCommon.html#a45a91367531b4692b3bb7237ab6e9015',1,'CBCCommon']]], + ['_7ecfbcommon',['~CFBCommon',['../classCFBCommon.html#ae200d7b876a1f154bcdb1cdf33d3be54',1,'CFBCommon']]], + ['_7echarlieplex',['~Charlieplex',['../classCharlieplex.html#a4dbe37ccba8ba18139f4e710afdcd103',1,'Charlieplex']]], + ['_7ecipher',['~Cipher',['../classCipher.html#a84bdea765f7e35aa5b5950dd2853a383',1,'Cipher']]], + ['_7edmd',['~DMD',['../classDMD.html#a7b37e05584d3e0308163700920df99b2',1,'DMD']]], + ['_7efield',['~Field',['../classField.html#a45d6e6d09b8f8e46de62b40119d62c60',1,'Field']]], + ['_7eform',['~Form',['../classForm.html#a9cda7cce41e81bfaca51e922d4f9b98f',1,'Form']]], + ['_7ehash',['~Hash',['../classHash.html#a4e4b4797dda8678aaed058bae155813e',1,'Hash']]], + ['_7ekeccakcore',['~KeccakCore',['../classKeccakCore.html#a4579e3a9b24f1d615fa8d660c23e77a4',1,'KeccakCore']]], + ['_7enoisesource',['~NoiseSource',['../classNoiseSource.html#a4eca1e894a5d719fb9bf4df34a791cdb',1,'NoiseSource']]], + ['_7eofbcommon',['~OFBCommon',['../classOFBCommon.html#aae7435157e51bf977d3481e94e17ae01',1,'OFBCommon']]], + ['_7erngclass',['~RNGClass',['../classRNGClass.html#aef3ee2fb14a39caf650dc90a0226dd31',1,'RNGClass']]], + ['_7esha1',['~SHA1',['../classSHA1.html#a8485d7c14fa29286cd3c7acfe438606d',1,'SHA1']]], + ['_7esha256',['~SHA256',['../classSHA256.html#ad82f2925b612de315b289017e023a73b',1,'SHA256']]], + ['_7esha3_5f256',['~SHA3_256',['../classSHA3__256.html#a835d09eb88d477cd162330c493cbdf64',1,'SHA3_256']]], + ['_7esha3_5f512',['~SHA3_512',['../classSHA3__512.html#a327005ebc8c0768118ec7d334c583f85',1,'SHA3_512']]], + ['_7esha512',['~SHA512',['../classSHA512.html#a777ec274fa838684b0208369c5f66391',1,'SHA512']]] +]; diff --git a/html/search/functions_2.html b/html/search/functions_2.html new file mode 100644 index 00000000..78be8b41 --- /dev/null +++ b/html/search/functions_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_2.js b/html/search/functions_2.js new file mode 100644 index 00000000..b6351d6b --- /dev/null +++ b/html/search/functions_2.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['calibrating',['calibrating',['../classNoiseSource.html#ac8ac086f830efb5ffe3e8d506aa61c85',1,'NoiseSource::calibrating()'],['../classRingOscillatorNoiseSource.html#ade7f7ed390e23722347b3c207912b3f9',1,'RingOscillatorNoiseSource::calibrating()'],['../classTransistorNoiseSource.html#a9244b327c291c737396e769da9c66af9',1,'TransistorNoiseSource::calibrating()']]], + ['capacity',['capacity',['../classKeccakCore.html#a804b895121a4e04bc491f41a5821a13e',1,'KeccakCore']]], + ['cbc',['CBC',['../classCBC.html#ae22d0d9347d5f3c97328e643a9b29ecb',1,'CBC']]], + ['cbccommon',['CBCCommon',['../classCBCCommon.html#a7575b369910e05f54e76698dd04bfa05',1,'CBCCommon']]], + ['cfb',['CFB',['../classCFB.html#a26a027614d027162c67085a58b512318',1,'CFB']]], + ['cfbcommon',['CFBCommon',['../classCFBCommon.html#adad0210430c83817c993bdca30d562a6',1,'CFBCommon']]], + ['chacha',['ChaCha',['../classChaCha.html#a5831811b705d3c80e97f0242597f0c7e',1,'ChaCha']]], + ['charlieplex',['Charlieplex',['../classCharlieplex.html#abfb0d0456bcbadbf60c21f615adacdbd',1,'Charlieplex']]], + ['charwidth',['charWidth',['../classBitmap.html#a9b79ac13077ca865e4515510297780bd',1,'Bitmap']]], + ['chaseleds',['ChaseLEDs',['../classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78',1,'ChaseLEDs']]], + ['cipher',['Cipher',['../classCipher.html#a6a61077eca3ccd5900f92ceac58fb09c',1,'Cipher']]], + ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classSHA1.html#a41a159d6565b04d3f620dcd720faaf3f',1,'SHA1::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()']]], + ['command',['command',['../classIRreceiver.html#a4b021592a2b089dc2f1e138a38506fda',1,'IRreceiver']]], + ['copy',['copy',['../classBitmap.html#ab22fe1f3871934987a670b559f67c67c',1,'Bitmap']]], + ['count',['count',['../classCharlieplex.html#a5008aa4143d381ce34a3aed1a3843e4e',1,'Charlieplex']]], + ['ctr',['CTR',['../classCTR.html#a7025ab5d79f0f0763f751aeabc425ca9',1,'CTR']]], + ['ctrcommon',['CTRCommon',['../classCTRCommon.html#abeb01342f17023e99776001d397c51ff',1,'CTRCommon']]], + ['currentfield',['currentField',['../classForm.html#a85a219a73294cef1f89a2182b5c25bf8',1,'Form']]] +]; diff --git a/html/search/functions_3.html b/html/search/functions_3.html new file mode 100644 index 00000000..ebf2eebd --- /dev/null +++ b/html/search/functions_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_3.js b/html/search/functions_3.js new file mode 100644 index 00000000..7039f30f --- /dev/null +++ b/html/search/functions_3.js @@ -0,0 +1,33 @@ +var searchData= +[ + ['data',['data',['../classBitmap.html#a5eeed27c176eb6e4a2c39ea83444e27d',1,'Bitmap::data()'],['../classBitmap.html#a20fea2a946545aa3b5edd78245149e5f',1,'Bitmap::data() const ']]], + ['dayofweek',['dayOfWeek',['../classRTC.html#a525a9c1dad89613708f47a683eb316aa',1,'RTC']]], + ['decrypt',['decrypt',['../classCBCCommon.html#ab46a2625cae9a654c708e1f31a0e22b6',1,'CBCCommon::decrypt()'],['../classCFBCommon.html#aaaa3d61c5743e30e355207c193c0b0ef',1,'CFBCommon::decrypt()'],['../classChaCha.html#a1f54b2b51b59428010f81a6c4dc4e42c',1,'ChaCha::decrypt()'],['../classCipher.html#ac6099d1a0d7f2ff67b0e4ccb4a17eb08',1,'Cipher::decrypt()'],['../classCTRCommon.html#a0943387cf1124258389702e0690740fe',1,'CTRCommon::decrypt()'],['../classOFBCommon.html#aeb3636d7175b150e2bf16367e51c2e36',1,'OFBCommon::decrypt()']]], + ['decryptblock',['decryptBlock',['../classAESCommon.html#a95a806adf42f975765ff62907efdc639',1,'AESCommon::decryptBlock()'],['../classBlockCipher.html#ac3ba2450222aa1ea804ae4881ab6440c',1,'BlockCipher::decryptBlock()']]], + ['defaultfield',['defaultField',['../classForm.html#aba75b59f68b31dd77dbbac9ab5c3124b',1,'Form']]], + ['destroy',['destroy',['../classRNGClass.html#a9901367d86f2303a59bbc12fe91cad00',1,'RNGClass']]], + ['dh1',['dh1',['../classCurve25519.html#a2b6911583d17ea9a36bbbb40d58b3d89',1,'Curve25519']]], + ['dh2',['dh2',['../classCurve25519.html#a14022d6ac68ec691ffb0247275078ab9',1,'Curve25519']]], + ['disable32khzoutput',['disable32kHzOutput',['../classDS3231RTC.html#a7c9c197c6f27c26e0cb9c5ddc95633c8',1,'DS3231RTC::disable32kHzOutput()'],['../classDS3232RTC.html#ada732bae42fc2833e59ae293aa27ddcb',1,'DS3232RTC::disable32kHzOutput()']]], + ['disablealarm',['disableAlarm',['../classDS3231RTC.html#a21e2667c53d30aa425043ec08a117c47',1,'DS3231RTC']]], + ['disablealarminterrupts',['disableAlarmInterrupts',['../classDS3231RTC.html#a245a56a9396ef49a4e089d743c759cdb',1,'DS3231RTC::disableAlarmInterrupts()'],['../classDS3232RTC.html#a225b8c62d617aa1b7be7d20e8a033be9',1,'DS3232RTC::disableAlarmInterrupts()']]], + ['disablescreensaver',['disableScreenSaver',['../classLCD.html#a85c3a4694b105731404df36e35e5b26e',1,'LCD']]], + ['disabletimer1',['disableTimer1',['../classDMD.html#a39af27e216f654ecc7e60b0614cb6b33',1,'DMD']]], + ['disabletimer2',['disableTimer2',['../classDMD.html#a52fe885bfb380b74df54c96221811cff',1,'DMD']]], + ['dispatch',['dispatch',['../classBoolField.html#af793bafc1193d79b495c2ede711bca57',1,'BoolField::dispatch()'],['../classField.html#a061bd1ed4d8b079df86465df8facd3b3',1,'Field::dispatch()'],['../classForm.html#a89bd3850e87caa2ca7b2e946f923d0ee',1,'Form::dispatch()'],['../classIntField.html#a01a17d5a89c76c42c4f0516984ce653f',1,'IntField::dispatch()'],['../classListField.html#a5d752bd561cde735b175bcdfda55832a',1,'ListField::dispatch()'],['../classTimeField.html#a9b953d9abdbe960a3fa34938462832e5',1,'TimeField::dispatch()']]], + ['display',['display',['../classLCD.html#a5b07cf05e8e5e7c53654f5ca0cf58b89',1,'LCD']]], + ['dmd',['DMD',['../classDMD.html#affd37accffe951c8878434dfa1245809',1,'DMD']]], + ['doublebuffer',['doubleBuffer',['../classDMD.html#aab1f3ba29c053d630ae12865d22166ec',1,'DMD']]], + ['drawbitmap',['drawBitmap',['../classBitmap.html#a491e9c0bb20ddf5a5eb4933077c8ed72',1,'Bitmap::drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)'],['../classBitmap.html#a5e4f23e8f14e193410b5f071149401e4',1,'Bitmap::drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)']]], + ['drawchar',['drawChar',['../classBitmap.html#a1a11f29863ee7f36a3b15c91963102bd',1,'Bitmap']]], + ['drawcircle',['drawCircle',['../classBitmap.html#a933763a4f3cba79fbcf97ae6d0a864aa',1,'Bitmap']]], + ['drawfilledcircle',['drawFilledCircle',['../classBitmap.html#a757291b9a39bcb0d64ac98d3a2fa061b',1,'Bitmap']]], + ['drawfilledrect',['drawFilledRect',['../classBitmap.html#a568acbca3818dd85dd62fff6d0b36ffb',1,'Bitmap']]], + ['drawinvertedbitmap',['drawInvertedBitmap',['../classBitmap.html#a4321640464bc08b60348c09bff01b86a',1,'Bitmap::drawInvertedBitmap(int x, int y, const Bitmap &bitmap)'],['../classBitmap.html#a2e862b72c2d6471af737fac320472d69',1,'Bitmap::drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)']]], + ['drawline',['drawLine',['../classBitmap.html#aa0a84f3694e343d68e7021552c69f767',1,'Bitmap']]], + ['drawrect',['drawRect',['../classBitmap.html#aac61e3f7f625db568e37d88b52b3b2fc',1,'Bitmap']]], + ['drawtext',['drawText',['../classBitmap.html#a3e9bcbfb584d5020bd6f0a313ee275f0',1,'Bitmap::drawText(int x, int y, const char *str, int len=-1)'],['../classBitmap.html#a802f5d6bd19a3727670e61e7a88a0cac',1,'Bitmap::drawText(int x, int y, const String &str, int start=0, int len=-1)']]], + ['ds1307rtc',['DS1307RTC',['../classDS1307RTC.html#a092805d75bea323dc4be062638bff866',1,'DS1307RTC']]], + ['ds3231rtc',['DS3231RTC',['../classDS3231RTC.html#a45df320cabed4ea2d5c34b437eda7e9f',1,'DS3231RTC']]], + ['ds3232rtc',['DS3232RTC',['../classDS3232RTC.html#aa959454ae01b11c48d6ec7ec192b4ccb',1,'DS3232RTC']]] +]; diff --git a/html/search/functions_4.html b/html/search/functions_4.html new file mode 100644 index 00000000..7317ea91 --- /dev/null +++ b/html/search/functions_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_4.js b/html/search/functions_4.js new file mode 100644 index 00000000..b54c8ef7 --- /dev/null +++ b/html/search/functions_4.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['eeprom24',['EEPROM24',['../classEEPROM24.html#ae8547f6ff7711496e1959ee24a142995',1,'EEPROM24']]], + ['enable32khzoutput',['enable32kHzOutput',['../classDS3231RTC.html#a032cf784eb82ccf6ff0a9745b47ac86b',1,'DS3231RTC::enable32kHzOutput()'],['../classDS3232RTC.html#a3966de6f4241d86f198a8b9dd5e7e59a',1,'DS3232RTC::enable32kHzOutput()']]], + ['enablealarm',['enableAlarm',['../classDS3231RTC.html#ad0a0614c48d4f809fee6017cd7350372',1,'DS3231RTC']]], + ['enablealarminterrupts',['enableAlarmInterrupts',['../classDS3231RTC.html#a0e9509219b2c7259accd68a55aaa5faf',1,'DS3231RTC::enableAlarmInterrupts()'],['../classDS3232RTC.html#ab91e79271a1f8e75b07bddbb04445dc9',1,'DS3232RTC::enableAlarmInterrupts()']]], + ['enablescreensaver',['enableScreenSaver',['../classLCD.html#af9a2326d034fa159d384ec16223c924f',1,'LCD']]], + ['enabletimer1',['enableTimer1',['../classDMD.html#a4c3b04b384f3d656a9b59690836775e2',1,'DMD']]], + ['enabletimer2',['enableTimer2',['../classDMD.html#a5469775db7fafebca2cdbc6a6372fb97',1,'DMD']]], + ['encrypt',['encrypt',['../classCBCCommon.html#a41d2f655a7df13cfcd009b2882e13147',1,'CBCCommon::encrypt()'],['../classCFBCommon.html#a57af3692389bed300d3cfdf351351c51',1,'CFBCommon::encrypt()'],['../classChaCha.html#acd4fff140b8871c233d9a31abf753ed8',1,'ChaCha::encrypt()'],['../classCipher.html#ad2832bd61039d61560e34ea3382ca562',1,'Cipher::encrypt()'],['../classCTRCommon.html#a201bda584d111552ce8ec09fac759963',1,'CTRCommon::encrypt()'],['../classOFBCommon.html#a984d81a460e0799895b19dc48c3b5cf8',1,'OFBCommon::encrypt()']]], + ['encryptblock',['encryptBlock',['../classAESCommon.html#a2d95f6159abfcd92b5841f9018e44296',1,'AESCommon::encryptBlock()'],['../classBlockCipher.html#aed0788b25f6bb2f1bd47d5a5f0c5db33',1,'BlockCipher::encryptBlock()']]], + ['endwrite',['endWrite',['../classI2CMaster.html#ab29f63551ddeb032a91505d1c0b8ac41',1,'I2CMaster::endWrite()'],['../classSoftI2C.html#aa12ae82813598b2e9ea70463c23c5bf3',1,'SoftI2C::endWrite()']]], + ['enterfield',['enterField',['../classBoolField.html#ab3f1e610b52caed7e41016f6ae3d7d09',1,'BoolField::enterField()'],['../classField.html#aa032bbeacb405c56546cb56fbbee94f5',1,'Field::enterField()'],['../classIntField.html#a51d9127b660e8dd7f87718acd230202a',1,'IntField::enterField()'],['../classListField.html#a191b79b460e45cf48e04b04eface2888',1,'ListField::enterField()'],['../classTextField.html#aa78f1354f9240b64fabd6f996e312f32',1,'TextField::enterField()'],['../classTimeField.html#ae914d6b870283a334d2d669460f7646b',1,'TimeField::enterField()']]], + ['eval',['eval',['../classCurve25519.html#a2e4b7dd83a019b32c76584c99bfda21a',1,'Curve25519']]], + ['exitfield',['exitField',['../classField.html#ad6805c75ee1e62f8cd8bd550c4530c07',1,'Field::exitField()'],['../classTimeField.html#a5a6b7db2e3fda7745e0ff9c3d8d9a541',1,'TimeField::exitField()']]], + ['extract',['extract',['../classKeccakCore.html#aad83ece853c0cc15fcab947fdcba924f',1,'KeccakCore']]] +]; diff --git a/html/search/functions_5.html b/html/search/functions_5.html new file mode 100644 index 00000000..1f1d9ce1 --- /dev/null +++ b/html/search/functions_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_5.js b/html/search/functions_5.js new file mode 100644 index 00000000..ba069d79 --- /dev/null +++ b/html/search/functions_5.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['falselabel',['falseLabel',['../classBoolField.html#a59ad7a8a33290bda0d9fbb3df4f09b01',1,'BoolField']]], + ['field',['Field',['../classField.html#ac4ea0d104376233c3f0bfc080ec8564e',1,'Field::Field(const String &label)'],['../classField.html#a7e2bdb203ddfd9219696f263c1731fe7',1,'Field::Field(Form &form, const String &label)']]], + ['fill',['fill',['../classBitmap.html#a99da820f9280aace6b512801d5a5e2b2',1,'Bitmap::fill(int x, int y, int width, int height, Color color)'],['../classBitmap.html#ac661adab340858b541a2fe44e6303f56',1,'Bitmap::fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)']]], + ['finalize',['finalize',['../classBLAKE2b.html#a0cd8146b7868bd0f4c24a3856f106d17',1,'BLAKE2b::finalize()'],['../classBLAKE2s.html#a751a3d772cbe1cd1dad83dbd09853b1b',1,'BLAKE2s::finalize()'],['../classHash.html#a09b3ccec22763fc86b1415695862977c',1,'Hash::finalize()'],['../classSHA1.html#a5a6a8a6169aa48e0bccadb22a149ab7c',1,'SHA1::finalize()'],['../classSHA256.html#a695157bcdf5495ba892ebac309f3abd6',1,'SHA256::finalize()'],['../classSHA3__256.html#a8fe7cad1f83bd1bae1a0d521324247a1',1,'SHA3_256::finalize()'],['../classSHA3__512.html#ac0227aafb5f047bb50f0bd84df0b4b5b',1,'SHA3_512::finalize()'],['../classSHA512.html#afc136ad0e77de527b031db3fb8b32464',1,'SHA512::finalize()']]], + ['finalizehmac',['finalizeHMAC',['../classBLAKE2b.html#a29fafbba26e3c1d896b4d4c428f7d52a',1,'BLAKE2b::finalizeHMAC()'],['../classBLAKE2s.html#a3f910f3bd48cc4a9c5330c31bcda31fc',1,'BLAKE2s::finalizeHMAC()'],['../classHash.html#aab42fa5420cc0bda4321a3d3866cfd06',1,'Hash::finalizeHMAC()'],['../classSHA1.html#a791db53fe9d6cc0e383b25f1da0a97b8',1,'SHA1::finalizeHMAC()'],['../classSHA256.html#a28bc2510c5bdaf210a012f9f21a753cd',1,'SHA256::finalizeHMAC()'],['../classSHA3__256.html#a001215fa1b7d2c30717b4b5b1618d68c',1,'SHA3_256::finalizeHMAC()'],['../classSHA3__512.html#a25c9d2da26d01d46ba6b72c8a7905ea0',1,'SHA3_512::finalizeHMAC()'],['../classSHA512.html#a1fe9533f0d3dfdb426eb3dc4bdc31904',1,'SHA512::finalizeHMAC()']]], + ['firedalarm',['firedAlarm',['../classDS3231RTC.html#a6a5b3717ff65528de566c021eb821b94',1,'DS3231RTC::firedAlarm()'],['../classDS3232RTC.html#a79649f100a4562b9c1ba7c69e85cbca3',1,'DS3232RTC::firedAlarm()']]], + ['font',['font',['../classBitmap.html#a7bf0a232b4bd12573cc570cc0edef47c',1,'Bitmap']]], + ['form',['Form',['../classForm.html#ad30836b22edde707a52d94090b716996',1,'Form::Form()'],['../classField.html#a27427319be1cc92db3128637d8884ee5',1,'Field::form()']]], + ['formathmackey',['formatHMACKey',['../classHash.html#ab6f40c9af91dc3d738d9fcce59af63cc',1,'Hash']]], + ['fromrgb',['fromRGB',['../classDMD.html#a557412f734fc4596e1102bf71e110ea0',1,'DMD']]] +]; diff --git a/html/search/functions_6.html b/html/search/functions_6.html new file mode 100644 index 00000000..c9faaa6a --- /dev/null +++ b/html/search/functions_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_6.js b/html/search/functions_6.js new file mode 100644 index 00000000..9269d5d2 --- /dev/null +++ b/html/search/functions_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['getbutton',['getButton',['../classLCD.html#ac1e80e2603bd1cf0276c36092c416292',1,'LCD']]] +]; diff --git a/html/search/functions_7.html b/html/search/functions_7.html new file mode 100644 index 00000000..ec330da8 --- /dev/null +++ b/html/search/functions_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_7.js b/html/search/functions_7.js new file mode 100644 index 00000000..c787cdfa --- /dev/null +++ b/html/search/functions_7.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['hash',['Hash',['../classHash.html#af482880ad75b67a09d2dcb5e86244d80',1,'Hash']]], + ['hashcore',['hashCore',['../classChaCha.html#a41ac3262e52ff49dcd916d0b3b2e2038',1,'ChaCha']]], + ['hashsize',['hashSize',['../classBLAKE2b.html#a7555de16f6918ab820170a7ed3098c89',1,'BLAKE2b::hashSize()'],['../classBLAKE2s.html#af9f50aac096f92ba27b1b2dd48df4c52',1,'BLAKE2s::hashSize()'],['../classHash.html#adcdd30de3e5ecaa2f798c0c5644d9ef8',1,'Hash::hashSize()'],['../classSHA1.html#ab8cdb7233a8b81be07877049960ddfdd',1,'SHA1::hashSize()'],['../classSHA256.html#a103d5bc5ced792464a82cb1d7986de94',1,'SHA256::hashSize()'],['../classSHA3__256.html#a2c5c08119d5ad853021f929a763784f3',1,'SHA3_256::hashSize()'],['../classSHA3__512.html#a9f13e4d2b99dd204e96b11142e9c1803',1,'SHA3_512::hashSize()'],['../classSHA512.html#a6ab3cc1e172eecf4796e4cac629e0a44',1,'SHA512::hashSize()']]], + ['hasupdates',['hasUpdates',['../classDS1307RTC.html#a6fec8ff71f33cc1a129eb0bd009600b0',1,'DS1307RTC::hasUpdates()'],['../classDS3231RTC.html#a180bea03bd68df8f696e529cd1582095',1,'DS3231RTC::hasUpdates()'],['../classDS3232RTC.html#a619ffee1bc013c9ddf4ae415115798bc',1,'DS3232RTC::hasUpdates()'],['../classRTC.html#a3690761f29654a2c9e676fcbfa32dd30',1,'RTC::hasUpdates()']]], + ['height',['height',['../classBitmap.html#adcd4e3dc7594421e647b0f52da9a41a3',1,'Bitmap']]], + ['hide',['hide',['../classForm.html#a88b9146a3f68e837c5e831203096f9e9',1,'Form']]], + ['holdtime',['holdTime',['../classCharlieplex.html#abb429659a7b1ee4c7306ea659050cb30',1,'Charlieplex']]] +]; diff --git a/html/search/functions_8.html b/html/search/functions_8.html new file mode 100644 index 00000000..afd4facf --- /dev/null +++ b/html/search/functions_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_8.js b/html/search/functions_8.js new file mode 100644 index 00000000..bdecaceb --- /dev/null +++ b/html/search/functions_8.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['intfield',['IntField',['../classIntField.html#a9df274c4100ed37d2d78738f09fc53b6',1,'IntField::IntField(const String &label)'],['../classIntField.html#a10c9c958bcde276698f1f1f9bff949dd',1,'IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)'],['../classIntField.html#a2b99fa19be6a0ed01ddc4939352b372e',1,'IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)']]], + ['invert',['invert',['../classBitmap.html#a6d85556bcc9fac91d33f0f6f7a6430dd',1,'Bitmap']]], + ['irreceiver',['IRreceiver',['../classIRreceiver.html#a06eccb8b8311eac395e4b20c4e0163e3',1,'IRreceiver']]], + ['iscurrent',['isCurrent',['../classField.html#a25d86a67b321e8c642edf75a10a35f72',1,'Field::isCurrent()'],['../classForm.html#a48fb77f93e77b28b0397b59e1e9bf789',1,'Form::isCurrent()']]], + ['ispaused',['isPaused',['../classBlinkLED.html#aa0ee318b886b84fb71d5831fa456ecc8',1,'BlinkLED']]], + ['isplaying',['isPlaying',['../classMelody.html#ad38db3338ed87d72238c0ea9440c633c',1,'Melody']]], + ['isrealtime',['isRealTime',['../classDS1307RTC.html#aba01ca4c2f7863b610e5dfe9146886bd',1,'DS1307RTC::isRealTime()'],['../classDS3231RTC.html#a2fa6fdd1f9e2b2b99be077c73639dce0',1,'DS3231RTC::isRealTime()'],['../classDS3232RTC.html#acc5908a3743afb4c26bd75e22cad87a4',1,'DS3232RTC::isRealTime()']]], + ['isscreensaved',['isScreenSaved',['../classLCD.html#af5d5ca618a3161aa352027b58fe09d0e',1,'LCD']]], + ['isvalid',['isValid',['../classBitmap.html#a3846a240722e847d3cf11f701da1ce7b',1,'Bitmap']]], + ['isvisible',['isVisible',['../classForm.html#a3101f288e3e5aa8307c57f35861ad587',1,'Form']]], + ['items',['items',['../classListField.html#a4dbbdeebd386551eb8f245b42b45ccf0',1,'ListField']]], + ['ivsize',['ivSize',['../classCBCCommon.html#a016277533730284a38bb6ad8cd6f91ce',1,'CBCCommon::ivSize()'],['../classCFBCommon.html#a55db1be69de87aafe5601d31be918ebb',1,'CFBCommon::ivSize()'],['../classChaCha.html#afaa3df343a7d07976bd7e03a0c1bf43c',1,'ChaCha::ivSize()'],['../classCipher.html#ab8b53ddc4ce431f03c2a1903d70ace9c',1,'Cipher::ivSize()'],['../classCTRCommon.html#a98c1717d11d8da8e1fa108607358774a',1,'CTRCommon::ivSize()'],['../classOFBCommon.html#a67b4639aaece17a796fcba3a2ce8b43c',1,'OFBCommon::ivSize()']]] +]; diff --git a/html/search/functions_9.html b/html/search/functions_9.html new file mode 100644 index 00000000..542b9e0a --- /dev/null +++ b/html/search/functions_9.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_9.js b/html/search/functions_9.js new file mode 100644 index 00000000..5ac1c729 --- /dev/null +++ b/html/search/functions_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['keccakcore',['KeccakCore',['../classKeccakCore.html#a850c8e85bdb6b347411239716535d9c9',1,'KeccakCore']]], + ['keysize',['keySize',['../classAES128.html#aa871832a156f0ea61b964e489670ae9d',1,'AES128::keySize()'],['../classAES192.html#ade28843e51e262b30eb55791c83fd791',1,'AES192::keySize()'],['../classAES256.html#af8ed6412bae6fc78274f60344899366a',1,'AES256::keySize()'],['../classBlockCipher.html#afde6004a859e015d877eab3c37042a0f',1,'BlockCipher::keySize()'],['../classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e',1,'CBCCommon::keySize()'],['../classCFBCommon.html#a82899da983bc70bc8152ee67f424552e',1,'CFBCommon::keySize()'],['../classChaCha.html#af286083291fab2bd36dc7ad1f54d5cd7',1,'ChaCha::keySize()'],['../classCipher.html#a4cea432ea0278c865441f17cbb88b1ab',1,'Cipher::keySize()'],['../classCTRCommon.html#a29ce8e13a302350397fc6790a686bea2',1,'CTRCommon::keySize()'],['../classOFBCommon.html#a76ea9f9ea9dd137778338813e534a8ce',1,'OFBCommon::keySize()']]] +]; diff --git a/html/search/functions_a.html b/html/search/functions_a.html new file mode 100644 index 00000000..94fd395d --- /dev/null +++ b/html/search/functions_a.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_a.js b/html/search/functions_a.js new file mode 100644 index 00000000..9547f241 --- /dev/null +++ b/html/search/functions_a.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['label',['label',['../classField.html#aaa861ef917130c989a955bc75c683afe',1,'Field']]], + ['lcd',['LCD',['../classLCD.html#a00bb2db1390721abc7b24ac4b8c276c8',1,'LCD::LCD()'],['../classLCD.html#a067bc741cf27f143aba5d9f147908401',1,'LCD::LCD(uint8_t pin9)'],['../classLCD.html#a203d268bef6c61fa293562dbb0e9f51e',1,'LCD::LCD(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)'],['../classField.html#a5cf21bf958a71e51feac9e1bf9f599d1',1,'Field::lcd()']]], + ['led',['led',['../classCharlieplex.html#a90fd09f24b62424b0b7b8bcdb0140b9d',1,'Charlieplex']]], + ['listfield',['ListField',['../classListField.html#a118501da7edb0b0bc6b493734975b4e9',1,'ListField::ListField(const String &label)'],['../classListField.html#aa303898a1f74b52c1c4982653de488b7',1,'ListField::ListField(Form &form, const String &label, ListItems items, int value=0)']]], + ['loop',['loop',['../classBlinkLED.html#aeeaf42b94c5392935f00f0f12a58c75e',1,'BlinkLED::loop()'],['../classCharlieplex.html#a8313edeacd8387c428b8299d52584d6a',1,'Charlieplex::loop()'],['../classChaseLEDs.html#a8745fa6b9f33b6c6274a563dd4dea786',1,'ChaseLEDs::loop()'],['../classDMD.html#a2c74a0845ef6080056b972d490648114',1,'DMD::loop()'],['../classRNGClass.html#a8cb91e39f0c4591de5bf98b1e2880b13',1,'RNGClass::loop()']]], + ['loopcount',['loopCount',['../classMelody.html#ab78253ae9abc8478b05f415f5d878a60',1,'Melody']]] +]; diff --git a/html/search/functions_b.html b/html/search/functions_b.html new file mode 100644 index 00000000..1a03617d --- /dev/null +++ b/html/search/functions_b.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_b.js b/html/search/functions_b.js new file mode 100644 index 00000000..797abeb7 --- /dev/null +++ b/html/search/functions_b.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['maxhours',['maxHours',['../classTimeField.html#aa73f5a62c330ac7d2f647dfe27d026b7',1,'TimeField']]], + ['maxtransfersize',['maxTransferSize',['../classI2CMaster.html#a3cd0cea8169ac4e6dd6f39fd6cfb1926',1,'I2CMaster::maxTransferSize()'],['../classSoftI2C.html#aad488669f28f6a5a4ceaae3de61d38f4',1,'SoftI2C::maxTransferSize()']]], + ['maxvalue',['maxValue',['../classIntField.html#aaa0adcb0d16e822e5f176be5cb9ca8ad',1,'IntField']]], + ['melody',['Melody',['../classMelody.html#a9edc4165a49368dd5d78eedf982c38b9',1,'Melody']]], + ['minvalue',['minValue',['../classIntField.html#af3dab3f2b46d29136d7a93ce46b0b8fb',1,'IntField']]] +]; diff --git a/html/search/functions_c.html b/html/search/functions_c.html new file mode 100644 index 00000000..a6536e94 --- /dev/null +++ b/html/search/functions_c.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_c.js b/html/search/functions_c.js new file mode 100644 index 00000000..ba3908ff --- /dev/null +++ b/html/search/functions_c.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['nextfield',['nextField',['../classForm.html#a788a186ea4a7ebd75283a948ca45f4d1',1,'Form']]], + ['nodisplay',['noDisplay',['../classLCD.html#af3974da6d988ba2d21c25135ada12108',1,'LCD']]], + ['noisesource',['NoiseSource',['../classNoiseSource.html#a601479b7d8cc215f97f2f8a18d3ef4c2',1,'NoiseSource']]], + ['numrounds',['numRounds',['../classChaCha.html#a0a73d3623da377bc593876156768dd72',1,'ChaCha']]] +]; diff --git a/html/search/functions_d.html b/html/search/functions_d.html new file mode 100644 index 00000000..8cdcc06f --- /dev/null +++ b/html/search/functions_d.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_d.js b/html/search/functions_d.js new file mode 100644 index 00000000..714f5915 --- /dev/null +++ b/html/search/functions_d.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['ofb',['OFB',['../classOFB.html#a0b71b5cbcf01254799cd5eb37074a8cb',1,'OFB']]], + ['ofbcommon',['OFBCommon',['../classOFBCommon.html#a7f7e0cffcd7e2d7e06b7b1ae978a8f7d',1,'OFBCommon']]], + ['offtime',['offTime',['../classBlinkLED.html#a74c640edf1a9f6e8bea1e139462908bc',1,'BlinkLED']]], + ['ontime',['onTime',['../classBlinkLED.html#a8475f78f41d1a2d5d719bec8cbbb3ebb',1,'BlinkLED']]], + ['output',['output',['../classNoiseSource.html#a1af7449a5ae4a8acd34ac218c9eec6c1',1,'NoiseSource']]] +]; diff --git a/html/search/functions_e.html b/html/search/functions_e.html new file mode 100644 index 00000000..649b2c9a --- /dev/null +++ b/html/search/functions_e.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_e.js b/html/search/functions_e.js new file mode 100644 index 00000000..dfb73127 --- /dev/null +++ b/html/search/functions_e.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['pad',['pad',['../classKeccakCore.html#a97852ee4381ced17ee6d21704cf0b4d7',1,'KeccakCore']]], + ['pagesize',['pageSize',['../classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a',1,'EEPROM24']]], + ['pause',['pause',['../classBlinkLED.html#a2760a0223cd6a0598b961f681ffb5c0a',1,'BlinkLED']]], + ['pixel',['pixel',['../classBitmap.html#a35aa38b377d509d6c4f061a0b988d203',1,'Bitmap']]], + ['play',['play',['../classMelody.html#a9fd8e0d48833d8da3cd3b3b58408b0b5',1,'Melody']]], + ['playonce',['playOnce',['../classMelody.html#aecc9185c9cb1246e8a55521b17d72932',1,'Melody']]], + ['prevfield',['prevField',['../classForm.html#acb080fe4f4631e9060e6efab8eaa0a90',1,'Form']]], + ['previouspin',['previousPin',['../classChaseLEDs.html#a27c460fcb341c2dc2fcf9341616eb525',1,'ChaseLEDs']]], + ['pwmled',['pwmLed',['../classCharlieplex.html#a89312f2fd1d27c4e56346ed9cccfb9f6',1,'Charlieplex']]] +]; diff --git a/html/search/functions_f.html b/html/search/functions_f.html new file mode 100644 index 00000000..386c7d46 --- /dev/null +++ b/html/search/functions_f.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/functions_f.js b/html/search/functions_f.js new file mode 100644 index 00000000..544be023 --- /dev/null +++ b/html/search/functions_f.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['rand',['rand',['../classRNGClass.html#a418a833cf18198fd7e5d6dbd78c99c29',1,'RNGClass']]], + ['read',['read',['../classEEPROM24.html#a960971377d4decb122ff38d12603e586',1,'EEPROM24::read(unsigned long address)'],['../classEEPROM24.html#a63e23dc014415f947975359ac09f627e',1,'EEPROM24::read(unsigned long address, void *data, size_t length)'],['../classI2CMaster.html#a49eeebb57f6bc06de39973fe836369cd',1,'I2CMaster::read()'],['../classSoftI2C.html#a330dbba5b726fa161a6b01a9ca49e1bc',1,'SoftI2C::read()']]], + ['readalarm',['readAlarm',['../classDS1307RTC.html#aab608eb1630520ee122306b721fdc47a',1,'DS1307RTC::readAlarm()'],['../classDS3231RTC.html#aab56929e759a49a90785729cceb72f2e',1,'DS3231RTC::readAlarm()'],['../classDS3232RTC.html#a09c7073c687dcbbc423baf48074c7873',1,'DS3232RTC::readAlarm()'],['../classRTC.html#ade282d7a60147c3f0269f1fcd59c8d66',1,'RTC::readAlarm()']]], + ['readbyte',['readByte',['../classDS1307RTC.html#a7364609a201022688778ab116c3e4f4a',1,'DS1307RTC::readByte()'],['../classDS3232RTC.html#a5ba83a3ef7d65d45c2f3241afdd8fef7',1,'DS3232RTC::readByte()'],['../classRTC.html#a0f47b10b436e3f9d36e04ec907579431',1,'RTC::readByte()']]], + ['readdate',['readDate',['../classDS1307RTC.html#a6fb56d1690bc30e7995961a5b5e5fdc4',1,'DS1307RTC::readDate()'],['../classDS3231RTC.html#a498a1a37b78993ab52780198c5b4a9df',1,'DS3231RTC::readDate()'],['../classDS3232RTC.html#ab03358e3b5996e38d766e2f9f6ab62ca',1,'DS3232RTC::readDate()'],['../classRTC.html#aa1e21bf42ebd4456919744ae0f4f631e',1,'RTC::readDate()']]], + ['readonly',['readOnly',['../classTimeField.html#aa0795c873ba9941c8a1a3bf8c06668f1',1,'TimeField']]], + ['readtemperature',['readTemperature',['../classDS3231RTC.html#ad1dcb7897fd14ae745720a19fbe71e37',1,'DS3231RTC::readTemperature()'],['../classDS3232RTC.html#a0faf40c25ab019a326a60f301c2bb41b',1,'DS3232RTC::readTemperature()'],['../classRTC.html#aeca3c8387332e8cabfd09c1806276e5a',1,'RTC::readTemperature()']]], + ['readtime',['readTime',['../classDS1307RTC.html#acd9800d6df2244b8e4e790480a1d62a6',1,'DS1307RTC::readTime()'],['../classDS3231RTC.html#a3a2c448b152c401fb598c487ef0ed288',1,'DS3231RTC::readTime()'],['../classDS3232RTC.html#af89e68c68f1c4b7e94286f800b5b2747',1,'DS3232RTC::readTime()'],['../classRTC.html#aaf0a5c1f32f210a49718d148620b5bec',1,'RTC::readTime()']]], + ['refresh',['refresh',['../classCharlieplex.html#a3c961bfff866e400dad371f0376f096b',1,'Charlieplex::refresh()'],['../classDMD.html#a9e4bf2a9d247312d35c1401ff61261c8',1,'DMD::refresh()']]], + ['removefield',['removeField',['../classForm.html#a7abd717029f9b19ee7318470072cd697',1,'Form']]], + ['reset',['reset',['../classBLAKE2b.html#a917beae2ca6e9831a35717a526089e8a',1,'BLAKE2b::reset()'],['../classBLAKE2b.html#a9afd8ec05ccfa08a922de74461e45387',1,'BLAKE2b::reset(uint8_t outputLength)'],['../classBLAKE2s.html#a778776d15316c182fdb2df5a89b3ca02',1,'BLAKE2s::reset()'],['../classBLAKE2s.html#a91ba6bc39e42002ac61114ced1d0af6d',1,'BLAKE2s::reset(uint8_t outputLength)'],['../classHash.html#a7b94309acaa5f52386785fb780e5be61',1,'Hash::reset()'],['../classKeccakCore.html#a5a322eb7e3b5c1eaad127c9c6e6a529b',1,'KeccakCore::reset()'],['../classSHA1.html#ab71aaf39ed956320054861a2fbfa454f',1,'SHA1::reset()'],['../classSHA256.html#ad9d80d8fdccffb15497bd36285afce65',1,'SHA256::reset()'],['../classSHA3__256.html#a57b5f29347a733e04fe47d60621f3202',1,'SHA3_256::reset()'],['../classSHA3__512.html#a435746d5a8b012f7c65050337cc4a23f',1,'SHA3_512::reset()'],['../classSHA512.html#a0d009e8d9157c3f14323e68631c33e97',1,'SHA512::reset()']]], + ['resethmac',['resetHMAC',['../classBLAKE2b.html#acb1ca4081c509d1c34b3aee465cd4494',1,'BLAKE2b::resetHMAC()'],['../classBLAKE2s.html#a7f9745854704b34a508497105ca5e2fd',1,'BLAKE2s::resetHMAC()'],['../classHash.html#adf50359c1f525af884721cc9034e7945',1,'Hash::resetHMAC()'],['../classSHA1.html#ad0a09a5100d59ff90c04ed5d4071b606',1,'SHA1::resetHMAC()'],['../classSHA256.html#a2271683d6f1c7c103272f1dec55a6871',1,'SHA256::resetHMAC()'],['../classSHA3__256.html#a324fe4d268bbf23d7b492033fe3bc632',1,'SHA3_256::resetHMAC()'],['../classSHA3__512.html#aac7133f420f2be0288965c2e863f389b',1,'SHA3_512::resetHMAC()'],['../classSHA512.html#a2427ad8bf8b6958df91bd5806986167c',1,'SHA512::resetHMAC()']]], + ['resume',['resume',['../classBlinkLED.html#a380241e4dfd20e8a558487227f2f4252',1,'BlinkLED']]], + ['rngclass',['RNGClass',['../classRNGClass.html#acbcf327242f51ae2d9209aeaa45e30e9',1,'RNGClass']]], + ['rtc',['RTC',['../classRTC.html#ada31c5120d18d2dd2863b3d440308da2',1,'RTC']]], + ['run',['run',['../classMelody.html#ad1103b970be1f59058cc7d927be68955',1,'Melody']]] +]; diff --git a/html/search/groups_0.html b/html/search/groups_0.html new file mode 100644 index 00000000..2090afa2 --- /dev/null +++ b/html/search/groups_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/groups_0.js b/html/search/groups_0.js new file mode 100644 index 00000000..ba9cdad3 --- /dev/null +++ b/html/search/groups_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['power_20saving_20utility_20functions',['Power saving utility functions',['../group__power__save.html',1,'']]] +]; diff --git a/html/search/mag_sel.png b/html/search/mag_sel.png new file mode 100644 index 00000000..81f6040a Binary files /dev/null and b/html/search/mag_sel.png differ diff --git a/html/search/nomatches.html b/html/search/nomatches.html new file mode 100644 index 00000000..b1ded27e --- /dev/null +++ b/html/search/nomatches.html @@ -0,0 +1,12 @@ + + + + + + + +
+
No Matches
+
+ + diff --git a/html/search/pages_0.html b/html/search/pages_0.html new file mode 100644 index 00000000..c51c8345 --- /dev/null +++ b/html/search/pages_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_0.js b/html/search/pages_0.js new file mode 100644 index 00000000..0a4d8fa1 --- /dev/null +++ b/html/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['alarm_20clock',['Alarm Clock',['../alarm_clock.html',1,'']]] +]; diff --git a/html/search/pages_1.html b/html/search/pages_1.html new file mode 100644 index 00000000..2a98fce1 --- /dev/null +++ b/html/search/pages_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_1.js b/html/search/pages_1.js new file mode 100644 index 00000000..f952a477 --- /dev/null +++ b/html/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['blinking_20led_20example',['Blinking LED Example',['../blink_blink.html',1,'']]] +]; diff --git a/html/search/pages_2.html b/html/search/pages_2.html new file mode 100644 index 00000000..0711a0b4 --- /dev/null +++ b/html/search/pages_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_2.js b/html/search/pages_2.js new file mode 100644 index 00000000..917aadd3 --- /dev/null +++ b/html/search/pages_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['charlieplexing_20example',['Charlieplexing Example',['../blink_charlieplex.html',1,'']]], + ['cylon_20eyes_20example',['Cylon Eyes Example',['../blink_cylon.html',1,'']]], + ['cryptographic_20library',['Cryptographic Library',['../crypto.html',1,'']]] +]; diff --git a/html/search/pages_3.html b/html/search/pages_3.html new file mode 100644 index 00000000..4310311a --- /dev/null +++ b/html/search/pages_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_3.js b/html/search/pages_3.js new file mode 100644 index 00000000..5c3709d4 --- /dev/null +++ b/html/search/pages_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dot_20matrix_20display_20demo',['Dot Matrix Display Demo',['../dmd_demo.html',1,'']]], + ['dumping_20infrared_20remote_20control_20codes',['Dumping Infrared Remote Control Codes',['../ir_dumpir.html',1,'']]] +]; diff --git a/html/search/pages_4.html b/html/search/pages_4.html new file mode 100644 index 00000000..ae5ce181 --- /dev/null +++ b/html/search/pages_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_4.js b/html/search/pages_4.js new file mode 100644 index 00000000..e10a92e8 --- /dev/null +++ b/html/search/pages_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['form_20example_20for_20lcd_20displays',['Form example for LCD displays',['../lcd_form.html',1,'']]] +]; diff --git a/html/search/pages_5.html b/html/search/pages_5.html new file mode 100644 index 00000000..02c11148 --- /dev/null +++ b/html/search/pages_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_5.js b/html/search/pages_5.js new file mode 100644 index 00000000..cb0bf87b --- /dev/null +++ b/html/search/pages_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['generating_20random_20numbers',['Generating random numbers',['../crypto_rng.html',1,'']]] +]; diff --git a/html/search/pages_6.html b/html/search/pages_6.html new file mode 100644 index 00000000..afb70afd --- /dev/null +++ b/html/search/pages_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_6.js b/html/search/pages_6.js new file mode 100644 index 00000000..31dd37a2 --- /dev/null +++ b/html/search/pages_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hello_20world_20for_20freetronics_20lcd',['Hello World for Freetronics LCD',['../lcd_hello_world.html',1,'']]] +]; diff --git a/html/search/pages_7.html b/html/search/pages_7.html new file mode 100644 index 00000000..9d7ba25f --- /dev/null +++ b/html/search/pages_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_7.js b/html/search/pages_7.js new file mode 100644 index 00000000..da2a2f59 --- /dev/null +++ b/html/search/pages_7.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ring_20oscillator_20noise_20sources',['Ring Oscillator Noise Sources',['../crypto_rng_ring.html',1,'']]], + ['running_20figure_20example',['Running figure example',['../dmd_running_figure.html',1,'']]] +]; diff --git a/html/search/pages_8.html b/html/search/pages_8.html new file mode 100644 index 00000000..33778878 --- /dev/null +++ b/html/search/pages_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/pages_8.js b/html/search/pages_8.js new file mode 100644 index 00000000..c70dda2c --- /dev/null +++ b/html/search/pages_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['star_20trek_20example',['Star Trek Example',['../blink_startrek.html',1,'']]], + ['snake_20video_20game_20using_20an_20infrared_20remote_20control',['Snake Video Game Using an Infrared Remote Control',['../ir_snake.html',1,'']]] +]; diff --git a/html/search/search.css b/html/search/search.css new file mode 100644 index 00000000..4d7612ff --- /dev/null +++ b/html/search/search.css @@ -0,0 +1,271 @@ +/*---------------- Search Box */ + +#FSearchBox { + float: left; +} + +#MSearchBox { + white-space : nowrap; + position: absolute; + float: none; + display: inline; + margin-top: 8px; + right: 0px; + width: 170px; + z-index: 102; + background-color: white; +} + +#MSearchBox .left +{ + display:block; + position:absolute; + left:10px; + width:20px; + height:19px; + background:url('search_l.png') no-repeat; + background-position:right; +} + +#MSearchSelect { + display:block; + position:absolute; + width:20px; + height:19px; +} + +.left #MSearchSelect { + left:4px; +} + +.right #MSearchSelect { + right:5px; +} + +#MSearchField { + display:block; + position:absolute; + height:19px; + background:url('search_m.png') repeat-x; + border:none; + width:111px; + margin-left:20px; + padding-left:4px; + color: #909090; + outline: none; + font: 9pt Arial, Verdana, sans-serif; +} + +#FSearchBox #MSearchField { + margin-left:15px; +} + +#MSearchBox .right { + display:block; + position:absolute; + right:10px; + top:0px; + width:20px; + height:19px; + background:url('search_r.png') no-repeat; + background-position:left; +} + +#MSearchClose { + display: none; + position: absolute; + top: 4px; + background : none; + border: none; + margin: 0px 4px 0px 0px; + padding: 0px 0px; + outline: none; +} + +.left #MSearchClose { + left: 6px; +} + +.right #MSearchClose { + right: 2px; +} + +.MSearchBoxActive #MSearchField { + color: #000000; +} + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #90A5CE; + background-color: #F9FAFC; + z-index: 1; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial, Verdana, sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: monospace; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: #000000; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: #000000; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: #FFFFFF; + background-color: #3D578C; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + width: 60ex; + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #000; + background-color: #EEF1F7; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; + padding-bottom: 15px; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +body.SRPage { + margin: 5px 2px; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #425E97; + font-family: Arial, Verdana, sans-serif; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; +} + +.SRResult { + display: none; +} + +DIV.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.searchresult { + background-color: #F0F3F8; +} + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/html/search/search.js b/html/search/search.js new file mode 100644 index 00000000..f7d9cd4c --- /dev/null +++ b/html/search/search.js @@ -0,0 +1,811 @@ +// Search script generated by doxygen +// Copyright (C) 2009 by Dimitri van Heesch. + +// The code in this file is loosly based on main.js, part of Natural Docs, +// which is Copyright (C) 2003-2008 Greg Valure +// Natural Docs is licensed under the GPL. + +var indexSectionsWithContent = +{ + 0: "abcdefghiklmnoprstuvwy~", + 1: "abcdefhiklmnorst", + 2: "abcdilm", + 3: "abcdefghiklmnoprstuvw~", + 4: "abdfhimnswy", + 5: "cfp", + 6: "ds", + 7: "bds", + 8: "p", + 9: "abcdfghrs" +}; + +var indexSectionNames = +{ + 0: "all", + 1: "classes", + 2: "files", + 3: "functions", + 4: "variables", + 5: "typedefs", + 6: "enums", + 7: "enumvalues", + 8: "groups", + 9: "pages" +}; + +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var resultsPage; + var resultsPageWithSearch; + var hasResultsPage; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; + resultsPageWithSearch = resultsPage+'?'+escape(searchValue); + hasResultsPage = true; + } + else // nothing available for this search term + { + resultsPage = this.resultsPath + '/nomatches.html'; + resultsPageWithSearch = resultsPage; + hasResultsPage = false; + } + + window.frames.MSearchResults.location = resultsPageWithSearch; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + + if (domPopupSearchResultsWindow.style.display!='block') + { + var domSearchBox = this.DOMSearchBox(); + this.DOMSearchClose().style.display = 'inline'; + if (this.insideFrame) + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + domPopupSearchResultsWindow.style.position = 'relative'; + domPopupSearchResultsWindow.style.display = 'block'; + var width = document.body.clientWidth - 8; // the -8 is for IE :-( + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResults.style.width = width + 'px'; + } + else + { + var domPopupSearchResults = this.DOMPopupSearchResults(); + var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; + var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + } + } + + this.lastSearchValue = searchValue; + this.lastResultsPage = resultsPage; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + + var searchField = this.DOMSearchField(); + + if (searchField.value == this.searchLabel) // clear "Search" term upon entry + { + searchField.value = ''; + this.searchActive = true; + } + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.DOMSearchField().value = this.searchLabel; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName == 'DIV' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName == 'DIV' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + parent.document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + parent.searchBox.CloseResultsWindow(); + parent.document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/typedefs_0.js b/html/search/typedefs_0.js new file mode 100644 index 00000000..32f26340 --- /dev/null +++ b/html/search/typedefs_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['color',['Color',['../classBitmap.html#a88d386944a7017aa776a177b10d8b2ba',1,'Bitmap']]] +]; diff --git a/html/search/typedefs_1.html b/html/search/typedefs_1.html new file mode 100644 index 00000000..455fe2b2 --- /dev/null +++ b/html/search/typedefs_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/typedefs_1.js b/html/search/typedefs_1.js new file mode 100644 index 00000000..58dd39bd --- /dev/null +++ b/html/search/typedefs_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['font',['Font',['../classBitmap.html#a456f7d6da03189c1e7148563a891b3cf',1,'Bitmap']]] +]; diff --git a/html/search/typedefs_2.html b/html/search/typedefs_2.html new file mode 100644 index 00000000..fac5dbac --- /dev/null +++ b/html/search/typedefs_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/typedefs_2.js b/html/search/typedefs_2.js new file mode 100644 index 00000000..e0c3fb61 --- /dev/null +++ b/html/search/typedefs_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['progmem',['ProgMem',['../classBitmap.html#a2fcc98fd7580932b218134126a29ce43',1,'Bitmap']]] +]; diff --git a/html/search/variables_0.html b/html/search/variables_0.html new file mode 100644 index 00000000..1b8adc9b --- /dev/null +++ b/html/search/variables_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_0.js b/html/search/variables_0.js new file mode 100644 index 00000000..5bfa9056 --- /dev/null +++ b/html/search/variables_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['alarm_5fcount',['ALARM_COUNT',['../classRTC.html#aee5ae8f600ee5296e65635c0d836fca3',1,'RTC']]], + ['auto_5frepeat',['AUTO_REPEAT',['../classIRreceiver.html#a9c37631cc1291dc47cabcfef2f631cf9',1,'IRreceiver']]] +]; diff --git a/html/search/variables_1.html b/html/search/variables_1.html new file mode 100644 index 00000000..78f63cd1 --- /dev/null +++ b/html/search/variables_1.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_1.js b/html/search/variables_1.js new file mode 100644 index 00000000..36e542f3 --- /dev/null +++ b/html/search/variables_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['black',['Black',['../classBitmap.html#a2c7faeeb89d3624b5bbca58871785adc',1,'Bitmap']]] +]; diff --git a/html/search/variables_2.html b/html/search/variables_2.html new file mode 100644 index 00000000..ea80d201 --- /dev/null +++ b/html/search/variables_2.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_2.js b/html/search/variables_2.js new file mode 100644 index 00000000..bb9c2e84 --- /dev/null +++ b/html/search/variables_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['day',['day',['../structRTCDate.html#a2d68ff3fb90240df522b41222362704c',1,'RTCDate::day()'],['../structRTCAlarm.html#a9cbc0c2bd8cee02917539af77e845fc4',1,'RTCAlarm::day()']]], + ['decrement',['DECREMENT',['../classRTC.html#a05b1bd1479afc80682abdd4f3e58dc6f',1,'RTC']]], + ['dow',['dow',['../structRTCAlarm.html#a764061bcf84755b4b9db07dead0d46b9',1,'RTCAlarm']]] +]; diff --git a/html/search/variables_3.html b/html/search/variables_3.html new file mode 100644 index 00000000..0dca26f4 --- /dev/null +++ b/html/search/variables_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_3.js b/html/search/variables_3.js new file mode 100644 index 00000000..91827dd7 --- /dev/null +++ b/html/search/variables_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['flags',['flags',['../structRTCAlarm.html#a0f2ef7363cb60a26642d5295b77ca19e',1,'RTCAlarm']]] +]; diff --git a/html/search/variables_4.html b/html/search/variables_4.html new file mode 100644 index 00000000..400e8e9b --- /dev/null +++ b/html/search/variables_4.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_4.js b/html/search/variables_4.js new file mode 100644 index 00000000..5a04152a --- /dev/null +++ b/html/search/variables_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hour',['hour',['../structRTCTime.html#a98ba717092ef856dd2b773ba02fcb1a4',1,'RTCTime::hour()'],['../structRTCAlarm.html#a75bdc42acd3ab3ad495680c6b6a34692',1,'RTCAlarm::hour()']]] +]; diff --git a/html/search/variables_5.html b/html/search/variables_5.html new file mode 100644 index 00000000..7f1241f9 --- /dev/null +++ b/html/search/variables_5.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_5.js b/html/search/variables_5.js new file mode 100644 index 00000000..c655f03c --- /dev/null +++ b/html/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['increment',['INCREMENT',['../classRTC.html#aacbe3ebbf893685950b05327c11d5c37',1,'RTC']]] +]; diff --git a/html/search/variables_6.html b/html/search/variables_6.html new file mode 100644 index 00000000..7536df8d --- /dev/null +++ b/html/search/variables_6.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_6.js b/html/search/variables_6.js new file mode 100644 index 00000000..68579f17 --- /dev/null +++ b/html/search/variables_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['minute',['minute',['../structRTCTime.html#acf2161ca037080dc4b767e636ad8db84',1,'RTCTime::minute()'],['../structRTCAlarm.html#ad9a75ceb4b4b3474baa66dd5466e62fe',1,'RTCAlarm::minute()']]], + ['month',['month',['../structRTCDate.html#a6e6196059b36186041a5312400ea9202',1,'RTCDate']]] +]; diff --git a/html/search/variables_7.html b/html/search/variables_7.html new file mode 100644 index 00000000..66186a69 --- /dev/null +++ b/html/search/variables_7.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_7.js b/html/search/variables_7.js new file mode 100644 index 00000000..6ec22ad2 --- /dev/null +++ b/html/search/variables_7.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['no_5ftemperature',['NO_TEMPERATURE',['../classRTC.html#a9ed5480b362a83f1f45c4d3bcf7c3bf8',1,'RTC']]], + ['nofill',['NoFill',['../classBitmap.html#aa89170263dc1f51f6366c1907119715e',1,'Bitmap']]] +]; diff --git a/html/search/variables_8.html b/html/search/variables_8.html new file mode 100644 index 00000000..aa13bf24 --- /dev/null +++ b/html/search/variables_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_8.js b/html/search/variables_8.js new file mode 100644 index 00000000..213dd3ed --- /dev/null +++ b/html/search/variables_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['second',['second',['../structRTCTime.html#a87b7c02e535d808dcba04c77e34abb91',1,'RTCTime::second()'],['../structRTCAlarm.html#ab749e3695ee5c5dd703aec71f72d46a1',1,'RTCAlarm::second()']]], + ['seed_5fsize',['SEED_SIZE',['../classRNGClass.html#ae3a013bfc73795fd26ee36e70d89f4c2',1,'RNGClass']]] +]; diff --git a/html/search/variables_9.html b/html/search/variables_9.html new file mode 100644 index 00000000..78cc249f --- /dev/null +++ b/html/search/variables_9.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_9.js b/html/search/variables_9.js new file mode 100644 index 00000000..5423c8ca --- /dev/null +++ b/html/search/variables_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['white',['White',['../classBitmap.html#a39b6754cfe50a457bbfdb1980fd87eb7',1,'Bitmap']]], + ['wrap',['WRAP',['../classRTC.html#a02ace2d775063be9a99035851c9274eb',1,'RTC']]] +]; diff --git a/html/search/variables_a.html b/html/search/variables_a.html new file mode 100644 index 00000000..592abaa3 --- /dev/null +++ b/html/search/variables_a.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/html/search/variables_a.js b/html/search/variables_a.js new file mode 100644 index 00000000..d4472111 --- /dev/null +++ b/html/search/variables_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['year',['year',['../structRTCDate.html#a7d31822daff3c3fc947386abd897732f',1,'RTCDate']]] +]; diff --git a/html/structRTCAlarm.html b/html/structRTCAlarm.html new file mode 100644 index 00000000..0e6c08c5 --- /dev/null +++ b/html/structRTCAlarm.html @@ -0,0 +1,208 @@ + + + + + + +ArduinoLibs: RTCAlarm Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+ +
+
RTCAlarm Class Reference
+
+
+ +

Stores alarm information from a realtime clock chip. + More...

+ +

#include <RTC.h>

+ + + + + + + + + + + + + + + + + + + + +

+Public Attributes

uint8_t day
 Day of the month for the alarm if not zero. More...
 
uint8_t dow
 Day of the week for the alarm if not zero. More...
 
+uint8_t hour
 Hour of the day for the alarm (0-23).
 
+uint8_t minute
 Minute of the hour for the alarm (0-59).
 
uint8_t second
 Second of the minute for the alarm (0-59). More...
 
uint8_t flags
 Additional flags for the alarm. More...
 
+

Detailed Description

+

Stores alarm information from a realtime clock chip.

+
See Also
RTCTime, RTCDate, RTC
+ +

Definition at line 42 of file RTC.h.

+

Member Data Documentation

+ +
+
+ + + + +
RTCAlarm::day
+
+ +

Day of the month for the alarm if not zero.

+
Note
Currently this field only works with the DS3231RTC class.
+ +

Definition at line 44 of file RTC.h.

+ +
+
+ +
+
+ + + + +
RTCAlarm::dow
+
+ +

Day of the week for the alarm if not zero.

+
Note
Currently this field only works with the DS3231RTC class.
+ +

Definition at line 45 of file RTC.h.

+ +
+
+ +
+
+ + + + +
RTCAlarm::flags
+
+ +

Additional flags for the alarm.

+

The least significant bit will be 0 if the alarm is disabled or 1 if the alarm is enabled. Other bits can be used by the application for any purpose.

+ +

Definition at line 49 of file RTC.h.

+ +
+
+ +
+
+ + + + +
RTCAlarm::second
+
+ +

Second of the minute for the alarm (0-59).

+
Note
Currently this field only works with the DS3231RTC class.
+ +

Definition at line 48 of file RTC.h.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/structRTCDate.html b/html/structRTCDate.html new file mode 100644 index 00000000..d3bcd4d5 --- /dev/null +++ b/html/structRTCDate.html @@ -0,0 +1,131 @@ + + + + + + +ArduinoLibs: RTCDate Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+ +
+
RTCDate Class Reference
+
+
+ +

Stores date information from a realtime clock chip. + More...

+ +

#include <RTC.h>

+ + + + + + + + + + + +

+Public Attributes

+unsigned int year
 Year (4-digit)
 
+uint8_t month
 Month of the year (1-12)
 
+uint8_t day
 Day of the month (1-31)
 
+

Detailed Description

+

Stores date information from a realtime clock chip.

+
See Also
RTCTime, RTCAlarm, RTC
+ +

Definition at line 35 of file RTC.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/structRTCTime.html b/html/structRTCTime.html new file mode 100644 index 00000000..94218e81 --- /dev/null +++ b/html/structRTCTime.html @@ -0,0 +1,131 @@ + + + + + + +ArduinoLibs: RTCTime Class Reference + + + + + + + + + +
+
+ + + + + + +
+
ArduinoLibs +
+
+
+ + + + + + + + + +
+ +
+ +
+
+ +
+
RTCTime Class Reference
+
+
+ +

Stores time information from a realtime clock chip. + More...

+ +

#include <RTC.h>

+ + + + + + + + + + + +

+Public Attributes

+uint8_t hour
 Hour of the day (0-23)
 
+uint8_t minute
 Minute within the hour (0-59)
 
+uint8_t second
 Second within the minute (0-59)
 
+

Detailed Description

+

Stores time information from a realtime clock chip.

+
See Also
RTCDate, RTCAlarm, RTC
+ +

Definition at line 28 of file RTC.h.

+

The documentation for this class was generated from the following files: +
+ + + + diff --git a/html/sync_off.png b/html/sync_off.png new file mode 100644 index 00000000..3b443fc6 Binary files /dev/null and b/html/sync_off.png differ diff --git a/html/sync_on.png b/html/sync_on.png new file mode 100644 index 00000000..e08320fb Binary files /dev/null and b/html/sync_on.png differ diff --git a/html/tab_a.png b/html/tab_a.png new file mode 100644 index 00000000..3b725c41 Binary files /dev/null and b/html/tab_a.png differ diff --git a/html/tab_b.png b/html/tab_b.png new file mode 100644 index 00000000..e2b4a863 Binary files /dev/null and b/html/tab_b.png differ diff --git a/html/tab_h.png b/html/tab_h.png new file mode 100644 index 00000000..fd5cb705 Binary files /dev/null and b/html/tab_h.png differ diff --git a/html/tab_s.png b/html/tab_s.png new file mode 100644 index 00000000..ab478c95 Binary files /dev/null and b/html/tab_s.png differ diff --git a/html/tabs.css b/html/tabs.css new file mode 100644 index 00000000..9cf578f2 --- /dev/null +++ b/html/tabs.css @@ -0,0 +1,60 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/html/transistor_noise_source.png b/html/transistor_noise_source.png new file mode 100644 index 00000000..7356074a Binary files /dev/null and b/html/transistor_noise_source.png differ