We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-08-15
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Encryption
Downloaded: 446 times
Not followed.
License: MIT license
Secure 6 Click includes the ATSHA204A, a secure CryptoAuthentication device from Microchip, which is equipped with an EEPROM array which can be used for storing of up to 16 keys, certificates, consumption logging, security configurations and other types of secure data.
Do you want to subscribe in order to receive notifications regarding "Secure 6 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Secure 6 click" changes.
Do you want to report abuse regarding "Secure 6 click".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1558430852_secure_6_click_mikroc_other.zip [8.70MB] |
|
Library Description
The library demonstrates the operation of the software single wire interface implementation.
Key functions:
int8_t secureswi_init(T_SECURESWI_DIRSET inSet, T_SECURESWI_DIRSET outSet)
- Initialize the SWI interface and pass the pin direction setting functions.void secureswi_sendBytes(uint8_t len,uint8_t *stBuf)
- Encode data buffer and send the data to the SWI bus.void secureswi_receiveBytes(uint8_t len,uint8_t *stBuf)
- Receive and decode data from the SWI bus.Examples description
The application is composed of three sections :
void applicationTask()
{
uint8_t bufferOut[128];
cfg_atsha204a_swi_default.iface_type = ATCA_SWI_IFACE;
cfg_atsha204a_swi_default.devtype = ATSHA204A;
cfg_atsha204a_swi_default.atcaswi.bus = 1;
cfg_atsha204a_swi_default.wake_delay = 2560;
cfg_atsha204a_swi_default.rx_retries = 10;
atcab_init(&cfg_atsha204a_swi_default);
mikrobus_logWrite("Starting test",_LOG_LINE);
memset(bufferOut,0,127);
if (atcab_read_serial_number(bufferOut) == ATCA_SUCCESS)
{
mikrobus_logWrite("rn Serial number: ",_LOG_LINE);
secureswi_printHex(bufferOut,9);
}
else
{
mikrobus_logWrite("rn Reading serial number failed...",_LOG_LINE);
secureswi_printHex(bufferOut,sizeof(bufferOut));
}
Delay_ms (1500);
memset (bufferOut, 0x00, 128);
if (atcab_read_config_zone(bufferOut) == ATCA_SUCCESS)
{
mikrobus_logWrite("rnrn First 32 bytes of device configuration: ",_LOG_LINE);
secureswi_printHex(bufferOut,32);
}
else
{
mikrobus_logWrite("rnrn Reading config zone failed...",_LOG_LINE);
secureswi_printHex(bufferOut,sizeof(bufferOut));
}
while(1)
{
}
}
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.