]> git.cryptolib.org Git - arm-crypto-lib.git/blob - test_src/main-test-common.c
switching to dedicated endian switching function
[arm-crypto-lib.git] / test_src / main-test-common.c
1 /* main-test-common.c */
2 /*
3     This file is part of the ARM-Crypto-Lib.
4     Copyright (C) 2006-2011 Daniel Otte (daniel.otte@rub.de)
5
6     This program is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "main-test-common.h"
21
22 static
23 void uart0_putc(char byte){
24         uart_putc(UART_0, byte);
25 }
26
27 static
28 char uart0_getc(void){
29         return uart_getc(UART_0);
30 }
31
32 void main_setup(void){
33         sysclk_set_freq(SYS_FREQ);
34         sysclk_mosc_verify_enable();
35         uart_init(UART_0, 115200, 8, UART_PARATY_NONE, UART_STOPBITS_ONE);
36         gptm_set_timer_32periodic(TIMER0);
37
38         cli_rx = uart0_getc;
39         cli_tx = uart0_putc;
40 }
41
42 void welcome_msg(const char* algoname){
43         cli_putstr("\r\n\r\nARM-Crypto-Lib VS (");
44         cli_putstr(algoname);
45         cli_putstr("; ");
46         cli_putstr(__DATE__);
47         cli_putc(' ');
48         cli_putstr(__TIME__);
49         cli_putstr(")\r\nloaded and running\r\n");
50 }