MySensors Library & Examples  2.3.2-62-ge298769
MyEepromAddresses.h
Go to the documentation of this file.
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2022 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
19 
31 #ifndef MyEepromAddresses_h
32 #define MyEepromAddresses_h
33 
34 // EEPROM variable sizes, in bytes
35 #define SIZE_NODE_ID (1u)
36 #define SIZE_PARENT_NODE_ID (1u)
37 #define SIZE_DISTANCE (1u)
38 #ifdef MY_ROUTES_SIZE
39 #define SIZE_ROUTES (MY_ROUTES_SIZE)
40 #else
41 #define SIZE_ROUTES (256u)
42 #endif
43 #define SIZE_CONTROLLER_CONFIG (23u)
44 #define SIZE_PERSONALIZATION_CHECKSUM (1u)
45 #define SIZE_FIRMWARE_TYPE (2u)
46 #define SIZE_FIRMWARE_VERSION (2u)
47 #define SIZE_FIRMWARE_BLOCKS (2u)
48 #define SIZE_FIRMWARE_CRC (2u)
49 #define SIZE_SIGNING_REQUIREMENT_TABLE (32u)
50 #define SIZE_WHITELIST_REQUIREMENT_TABLE (32u)
51 #define SIZE_SIGNING_SOFT_HMAC_KEY (32u)
52 #define SIZE_SIGNING_SOFT_SERIAL (9u)
53 #define SIZE_RF_ENCRYPTION_AES_KEY (16u)
54 #define SIZE_NODE_LOCK_COUNTER (1u)
55 
56 
58 #define EEPROM_START (0u)
59 
60 #define EEPROM_NODE_ID_ADDRESS EEPROM_START
61 
62 #define EEPROM_PARENT_NODE_ID_ADDRESS (EEPROM_NODE_ID_ADDRESS + SIZE_NODE_ID)
63 
64 #define EEPROM_DISTANCE_ADDRESS (EEPROM_PARENT_NODE_ID_ADDRESS + SIZE_PARENT_NODE_ID)
65 
66 #define EEPROM_ROUTES_ADDRESS (EEPROM_DISTANCE_ADDRESS + SIZE_DISTANCE)
67 
68 #define EEPROM_CONTROLLER_CONFIG_ADDRESS (EEPROM_ROUTES_ADDRESS + SIZE_ROUTES)
69 
70 #define EEPROM_PERSONALIZATION_CHECKSUM_ADDRESS (EEPROM_CONTROLLER_CONFIG_ADDRESS + SIZE_CONTROLLER_CONFIG)
71 
72 #define EEPROM_FIRMWARE_TYPE_ADDRESS (EEPROM_PERSONALIZATION_CHECKSUM_ADDRESS + SIZE_PERSONALIZATION_CHECKSUM)
73 
74 #define EEPROM_FIRMWARE_VERSION_ADDRESS (EEPROM_FIRMWARE_TYPE_ADDRESS + SIZE_FIRMWARE_TYPE)
75 
76 #define EEPROM_FIRMWARE_BLOCKS_ADDRESS (EEPROM_FIRMWARE_VERSION_ADDRESS + SIZE_FIRMWARE_VERSION)
77 
78 #define EEPROM_FIRMWARE_CRC_ADDRESS (EEPROM_FIRMWARE_BLOCKS_ADDRESS + SIZE_FIRMWARE_BLOCKS)
79 
80 #define EEPROM_SIGNING_REQUIREMENT_TABLE_ADDRESS (EEPROM_FIRMWARE_CRC_ADDRESS + SIZE_FIRMWARE_CRC)
81 
82 #define EEPROM_WHITELIST_REQUIREMENT_TABLE_ADDRESS (EEPROM_SIGNING_REQUIREMENT_TABLE_ADDRESS + SIZE_SIGNING_REQUIREMENT_TABLE)
83 
84 #define EEPROM_SIGNING_SOFT_HMAC_KEY_ADDRESS (EEPROM_WHITELIST_REQUIREMENT_TABLE_ADDRESS + SIZE_WHITELIST_REQUIREMENT_TABLE)
85 
86 #define EEPROM_SIGNING_SOFT_SERIAL_ADDRESS (EEPROM_SIGNING_SOFT_HMAC_KEY_ADDRESS + SIZE_SIGNING_SOFT_HMAC_KEY)
87 
88 #define EEPROM_RF_ENCRYPTION_AES_KEY_ADDRESS (EEPROM_SIGNING_SOFT_SERIAL_ADDRESS + SIZE_SIGNING_SOFT_SERIAL)
89 
90 #define EEPROM_NODE_LOCK_COUNTER_ADDRESS (EEPROM_RF_ENCRYPTION_AES_KEY_ADDRESS + SIZE_RF_ENCRYPTION_AES_KEY)
91 
92 #define EEPROM_LOCAL_CONFIG_ADDRESS (EEPROM_NODE_LOCK_COUNTER_ADDRESS + SIZE_NODE_LOCK_COUNTER)
93 
94 #endif // MyEepromAddresses_h
95