|
| 1 | +/* Auto-generated config file atca_config.h */ |
| 2 | +#ifndef ATCA_CONFIG_H |
| 3 | +#define ATCA_CONFIG_H |
| 4 | + |
| 5 | +/* MPLAB Harmony Common Include */ |
| 6 | +#include "definitions.h" |
| 7 | + |
| 8 | +#ifndef ATCA_HAL_I2C |
| 9 | +#define ATCA_HAL_I2C |
| 10 | +#endif |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +/** Include Device Support Options */ |
| 15 | +#define ATCA_ATECC608_SUPPORT |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +/* Polling Configuration Options */ |
| 21 | +#ifndef ATCA_POLLING_INIT_TIME_MSEC |
| 22 | +#define ATCA_POLLING_INIT_TIME_MSEC 1 |
| 23 | +#endif |
| 24 | +#ifndef ATCA_POLLING_FREQUENCY_TIME_MSEC |
| 25 | +#define ATCA_POLLING_FREQUENCY_TIME_MSEC 2 |
| 26 | +#endif |
| 27 | +#ifndef ATCA_POLLING_MAX_TIME_MSEC |
| 28 | +#define ATCA_POLLING_MAX_TIME_MSEC 2500 |
| 29 | +#endif |
| 30 | + |
| 31 | +/** Define if the library is not to use malloc/free */ |
| 32 | +#define ATCA_NO_HEAP |
| 33 | + |
| 34 | +#define atca_delay_ms hal_delay_ms |
| 35 | +#define atca_delay_us hal_delay_us |
| 36 | + |
| 37 | +/* \brief How long to wait after an initial wake failure for the POST to |
| 38 | + * complete. |
| 39 | + * If Power-on self test (POST) is enabled, the self test will run on waking |
| 40 | + * from sleep or during power-on, which delays the wake reply. |
| 41 | + */ |
| 42 | +#ifndef ATCA_POST_DELAY_MSEC |
| 43 | +#define ATCA_POST_DELAY_MSEC 25 |
| 44 | +#endif |
| 45 | + |
| 46 | + |
| 47 | +/* Define generic interfaces to the processor libraries */ |
| 48 | + |
| 49 | +#define PLIB_I2C_ERROR SERCOM_I2C_ERROR |
| 50 | +#define PLIB_I2C_ERROR_NONE SERCOM_I2C_ERROR_NONE |
| 51 | +#define PLIB_I2C_TRANSFER_SETUP SERCOM_I2C_TRANSFER_SETUP |
| 52 | + |
| 53 | +typedef bool (* atca_i2c_plib_read)(uint16_t, uint8_t *, uint32_t); |
| 54 | +typedef bool (* atca_i2c_plib_write)(uint16_t, uint8_t *, uint32_t); |
| 55 | +typedef bool (* atca_i2c_plib_is_busy)(void); |
| 56 | +typedef PLIB_I2C_ERROR (* atca_i2c_error_get)(void); |
| 57 | +typedef bool (* atca_i2c_plib_transfer_setup)(PLIB_I2C_TRANSFER_SETUP* setup, uint32_t srcClkFreq); |
| 58 | + |
| 59 | +typedef struct atca_plib_i2c_api |
| 60 | +{ |
| 61 | + atca_i2c_plib_read read; |
| 62 | + atca_i2c_plib_write write; |
| 63 | + atca_i2c_plib_is_busy is_busy; |
| 64 | + atca_i2c_error_get error_get; |
| 65 | + atca_i2c_plib_transfer_setup transfer_setup; |
| 66 | +} atca_plib_i2c_api_t; |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +extern atca_plib_i2c_api_t sercom2_plib_i2c_api; |
| 72 | + |
| 73 | +/* WPC Configuration */ |
| 74 | +#define WPC_CHAIN_DIGEST_HANDLE_0 0x03 |
| 75 | +#define WPC_CHAIN_CERT_DEF_0 g_cert_def_2_device |
| 76 | + |
| 77 | +/* Define for a simple mapping of slot to certificate */ |
| 78 | +#define WPC_STRICT_SLOT_INDEX |
| 79 | + |
| 80 | +/* One of the certificate format options is to generate the certificate serial |
| 81 | + number from a hash of several data elements - this saves storage in the device |
| 82 | + at the expense of code space and time */ |
| 83 | +#define WPC_CERT_SN_FROM_HASH_EN FEATURE_DISABLED |
| 84 | + |
| 85 | +/* Enable the Power Transmitter API */ |
| 86 | +#define WPC_MSG_PT_EN FEATURE_ENABLED |
| 87 | + |
| 88 | +/* Disable the Power Receiver API since this project is demonstrating the transmitter */ |
| 89 | +#define WPC_MSG_PR_EN FEATURE_DISABLED |
| 90 | + |
| 91 | + |
| 92 | +/* Turn off parameter checking in the library - enable for easier debugging in development */ |
| 93 | +//#define ATCA_CHECK_PARAMS_EN FEATURE_DISABLED |
| 94 | + |
| 95 | +/* API Configuration Options */ |
| 96 | +#define ATCAB_AES_EN FEATURE_DISABLED |
| 97 | +#define ATCAB_AES_GCM_EN FEATURE_DISABLED |
| 98 | +#define ATCAB_COUNTER_EN FEATURE_DISABLED |
| 99 | +#define ATCAB_DERIVEKEY_EN FEATURE_DISABLED |
| 100 | +#define ATCAB_ECDH_EN FEATURE_DISABLED |
| 101 | +#define ATCAB_ECDH_ENC_EN FEATURE_DISABLED |
| 102 | +#define ATCAB_GENDIG_EN FEATURE_DISABLED |
| 103 | +#define ATCAB_GENKEY_MAC_EN FEATURE_DISABLED |
| 104 | +#define ATCAB_HMAC_EN FEATURE_DISABLED |
| 105 | +#define ATCAB_INFO_LATCH_EN FEATURE_DISABLED |
| 106 | +#define ATCAB_KDF_EN FEATURE_DISABLED |
| 107 | +#define ATCAB_LOCK_EN FEATURE_DISABLED |
| 108 | +#define ATCAB_MAC_EN FEATURE_DISABLED |
| 109 | +#define ATCAB_PRIVWRITE_EN FEATURE_DISABLED |
| 110 | +/* By default the random command is only required for the power receiver to generate |
| 111 | + challenges - because a health check on the rng before a sign can return failures |
| 112 | + the power transmitter has a choice - enable the random command which will use more |
| 113 | + code or retry the sign operation if a health check failure occurs. */ |
| 114 | +#define ATCAB_RANDOM_EN WPC_MSG_PR_EN |
| 115 | +#define ATCAB_READ_ENC_EN FEATURE_DISABLED |
| 116 | +#define ATCAB_SECUREBOOT_EN FEATURE_DISABLED |
| 117 | +#define ATCAB_SECUREBOOT_MAC_EN FEATURE_DISABLED |
| 118 | +#define ATCAB_SELFTEST_EN FEATURE_DISABLED |
| 119 | +#define ATCAB_SHA_HMAC_EN FEATURE_DISABLED |
| 120 | +#define ATCAB_SIGN_INTERNAL_EN FEATURE_DISABLED |
| 121 | +#define ATCAB_UPDATEEXTRA_EN FEATURE_DISABLED |
| 122 | +/* Enable the verify command when the power receiver api is enabled - this helps |
| 123 | + with testing - it is unnecessary for the power transmitter */ |
| 124 | +#define ATCAB_VERIFY_EN WPC_MSG_PR_EN |
| 125 | +#define ATCAB_WRITE_EN FEATURE_DISABLED |
| 126 | + |
| 127 | +/* Disable software cryptography */ |
| 128 | +#define ATCAC_SHA1_EN FEATURE_DISABLED |
| 129 | +#define ATCAC_SHA256_EN FEATURE_DISABLED |
| 130 | + |
| 131 | +/* Certificate Processing Configuration */ |
| 132 | +#define ATCACERT_DATEFMT_UTC_EN FEATURE_ENABLED |
| 133 | +#define ATCACERT_DATEFMT_GEN_EN FEATURE_ENABLED |
| 134 | + |
| 135 | +#define ATCACERT_DATEFMT_ISO_EN FEATURE_DISABLED |
| 136 | +#define ATCACERT_DATEFMT_POSIX_EN FEATURE_DISABLED |
| 137 | + |
| 138 | + |
| 139 | +#endif // ATCA_CONFIG_H |
0 commit comments