00001 // This header file is a compilation of multiple dsp_debug header files 00002 00003 /*This file is prepared for Doxygen automatic documentation generation.*/ 00019 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00020 * 00021 * Redistribution and use in source and binary forms, with or without 00022 * modification, are permitted provided that the following conditions are met: 00023 * 00024 * 1. Redistributions of source code must retain the above copyright notice, this 00025 * list of conditions and the following disclaimer. 00026 * 00027 * 2. Redistributions in binary form must reproduce the above copyright notice, 00028 * this list of conditions and the following disclaimer in the documentation 00029 * and/or other materials provided with the distribution. 00030 * 00031 * 3. The name of Atmel may not be used to endorse or promote products derived 00032 * from this software without specific prior written permission. 00033 * 00034 * 4. This software may only be redistributed and used in connection with an Atmel 00035 * AVR product. 00036 * 00037 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00038 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00039 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00040 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00041 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00042 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00043 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00045 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00046 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00047 * 00048 */ 00049 /* 00050 * - \ref Initialization 00051 * - \ref Q_formatted_number_printing 00052 * - \ref Complex_number_printing 00053 * - \ref Vector_printing 00054 * - \ref Printf 00055 * - \ref Reading 00056 * - \ref Peripheral 00057 */ 00058 00059 #ifndef __DSP_DEBUG_H__ 00060 #define __DSP_DEBUG_H__ 00061 00062 #include "dsp.h" 00063 00069 /*********************************************************************** 00070 * File: dsp_debug_setup_XXX_XXX.c 00071 * This file is used to make an abstraction of the driver used to control 00072 * the debugging periferal. 00073 ***********************************************************************/ 00074 00080 00081 00086 void dsp_debug_init(int fosc); 00092 void dsp_debug_write_fct(char c); 00098 char dsp_debug_read_fct(); 00100 00101 /*********************************************************************** 00102 * File: dsp_debug_print.c 00103 * This file contains all the basic printing functions. 00104 ***********************************************************************/ 00105 00109 typedef void (*dsp_debug_print_str_t)(char *); 00110 00114 #define dsp_debug_initialization(x) dsp_debug_initialization__(__DATE__, __TIME__, x) 00115 00126 00127 void dsp_debug_initialization__(char *date, char *time, int fosc); 00129 00134 00135 00143 void dsp_debug_print(int nb_bits, int q, int n); 00151 int dsp_debug_sprint(char **out, int nb_bits, int q, int i); 00158 #if __GNUC__ 00159 inline 00160 #elif __ICCAVR32__ 00161 # pragma inline 00162 #endif 00163 void dsp16_debug_print(dsp16_t n); 00170 #if __GNUC__ 00171 inline 00172 #elif __ICCAVR32__ 00173 # pragma inline 00174 #endif 00175 void dsp32_debug_print(dsp32_t n); 00177 00182 00183 00192 void dsp_debug_print_complex(int nb_bits, int q, int real, int imag); 00199 #if __GNUC__ 00200 inline 00201 #elif __ICCAVR32__ 00202 # pragma inline 00203 #endif 00204 void dsp16_debug_print_complex(dsp16_complex_t *n); 00211 #if __GNUC__ 00212 inline 00213 #elif __ICCAVR32__ 00214 # pragma inline 00215 #endif 00216 void dsp32_debug_print_complex(dsp32_complex_t *n); 00218 00236 00237 00244 void dsp16_debug_print_vect(dsp16_t *vect, int size); 00252 void dsp32_debug_print_vect(dsp32_t *vect, int size); 00260 void dsp16_debug_print_complex_vect(dsp16_complex_t *vect, int size); 00268 void dsp32_debug_print_complex_vect(dsp32_complex_t *vect, int size); 00270 00279 int dsp_debug_sprint_after_radix(char **out, unsigned int num, unsigned int den, int nb_digits); 00280 00286 void dsp_debug_print_fct(char *str); 00287 00288 /*********************************************************************** 00289 * File: dsp_debug_printf.c 00290 * This file contains all the printf functions. 00291 ***********************************************************************/ 00292 00314 00315 00322 int dsp16_debug_printf(const char *format, ...); 00330 int dsp32_debug_printf(const char *format, ...); 00331 00339 int dsp16_debug_sprintf(char *out, const char *format, ...); 00347 int dsp32_debug_sprintf(char *out, const char *format, ...); 00349 00350 /*********************************************************************** 00351 * File: dsp_debug_print.c 00352 * This file contains all the reading functions. 00353 ***********************************************************************/ 00354 00359 00360 00366 void dsp_debug_read(char *str, int size, char end_char); 00371 int dsp_debug_read_ui(); 00378 int dsp_debug_read_q(int a, int b); 00380 00381 #endif //__DSP_DEBUG_H__ 00382