00001 /*This file is prepared for Doxygen automatic documentation generation.*/ 00017 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00018 * 00019 * Redistribution and use in source and binary forms, with or without 00020 * modification, are permitted provided that the following conditions are met: 00021 * 00022 * 1. Redistributions of source code must retain the above copyright notice, this 00023 * list of conditions and the following disclaimer. 00024 * 00025 * 2. Redistributions in binary form must reproduce the above copyright notice, 00026 * this list of conditions and the following disclaimer in the documentation 00027 * and/or other materials provided with the distribution. 00028 * 00029 * 3. The name of Atmel may not be used to endorse or promote products derived 00030 * from this software without specific prior written permission. 00031 * 00032 * 4. This software may only be redistributed and used in connection with an Atmel 00033 * AVR product. 00034 * 00035 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00036 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00037 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00038 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00039 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00040 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00041 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00042 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00043 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00044 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00045 * 00046 */ 00047 /* - \ref Initialization 00048 * - \ref Q_formatted_number_printing 00049 * - \ref Complex_number_printing 00050 * - \ref Vector_printing 00051 * - \ref Printf 00052 * - \ref Reading 00053 * - \ref Peripheral 00054 */ 00055 00056 #ifndef __DSP_DEBUG_H__ 00057 #define __DSP_DEBUG_H__ 00058 00059 #include "dsp.h" 00060 00066 /*********************************************************************** 00067 * File: dsp_debug_setup_XXX_XXX.c 00068 * This file is used to make an abstraction of the driver used to control 00069 * the debugging periferal. 00070 ***********************************************************************/ 00071 00077 00078 00083 void dsp_debug_init(int fosc); 00089 void dsp_debug_write_fct(char c); 00095 char dsp_debug_read_fct(); 00097 00098 /*********************************************************************** 00099 * File: dsp_debug_print.c 00100 * This file contains all the basic printing functions. 00101 ***********************************************************************/ 00102 00106 typedef void (*dsp_debug_print_str_t)(char *); 00107 00111 #define dsp_debug_initialization(x) dsp_debug_initialization__(__DATE__, __TIME__, x) 00112 00123 00124 void dsp_debug_initialization__(char *date, char *time, int fosc); 00126 00131 00132 00140 void dsp_debug_print(int nb_bits, int q, int n); 00148 int dsp_debug_sprint(char **out, int nb_bits, int q, int i); 00155 #if __GNUC__ 00156 inline 00157 #elif __ICCAVR32__ 00158 # pragma inline 00159 #endif 00160 void dsp16_debug_print(dsp16_t n); 00167 #if __GNUC__ 00168 inline 00169 #elif __ICCAVR32__ 00170 # pragma inline 00171 #endif 00172 void dsp32_debug_print(dsp32_t n); 00174 00179 00180 00189 void dsp_debug_print_complex(int nb_bits, int q, int real, int imag); 00196 #if __GNUC__ 00197 inline 00198 #elif __ICCAVR32__ 00199 # pragma inline 00200 #endif 00201 void dsp16_debug_print_complex(dsp16_complex_t *n); 00208 #if __GNUC__ 00209 inline 00210 #elif __ICCAVR32__ 00211 # pragma inline 00212 #endif 00213 void dsp32_debug_print_complex(dsp32_complex_t *n); 00215 00233 00234 00241 void dsp16_debug_print_vect(dsp16_t *vect, int size); 00249 void dsp32_debug_print_vect(dsp32_t *vect, int size); 00257 void dsp16_debug_print_complex_vect(dsp16_complex_t *vect, int size); 00265 void dsp32_debug_print_complex_vect(dsp32_complex_t *vect, int size); 00267 00276 int dsp_debug_sprint_after_radix(char **out, unsigned int num, unsigned int den, int nb_digits); 00277 00283 void dsp_debug_print_fct(char *str); 00284 00285 /*********************************************************************** 00286 * File: dsp_debug_printf.c 00287 * This file contains all the printf functions. 00288 ***********************************************************************/ 00289 00311 00312 00319 int dsp16_debug_printf(const char *format, ...); 00327 int dsp32_debug_printf(const char *format, ...); 00328 00336 int dsp16_debug_sprintf(char *out, const char *format, ...); 00344 int dsp32_debug_sprintf(char *out, const char *format, ...); 00346 00347 /*********************************************************************** 00348 * File: dsp_debug_print.c 00349 * This file contains all the reading functions. 00350 ***********************************************************************/ 00351 00356 00357 00363 void dsp_debug_read(char *str, int size, char end_char); 00368 int dsp_debug_read_ui(); 00375 int dsp_debug_read_q(int a, int b); 00377 00378 #endif //__DSP_DEBUG_H__ 00379