Loading...
Searching...
No Matches
atca_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "board.h"
20#include "periph/i2c.h"
21#include "atca.h"
22#include "cryptoauthlib.h"
23
24#include "kernel_defines.h"
25
26#ifdef CUSTOM_ATCA_PARAMS
27#include "custom_atca_params.h"
28#endif
29
30#if IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A)
31#include "psa/crypto_types.h"
32#endif
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
53
54#ifndef ATCA_PARAM_I2C
55#define ATCA_PARAM_I2C (I2C_DEV(0))
56#endif
57
58#ifndef ATCA_PARAM_ADDR
59#define ATCA_PARAM_ADDR (ATCA_I2C_ADDR)
60#endif
61#ifndef ATCA_RX_RETRIES
62#define ATCA_RX_RETRIES (20)
63#endif
64#ifndef ATCA_DEVTYPE
65#define ATCA_DEVTYPE (ATECC608A)
66#endif
67
68#ifndef ATCA_PARAMS
72#define ATCA_PARAMS { .iface_type = ATCA_I2C_IFACE, \
73 .devtype = ATCA_DEVTYPE, \
74 .atcai2c.address = ATCA_PARAM_ADDR, \
75 .atcai2c.bus = ATCA_PARAM_I2C, \
76 .atcai2c.baud = -1, \
77 .wake_delay = 1500, \
78 .rx_retries = ATCA_RX_RETRIES }
79#endif
80
82
83#if IS_USED(MODULE_PSA_SECURE_ELEMENT_ATECCX08A)
87typedef struct {
88 psa_key_location_t atca_loc;
89 ATCAIfaceCfg cfg;
90} atca_params_t;
91
95static const atca_params_t atca_params[] =
96{
98};
99#else
103static const ATCAIfaceCfg atca_params[] =
104{
106};
107#endif
108
112#define ATCA_NUMOF (ARRAY_SIZE(atca_params))
113
117extern ATCADevice atca_devs_ptr[ATCA_NUMOF];
118
119#ifdef __cplusplus
120}
121#endif
122
Default addresses and device descriptor for CryptoAuth devices.
Type definitions for PSA Crypto.
static const ATCAIfaceCfg atca_params[]
Allocation of ATCA device descriptors.
#define ATCA_PARAMS
Configuration parameters for the primary ATCA device.
Definition atca_params.h:72
ATCADevice atca_devs_ptr[ATCA_NUMOF]
List of device pointers for all available devices.
#define ATCA_NUMOF
Number of connected devices.
Low-level I2C peripheral driver interface definition.
Common macros and compiler attributes/pragmas configuration.
uint32_t psa_key_location_t
Encoding of key location indicators.
Definition lifetime.h:139