Definition in file dsp_debug_print.c.
#include "dsp.h"
#include "dsp_debug.h"
#include "dsp_debug_shared.h"
Go to the source code of this file.
Functions | |
void | dsp16_debug_print (dsp16_t n) |
This functions permits to print a dsp16_t typed number. | |
void | dsp16_debug_print_complex (dsp16_complex_t *n) |
This functions permits to print a dsp16_complex_t typed number. | |
void | dsp16_debug_print_complex_vect (dsp16_complex_t *vect, int size) |
This functions permits to print a dsp16_complex_t typed vector. | |
void | dsp16_debug_print_vect (dsp16_t *vect, int size) |
This functions permits to print a dsp16_t typed vector. | |
void | dsp32_debug_print (dsp32_t n) |
This functions permits to print a dsp32_t typed number. | |
void | dsp32_debug_print_complex (dsp32_complex_t *n) |
This functions permits to print a dsp32_complex_t typed number. | |
void | dsp32_debug_print_complex_vect (dsp32_complex_t *vect, int size) |
This functions permits to print a dsp32_complex_t typed vector. | |
void | dsp32_debug_print_vect (dsp32_t *vect, int size) |
This functions permits to print a dsp32_t typed vector. | |
void | dsp_debug_initialization__ (char *date, char *time, int fosc) |
void | dsp_debug_print (int nb_bits, int q, int n) |
Generic function to print all kind of Q formatted numbers. | |
void | dsp_debug_print_complex (int nb_bits, int q, int real, int imag) |
Generic function to print all kind of complex Q formatted numbers. | |
void | dsp_debug_print_fct (char *str) |
This function is used to print a string through the peripheral used by the debugging module. | |
char * | dsp_debug_print_si (int n) |
char * | dsp_debug_print_ui (unsigned int n) |
int | dsp_debug_sprint (char **out, int nb_bits, int q, int i) |
Generic function to print all kind of Q formatted numbers. | |
int | dsp_debug_sprint_after_radix (char **out, unsigned int num, unsigned int den, int nb_digits) |
This functions permits to copy the digits after the radix of a division's result in the specified buffer. | |
int | dsp_debug_sprint_fct (char **out, char *str) |
Print a string inside a buffer. | |
Variables | |
char | dsp_debug_buffer [DSP_DEBUG_BUFFER_SIZE] |
Shared buffer to store temporary data. |
void dsp_debug_initialization__ | ( | char * | date, | |
char * | time, | |||
int | fosc | |||
) |
Definition at line 105 of file dsp_debug_print.c.
References dsp_debug_init().
00106 { 00107 // initialization 00108 dsp_debug_init(fosc); 00109 }
char * dsp_debug_print_si | ( | int | n | ) |
Definition at line 83 of file dsp_debug_print.c.
References dsp_debug_print_ui().
00084 { 00085 char *pdsp_debug_buffer; 00086 00087 // If the number is negative 00088 if (n < 0) 00089 { 00090 // Print the absolute value of this number 00091 pdsp_debug_buffer = dsp_debug_print_ui((unsigned int) (-n)); 00092 // Add the character '-' in front of the string 00093 pdsp_debug_buffer--; 00094 *pdsp_debug_buffer = '-'; 00095 } 00096 // Else 00097 else 00098 // Print this number as if it was an "unsigned int" number 00099 pdsp_debug_buffer = dsp_debug_print_ui((unsigned int) n); 00100 00101 return pdsp_debug_buffer; 00102 }
char * dsp_debug_print_ui | ( | unsigned int | n | ) |
Definition at line 63 of file dsp_debug_print.c.
References dsp_debug_buffer.
Referenced by dsp16_debug_print_complex_vect(), dsp16_debug_print_vect(), dsp32_debug_print_complex_vect(), dsp32_debug_print_vect(), dsp_debug_print_si(), and dsp_debug_sprint().
00064 { 00065 int i = sizeof(dsp_debug_buffer)-1; 00066 00067 // Point to the end of the buffer and set a EOL sign 00068 dsp_debug_buffer[i] = '\0'; 00069 do 00070 { 00071 // Get the modulo 10 of the number and print this rest 00072 dsp_debug_buffer[--i] = '0' + n%10; 00073 // Divide per 10 this number 00074 n /= 10; 00075 // This until n reachs 0 00076 }while(n); 00077 00078 // Returns a pointer on the begining of the generated string 00079 return &dsp_debug_buffer[i]; 00080 }
int dsp_debug_sprint_fct | ( | char ** | out, | |
char * | str | |||
) |
Print a string inside a buffer.
Definition at line 268 of file dsp_debug_print.c.
Referenced by dsp_debug_sprint(), and dsp_debug_sprint_after_radix().
00269 { 00270 int n = 0; 00271 00272 // Main loop 00273 while(*str) 00274 { 00275 n++; 00276 *(*out)++ = *str++; 00277 } 00278 **out = '\0'; 00279 00280 // Return the length of the string 00281 return n; 00282 }
char dsp_debug_buffer[DSP_DEBUG_BUFFER_SIZE] |
Shared buffer to store temporary data.
Definition at line 50 of file dsp_debug_print.c.
Referenced by dsp16_debug_printf(), dsp32_debug_printf(), dsp_debug_print(), dsp_debug_print_ui(), dsp_debug_read_ui(), and dsp_sprint_ui().