From 083a6aff753ef04626cea2bdf1107ff24e93142c Mon Sep 17 00:00:00 2001 From: bg Date: Sat, 5 Feb 2011 00:07:53 +0100 Subject: [PATCH] minor ajustments --- bcal/bcal-nessie.c | 2 +- bcal/bcal-nessie.h | 2 +- bcal/bcal_cscipher.c | 2 +- bcal/bcal_cscipher.h | 2 +- bcal/bcal_khazad.c | 2 +- bcal/bcal_khazad.h | 2 +- cscipher/cscipher.h | 2 +- cscipher/cscipher_sbox.h | 2 +- keysize_descriptor.c | 2 +- keysize_descriptor.h | 2 +- khazad/khazad.c | 2 +- khazad/khazad.h | 2 +- test_src/circularbytebuffer.c | 2 +- test_src/circularbytebuffer.h | 2 +- test_src/main-cscipher-test.c | 2 +- test_src/main-khazad-test.c | 2 +- test_src/setbaud_asm.inc | 80 ------------------- test_src/uart_i.h | 139 ---------------------------------- 18 files changed, 16 insertions(+), 235 deletions(-) delete mode 100644 test_src/setbaud_asm.inc delete mode 100644 test_src/uart_i.h diff --git a/bcal/bcal-nessie.c b/bcal/bcal-nessie.c index b013bf5..9b4cc25 100644 --- a/bcal/bcal-nessie.c +++ b/bcal/bcal-nessie.c @@ -1,6 +1,6 @@ /* bcal-nessie.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/bcal/bcal-nessie.h b/bcal/bcal-nessie.h index 5e4285f..23a0e75 100644 --- a/bcal/bcal-nessie.h +++ b/bcal/bcal-nessie.h @@ -1,6 +1,6 @@ /* bcal-nessie.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/bcal/bcal_cscipher.c b/bcal/bcal_cscipher.c index 4a65398..bd9404a 100644 --- a/bcal/bcal_cscipher.c +++ b/bcal/bcal_cscipher.c @@ -1,6 +1,6 @@ /* bcal_cscipher.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/bcal/bcal_cscipher.h b/bcal/bcal_cscipher.h index 5d2697c..9cd1f87 100644 --- a/bcal/bcal_cscipher.h +++ b/bcal/bcal_cscipher.h @@ -1,6 +1,6 @@ /* bcal_cscipher.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/bcal/bcal_khazad.c b/bcal/bcal_khazad.c index 7cc3708..609050d 100644 --- a/bcal/bcal_khazad.c +++ b/bcal/bcal_khazad.c @@ -1,6 +1,6 @@ /* bcal_khazad.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2011 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/bcal/bcal_khazad.h b/bcal/bcal_khazad.h index 74e3a4a..283b015 100644 --- a/bcal/bcal_khazad.h +++ b/bcal/bcal_khazad.h @@ -1,6 +1,6 @@ /* bcal_khazad.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/cscipher/cscipher.h b/cscipher/cscipher.h index 717fc05..5ca1a50 100644 --- a/cscipher/cscipher.h +++ b/cscipher/cscipher.h @@ -1,6 +1,6 @@ /* cscipher.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/cscipher/cscipher_sbox.h b/cscipher/cscipher_sbox.h index f48d9d7..5f3fda5 100644 --- a/cscipher/cscipher_sbox.h +++ b/cscipher/cscipher_sbox.h @@ -1,6 +1,6 @@ /* cscipher_sbox.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2010 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/keysize_descriptor.c b/keysize_descriptor.c index b9a8d71..579ef56 100644 --- a/keysize_descriptor.c +++ b/keysize_descriptor.c @@ -1,6 +1,6 @@ /* keysize_descriptor.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/keysize_descriptor.h b/keysize_descriptor.h index e7139f3..2858e90 100644 --- a/keysize_descriptor.h +++ b/keysize_descriptor.h @@ -1,6 +1,6 @@ /* keysize_descriptor.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/khazad/khazad.c b/khazad/khazad.c index d2bb21c..e1c6fd8 100644 --- a/khazad/khazad.c +++ b/khazad/khazad.c @@ -1,6 +1,6 @@ /* khazad.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2006-2011 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/khazad/khazad.h b/khazad/khazad.h index 1f1c335..76c6399 100644 --- a/khazad/khazad.h +++ b/khazad/khazad.h @@ -1,6 +1,6 @@ /* khazad.h */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2011 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/test_src/circularbytebuffer.c b/test_src/circularbytebuffer.c index 720da14..4b3f901 100644 --- a/test_src/circularbytebuffer.c +++ b/test_src/circularbytebuffer.c @@ -1,6 +1,6 @@ /* circularbytebuffer.c */ /* - This file is part of the AVR-circularbuffer. + This file is part of the ARM-circularbytebuffer. Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/test_src/circularbytebuffer.h b/test_src/circularbytebuffer.h index 6d6864c..35ee9ee 100644 --- a/test_src/circularbytebuffer.h +++ b/test_src/circularbytebuffer.h @@ -1,6 +1,6 @@ /* circularbytebuffer.h */ /* - This file is part of the AVR-circularbytebuffer. + This file is part of the ARM-circularbytebuffer. Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/test_src/main-cscipher-test.c b/test_src/main-cscipher-test.c index 1ea73c0..f9f3aad 100644 --- a/test_src/main-cscipher-test.c +++ b/test_src/main-cscipher-test.c @@ -1,6 +1,6 @@ /* main-cscipher-test.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/test_src/main-khazad-test.c b/test_src/main-khazad-test.c index 5e03fbf..b547ed4 100644 --- a/test_src/main-khazad-test.c +++ b/test_src/main-khazad-test.c @@ -1,6 +1,6 @@ /* main-khazad-test.c */ /* - This file is part of the AVR-Crypto-Lib. + This file is part of the ARM-Crypto-Lib. Copyright (C) 2011 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify diff --git a/test_src/setbaud_asm.inc b/test_src/setbaud_asm.inc deleted file mode 100644 index b472a88..0000000 --- a/test_src/setbaud_asm.inc +++ /dev/null @@ -1,80 +0,0 @@ -/* - This file is part of the AVR-uart_ni. - Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/* #include */ -/* we use a modifyed version of util/setbaud where the UL suffix is removed - * since the preprocessor can not handle that. - */ - -#ifndef F_CPU -# error "uart_i requires F_CPU to be defined" -#endif - -#ifndef BAUD -# error "uart_i requires UART0_BAUD_RATE to be defined" -#endif - -#if !(F_CPU) -# error "F_CPU must be a constant value" -#endif - -#if !(BAUD) -# error "UART0_BAUD_RATE must be a constant value" -#endif - -#undef USE_2X - -/* Baud rate tolerance is 2 % unless previously defined */ -#ifndef BAUD_TOL -# define BAUD_TOL 2 -#endif - -#define UBRR_VALUE (((F_CPU) + 8 * (BAUD)) / (16 * (BAUD)) -1) - -#if 100 * (F_CPU) > \ - (16 * ((UBRR_VALUE) + 1)) * (100 * (BAUD) + (BAUD) * (BAUD_TOL)) -# define USE_2X 1 -#elif 100 * (F_CPU) < \ - (16 * ((UBRR_VALUE) + 1)) * (100 * (BAUD) - (BAUD) * (BAUD_TOL)) -# define USE_2X 1 -#else -# define USE_2X 0 -#endif - -#if USE_2X -/* U2X required, recalculate */ -#undef UBRR_VALUE -#define UBRR_VALUE (((F_CPU) + 4 * (BAUD)) / (8 * (BAUD)) -1) - -#if 100 * (F_CPU) > \ - (8 * ((UBRR_VALUE) + 1)) * (100 * (BAUD) + (BAUD) * (BAUD_TOL)) -# warning "Baud rate achieved is higher than allowed" -#endif - -#if 100 * (F_CPU) < \ - (8 * ((UBRR_VALUE) + 1)) * (100 * (BAUD) - (BAUD) * (BAUD_TOL)) -# warning "Baud rate achieved is lower than allowed" -#endif - -#endif /* USE_U2X */ - -#ifdef UBRR_VALUE -# define UBRRL_VALUE ((UBRR_VALUE) & 0xff) -# define UBRRH_VALUE ((UBRR_VALUE) >> 8) -#endif - diff --git a/test_src/uart_i.h b/test_src/uart_i.h deleted file mode 100644 index aff5f85..0000000 --- a/test_src/uart_i.h +++ /dev/null @@ -1,139 +0,0 @@ -/* uart_i.h */ -/* - This file is part of the AVR-uart_ni. - Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -/** - * \file uart_i.h - * \email daniel.otte@rub.de - * \author Daniel Otte - * \date 2009-07-24 - * \license GPLv3 or later - * \ingroup uart_i - * \brief declaration for non-interrupt uart - */ - -#ifndef UART_I_H_ -#define UART_I_H_ - -#include "config.h" -#include "circularbytebuffer.h" -#include - -typedef struct{ - circularbytebuffer_t rxb; - circularbytebuffer_t txb; -#if UART0_HOOK - void(*hook)(uint8_t); - volatile uint8_t hook_running; -#endif -#if UART0_SWFLOWCTRL - volatile uint8_t txon; - volatile uint8_t rxon; -#endif -} uart0_ctx_t; - - -typedef struct{ - circularbytebuffer_t rxb; - circularbytebuffer_t txb; -#if UART1_HOOK - void(*hook)(uint8_t); - volatile uint8_t hook_running; -#endif -#if UART1_SWFLOWCTRL - volatile uint8_t txon; - volatile uint8_t rxon; -#endif -} uart1_ctx_t; - -#if UART0_I - -/** \fn uart0_init(void) - * \brief initialize uart0. - * This function initializes the first uart according to the parameter specifyed - * in config.h . - */ -void uart0_init(void); - -/** \fn uart0_putc(uint16_t) - * \brief send data through uart0. - * This function sends data through the first uart - * (the data size is debfined in config.h). - * \param c data to send - */ -void uart0_putc(uint16_t c); - -/** \fn uart0_getc(void) - * \brief read data from uart0. - * This function reads data from the first uart - * (the data size is debfined in config.h). - * \return data recived by uart0 - */ -uint16_t uart0_getc(void); - -/** \fn uart0_dataavail(void) - * \brief checks if data is available. - * - * This function checks the state of the input buffer of uart0 and - * returns if data is available or not. - * \return zero if no data is available else a value different from zero is returned - */ -uint8_t uart0_dataavail(void); - -#if UART0_HOOK -void uart0_sethook(void(*fpt)(uint8_t)); -#endif - - -#endif /* UART0_I */ - -#if UART1_I -/** \fn uart1_init(void) - * \brief initialize uart1. - * This function initializes the second uart according to the parameter specifyed - * in config.h . - */ -void uart1_init(void); - -/** \fn uart1_putc(uint16_t) - * \brief send data through uart1. - * This function sends data through the second uart - * (the data size is debfined in config.h). - * \param c data to send - */ -void uart1_putc(uint16_t c); - -/** \fn uart1_getc(void) - * \brief read data from uart1. - * This function reads data from the second uart - * (the data size is debfined in config.h). - * \return data recived by uart1 - */ -uint16_t uart1_getc(void); - -/** \fn uart1_dataavail(void) - * \brief checks if data is available. - * This function checks the state of the input buffer of uart1 and - * returns if data is available or not. - * \return zero if no data is available else a value different from zero is returned - */ -uint8_t uart1_dataavail(void); - -void uart0_sethook(void(*fpt)(uint8_t)); -#endif - -#endif /* UART_I_H_ */