#include "board.h"
#include "print_funcs.h"
#include "gpio.h"
#include "pm.h"
#include "intc.h"
#include "usart.h"
#include "aes.h"
Macros | |
#define | AES_EXAMPLE_REFBUF_SIZE 16 |
Board-Related Example Settings | |
#define | AES_EXAMPLE_USART (&AVR32_USART1) |
#define | AES_EXAMPLE_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN |
#define | AES_EXAMPLE_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION |
#define | AES_EXAMPLE_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN |
#define | AES_EXAMPLE_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION |
#define | AES_EXAMPLE_USART_BAUDRATE 57600 |
#define | AES_EXAMPLE_LED1 LED0_GPIO |
#define | AES_EXAMPLE_LED2 LED1_GPIO |
#define | AES_EXAMPLE_LED3 LED2_GPIO |
#define | AES_EXAMPLE_LED4 LED3_GPIO |
Example internal states | |
#define | AES_EXAMPLE_STATE_1 0 |
#define | AES_EXAMPLE_STATE_2 1 |
#define | AES_EXAMPLE_STATE_3 2 |
#define | AES_EXAMPLE_STATE_4 3 |
#define | AES_EXAMPLE_STATE_5 4 |
#define | AES_EXAMPLE_STATE_6 5 |
#define | AES_EXAMPLE_STATE_7 6 |
#define | AES_EXAMPLE_STATE_8 7 |
Functions | |
static void | aes_int_handler (void) |
The AES interrupt handler. More... | |
static void | init_hmatrix (void) |
Initializes the HSB bus matrix. More... | |
int | main (void) |
The main function. More... | |
Variables | |
const unsigned int | CBCRefInputData [AES_EXAMPLE_REFBUF_SIZE] |
const unsigned int | CBCRefOutputData [AES_EXAMPLE_REFBUF_SIZE] |
volatile unsigned int | ccountt0 |
volatile unsigned int | ccountt1 |
const unsigned int | CipherKey256 [8] |
volatile unsigned char | ContinueCBCProcess = true |
const unsigned int | InitVectorCBC [4] |
volatile unsigned int | OutputData [AES_EXAMPLE_REFBUF_SIZE] |
pm_freq_param_t | pm_freq_param |
volatile unsigned char | state = 0 |
volatile unsigned long | Tempo |
volatile unsigned char | urad_evt = false |
static const gpio_map_t | USART_GPIO_MAP |
static const usart_options_t | USART_OPTIONS |
#define AES_EXAMPLE_LED1 LED0_GPIO |
Referenced by aes_int_handler().
#define AES_EXAMPLE_LED2 LED1_GPIO |
Referenced by aes_int_handler().
#define AES_EXAMPLE_LED3 LED2_GPIO |
Referenced by aes_int_handler().
#define AES_EXAMPLE_LED4 LED3_GPIO |
Referenced by aes_int_handler().
#define AES_EXAMPLE_REFBUF_SIZE 16 |
Referenced by main().
#define AES_EXAMPLE_STATE_1 0 |
Referenced by aes_int_handler(), and main().
#define AES_EXAMPLE_STATE_2 1 |
Referenced by aes_int_handler(), and main().
#define AES_EXAMPLE_STATE_3 2 |
Referenced by aes_int_handler().
#define AES_EXAMPLE_STATE_4 3 |
Referenced by aes_int_handler(), and main().
#define AES_EXAMPLE_STATE_5 4 |
Referenced by aes_int_handler().
#define AES_EXAMPLE_STATE_6 5 |
#define AES_EXAMPLE_STATE_7 6 |
#define AES_EXAMPLE_STATE_8 7 |
Referenced by aes_int_handler(), and main().
#define AES_EXAMPLE_USART (&AVR32_USART1) |
Referenced by main().
#define AES_EXAMPLE_USART_BAUDRATE 57600 |
#define AES_EXAMPLE_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION |
#define AES_EXAMPLE_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN |
#define AES_EXAMPLE_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION |
#define AES_EXAMPLE_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN |
|
static |
The AES interrupt handler.
References AES_EXAMPLE_LED1, AES_EXAMPLE_LED2, AES_EXAMPLE_LED3, AES_EXAMPLE_LED4, AES_EXAMPLE_STATE_1, AES_EXAMPLE_STATE_2, AES_EXAMPLE_STATE_3, AES_EXAMPLE_STATE_4, AES_EXAMPLE_STATE_5, AES_EXAMPLE_STATE_8, aes_get_status(), aes_read_outputdata(), aes_swreset(), AES_URAT_READ_WRITEONLY, ccountt1, ContinueCBCProcess, Get_system_register, gpio_clr_gpio_pin(), OutputData, state, Tempo, and urad_evt.
Referenced by main().
|
static |
Initializes the HSB bus matrix.
Referenced by main().
int main | ( | void | ) |
The main function.
It sets up the USART module on EXAMPLE_USART. The terminal settings are 57600 8N1. Then it sets up the interrupt handler and waits for a USART interrupt to trigger.
References AES_CBC_MODE, aes_configure(), AES_ECB_MODE, AES_EXAMPLE_REFBUF_SIZE, AES_EXAMPLE_STATE_1, AES_EXAMPLE_STATE_2, AES_EXAMPLE_STATE_4, AES_EXAMPLE_STATE_8, AES_EXAMPLE_USART, aes_int_handler(), aes_isr_configure(), AES_KEY_SIZE_128, AES_KEY_SIZE_256, AES_PMODE_CIPHER, AES_PMODE_DECIPHER, aes_set_initvector(), aes_set_key(), aes_start(), AES_START_MODE_AUTO, AES_START_MODE_MANUAL, aes_write_inputdata(), CBCRefInputData, CBCRefOutputData, ccountt0, ccountt1, aes_config_t::CFBSize, CipherKey256, ContinueCBCProcess, aes_config_t::CounterMeasureMask, aes_isrconfig_t::datrdy, Disable_global_interrupt, ENABLE, Enable_global_interrupt, Get_system_register, gpio_enable_module(), init_hmatrix(), InitVectorCBC, INTC_init_interrupts(), INTC_register_interrupt(), aes_config_t::KeySize, aes_config_t::LodMode, aes_config_t::OpMode, OutputData, pm_configure_clocks(), PM_FREQ_STATUS_FAIL, print(), print_ulong(), aes_config_t::ProcessingDelay, aes_config_t::ProcessingMode, SLEEP, aes_config_t::StartMode, state, Tempo, aes_isrconfig_t::urad, urad_evt, and usart_init_rs232().
const unsigned int CBCRefInputData[AES_EXAMPLE_REFBUF_SIZE] |
Referenced by main().
const unsigned int CBCRefOutputData[AES_EXAMPLE_REFBUF_SIZE] |
Referenced by main().
volatile unsigned int ccountt0 |
Referenced by main().
volatile unsigned int ccountt1 |
Referenced by aes_int_handler(), and main().
const unsigned int CipherKey256[8] |
Referenced by main().
volatile unsigned char ContinueCBCProcess = true |
Referenced by aes_int_handler(), and main().
const unsigned int InitVectorCBC[4] |
Referenced by main().
volatile unsigned int OutputData[AES_EXAMPLE_REFBUF_SIZE] |
Referenced by aes_int_handler(), and main().
pm_freq_param_t pm_freq_param |
volatile unsigned char state = 0 |
Referenced by aes_int_handler(), and main().
volatile unsigned long Tempo |
Referenced by aes_int_handler(), and main().
volatile unsigned char urad_evt = false |
Referenced by aes_int_handler(), and main().
|
static |
|
static |