Skip to content

Commit b545d80

Browse files
author
Microchip Technology
committed
Merging into the (master) branch
1 parent 5b5a0c2 commit b545d80

File tree

271 files changed

+57796
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+57796
-0
lines changed

AVRIoT.X/Makefile

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# There exist several targets which are by default empty and which can be
3+
# used for execution of your targets. These targets are usually executed
4+
# before and after some main targets. They are:
5+
#
6+
# .build-pre: called before 'build' target
7+
# .build-post: called after 'build' target
8+
# .clean-pre: called before 'clean' target
9+
# .clean-post: called after 'clean' target
10+
# .clobber-pre: called before 'clobber' target
11+
# .clobber-post: called after 'clobber' target
12+
# .all-pre: called before 'all' target
13+
# .all-post: called after 'all' target
14+
# .help-pre: called before 'help' target
15+
# .help-post: called after 'help' target
16+
#
17+
# Targets beginning with '.' are not intended to be called on their own.
18+
#
19+
# Main targets can be executed directly, and they are:
20+
#
21+
# build build a specific configuration
22+
# clean remove built files from a configuration
23+
# clobber remove all built files
24+
# all build all configurations
25+
# help print help mesage
26+
#
27+
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28+
# .help-impl are implemented in nbproject/makefile-impl.mk.
29+
#
30+
# Available make variables:
31+
#
32+
# CND_BASEDIR base directory for relative paths
33+
# CND_DISTDIR default top distribution directory (build artifacts)
34+
# CND_BUILDDIR default top build directory (object files, ...)
35+
# CONF name of current configuration
36+
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37+
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38+
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39+
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40+
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41+
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42+
#
43+
# NOCDDL
44+
45+
46+
# Environment
47+
MKDIR=mkdir
48+
CP=cp
49+
CCADMIN=CCadmin
50+
RANLIB=ranlib
51+
52+
53+
# build
54+
build: .build-post
55+
56+
.build-pre:
57+
# Add your pre 'build' code here...
58+
59+
.build-post: .build-impl
60+
# Add your post 'build' code here...
61+
62+
63+
# clean
64+
clean: .clean-post
65+
66+
.clean-pre:
67+
# Add your pre 'clean' code here...
68+
# WARNING: the IDE does not call this target since it takes a long time to
69+
# simply run make. Instead, the IDE removes the configuration directories
70+
# under build and dist directly without calling make.
71+
# This target is left here so people can do a clean when running a clean
72+
# outside the IDE.
73+
74+
.clean-post: .clean-impl
75+
# Add your post 'clean' code here...
76+
77+
78+
# clobber
79+
clobber: .clobber-post
80+
81+
.clobber-pre:
82+
# Add your pre 'clobber' code here...
83+
84+
.clobber-post: .clobber-impl
85+
# Add your post 'clobber' code here...
86+
87+
88+
# all
89+
all: .all-post
90+
91+
.all-pre:
92+
# Add your pre 'all' code here...
93+
94+
.all-post: .all-impl
95+
# Add your post 'all' code here...
96+
97+
98+
# help
99+
help: .help-post
100+
101+
.help-pre:
102+
# Add your pre 'help' code here...
103+
104+
.help-post: .help-impl
105+
# Add your post 'help' code here...
106+
107+
108+
109+
# include project implementation makefile
110+
include nbproject/Makefile-impl.mk
111+
112+
# include project make variables
113+
include nbproject/Makefile-variables.mk

AVRIoT.X/main.c

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
(c) 2018 Microchip Technology Inc. and its subsidiaries.
3+
4+
Subject to your compliance with these terms, you may use Microchip software and any
5+
derivatives exclusively with Microchip products. It is your responsibility to comply with third party
6+
license terms applicable to your use of third party software (including open source software) that
7+
may accompany Microchip software.
8+
9+
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
10+
EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY
11+
IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS
12+
FOR A PARTICULAR PURPOSE.
13+
14+
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
15+
INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
16+
WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP
17+
HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO
18+
THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL
19+
CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT
20+
OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS
21+
SOFTWARE.
22+
*/
23+
24+
#include "mcc_generated_files/application_manager.h"
25+
26+
int main(void)
27+
{
28+
application_init();
29+
30+
while (1)
31+
{
32+
runScheduler();
33+
}
34+
35+
return 0;
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
3+
* \file
4+
* \brief CryptoAuthLib Basic API methods - a simple crypto authentication API.
5+
* These methods manage a global ATCADevice object behind the scenes. They also
6+
* manage the wake/idle state transitions so callers don't need to.
7+
*
8+
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
9+
*
10+
* \page License
11+
*
12+
* Subject to your compliance with these terms, you may use Microchip software
13+
* and any derivatives exclusively with Microchip products. It is your
14+
* responsibility to comply with third party license terms applicable to your
15+
* use of third party software (including open source software) that may
16+
* accompany Microchip software.
17+
*
18+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
19+
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
20+
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
21+
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
22+
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
23+
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
24+
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
25+
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
26+
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
27+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
28+
* THIS SOFTWARE.
29+
*/
30+
31+
#include "CryptoAuth_example.h"
32+
#include <stdio.h>
33+
#include <stdint.h>
34+
#include <stdbool.h>
35+
36+
37+
void CryptoAuth_Example(void){
38+
39+
uint8_t random_number[32];
40+
uint8_t serial_number[9];
41+
int i = 0;
42+
int j = 0;
43+
int loop = 10;
44+
45+
while(loop--)
46+
{
47+
atcab_read_serial_number(serial_number);
48+
49+
printf("Serial Number: \r\n");
50+
51+
while (i < 9) {
52+
printf("%02X ", serial_number[i]);
53+
i++;
54+
}
55+
printf("\r\n");
56+
printf("\r\n");
57+
58+
i = 0;
59+
60+
atcab_random(random_number);
61+
62+
printf("Generated 32-byte Random Number: \r\n");
63+
64+
while (i < 32) {
65+
while (j < 4) {
66+
printf("0x%02X ", random_number[i]);
67+
j++;
68+
i++;
69+
}
70+
printf("\r\n");
71+
j = 0;
72+
}
73+
printf("\r\n");
74+
i = 0;
75+
j = 0;
76+
77+
}
78+
79+
80+
printf("\r\n");
81+
82+
}
83+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
3+
* \file
4+
* \brief CryptoAuthLib Basic API methods - a simple crypto authentication API.
5+
* These methods manage a global ATCADevice object behind the scenes. They also
6+
* manage the wake/idle state transitions so callers don't need to.
7+
*
8+
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
9+
*
10+
* \page License
11+
*
12+
* Subject to your compliance with these terms, you may use Microchip software
13+
* and any derivatives exclusively with Microchip products. It is your
14+
* responsibility to comply with third party license terms applicable to your
15+
* use of third party software (including open source software) that may
16+
* accompany Microchip software.
17+
*
18+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
19+
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
20+
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
21+
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
22+
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
23+
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
24+
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
25+
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
26+
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
27+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
28+
* THIS SOFTWARE.
29+
*/
30+
31+
#include "../cryptoauthlib_config.h"
32+
#include "../CryptoAuthenticationLibrary/cryptoauthlib.h"
33+
34+
void CryptoAuth_Example(void);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
3+
* \file
4+
* \brief CryptoAuthLib Basic API methods - a simple crypto authentication API.
5+
* These methods manage a global ATCADevice object behind the scenes. They also
6+
* manage the wake/idle state transitions so callers don't need to.
7+
*
8+
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
9+
*
10+
* \page License
11+
*
12+
* Subject to your compliance with these terms, you may use Microchip software
13+
* and any derivatives exclusively with Microchip products. It is your
14+
* responsibility to comply with third party license terms applicable to your
15+
* use of third party software (including open source software) that may
16+
* accompany Microchip software.
17+
*
18+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
19+
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
20+
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
21+
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
22+
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
23+
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
24+
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
25+
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
26+
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
27+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
28+
* THIS SOFTWARE.
29+
*/
30+
31+
#include <stdbool.h>
32+
#include "CryptoAuth_init.h"
33+
34+
struct atca_command _gmyCommand;
35+
struct atca_iface _gmyIface;
36+
struct atca_device _gMyDevice = {&_gmyCommand, &_gmyIface};
37+
38+
ATCAIfaceCfg secureCfg = {
39+
.iface_type = ATCA_I2C_IFACE,
40+
.devtype = ATECC608A,
41+
.atcai2c.slave_address = 0xB0,
42+
.atcai2c.bus = 2,
43+
.atcai2c.baud = 100000,
44+
.wake_delay = 1560,
45+
.rx_retries = 20
46+
};
47+
48+
49+
bool CryptoAuth_Initialize(void)
50+
{
51+
uint8_t calInitialzeStatus;
52+
calInitialzeStatus = atcab_init(&secureCfg);
53+
if (calInitialzeStatus != ATCA_SUCCESS)
54+
{
55+
return false;
56+
}
57+
else
58+
{
59+
atcab_lock_data_slot(0);
60+
return true;
61+
}
62+
}
63+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
3+
* \file
4+
* \brief CryptoAuthLib Basic API methods - a simple crypto authentication API.
5+
* These methods manage a global ATCADevice object behind the scenes. They also
6+
* manage the wake/idle state transitions so callers don't need to.
7+
*
8+
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
9+
*
10+
* \page License
11+
*
12+
* Subject to your compliance with these terms, you may use Microchip software
13+
* and any derivatives exclusively with Microchip products. It is your
14+
* responsibility to comply with third party license terms applicable to your
15+
* use of third party software (including open source software) that may
16+
* accompany Microchip software.
17+
*
18+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
19+
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
20+
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
21+
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
22+
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
23+
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
24+
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
25+
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
26+
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
27+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
28+
* THIS SOFTWARE.
29+
*/
30+
31+
#include <stdbool.h>
32+
#include "cryptoauthlib_config.h"
33+
#include "CryptoAuthenticationLibrary/cryptoauthlib.h"
34+
35+
bool CryptoAuth_Initialize(void);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
* \file
3+
* \brief CryptoAuthLib Basic API methods - a simple crypto authentication API.
4+
* These methods manage a global ATCADevice object behind the scenes. They also
5+
* manage the wake/idle state transitions so callers don't need to.
6+
*
7+
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
8+
*
9+
* \page License
10+
*
11+
* Subject to your compliance with these terms, you may use Microchip software
12+
* and any derivatives exclusively with Microchip products. It is your
13+
* responsibility to comply with third party license terms applicable to your
14+
* use of third party software (including open source software) that may
15+
* accompany Microchip software.
16+
*
17+
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
18+
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
19+
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
20+
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
21+
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
22+
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
23+
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
24+
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
25+
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
26+
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
27+
* THIS SOFTWARE.

0 commit comments

Comments
 (0)