Debugging tool for mbed enabled microcontrollers, especially for NUCLEO-F303RE and STM32F042F6P6.
Diff: Debug.h
- Revision:
- 24:014f13c3f871
- Parent:
- 23:e1ffe5277331
- Child:
- 25:cda8a4f9874a
--- a/Debug.h Sun Mar 21 20:32:26 2021 +0000 +++ b/Debug.h Sun Mar 21 20:40:27 2021 +0000 @@ -134,7 +134,7 @@ /** Perform one breakpoint and print one register value * @param line_number line number of breakpoint, macro __LINE__ could be used. - * @param address address of register, must be divisible by 4 + * @param address address of register, must be divisible by 4 or it will be floored to value divisible by 4. */ void breakpoint(int line_number, uint32_t address); @@ -367,58 +367,58 @@ void print_binary(uint32_t value); }; -//------------------------------------------------------------------------------------------------------------------ -/** Debug_register_print class. - * - * Example program: - * @code - * // ---------------------------------------------------------------------------- - * // Author: Lukas Bielesch - * // Department of Measurement, Czech technical university in Prague, Czech Republic - * // Date of publication: 15. Apr 2019 - * // ---------------------------------------------------------------------------- - * #include "Debug.h" - * AnalogIn analog(PA_4); - * PwmOut pwm(PA_6); - * DigitalOut out(PA_5); - * Debug_register_print pc(PA_2, PA_3, 115200); - * - * int main(){ - * pc.format(2,2,1,3);//breakpoint count,line number, address, value - * pc.breakpoint(__LINE__,0x48000001, 2); - * DigitalOut out2 (PA_0); - * pc.breakpoint(__LINE__,0x48000014, -3); - * AnalogIn analog2 (PA_1); - * pc.breakpoint(__LINE__,0x48000008); - * - * while(1){ - * wait(1); - * } - * } - * @endcode - */ +////------------------------------------------------------------------------------------------------------------------ +///** Debug_register_print class. +// * +// * Example program: +// * @code +// * // ---------------------------------------------------------------------------- +// * // Author: Lukas Bielesch +// * // Department of Measurement, Czech technical university in Prague, Czech Republic +// * // Date of publication: 15. Apr 2019 +// * // ---------------------------------------------------------------------------- +// * #include "Debug.h" +// * AnalogIn analog(PA_4); +// * PwmOut pwm(PA_6); +// * DigitalOut out(PA_5); +// * Debug_register_print pc(PA_2, PA_3, 115200); +// * +// * int main(){ +// * pc.format(2,2,1,3);//breakpoint count,line number, address, value +// * pc.breakpoint(__LINE__,0x48000001, 2); +// * DigitalOut out2 (PA_0); +// * pc.breakpoint(__LINE__,0x48000014, -3); +// * AnalogIn analog2 (PA_1); +// * pc.breakpoint(__LINE__,0x48000008); +// * +// * while(1){ +// * wait(1); +// * } +// * } +// * @endcode +// */ class Debug_register_print { public: - /** Create object of Debug_register_print class - * @param tx_pin TX pin of debug serial port - * @param rx_pin RX pin of debug serial port - * @param baudrate(optional) desired baudrate value of debug serial port, default baudrate is 115200 Bd/s +// /** Create object of Debug_register_print class +// * @param tx_pin TX pin of debug serial port +// * @param rx_pin RX pin of debug serial port +// * @param baudrate(optional) desired baudrate value of debug serial port, default baudrate is 115200 Bd/s */ Debug_register_print(PinName tx_pin, PinName rx_pin, int baudrate = 115200); - /** Set format of breakpoint message - * @param break_number format of number of actual breakpoint: 0->not show, 1->show in hexadecimal, 2->show in decimal(default) - * @param line format of line of actual breakpoint: 0->not show, 1->show in hexadecimal, 2->show in decimal(default) - * @param address format of address of register: 0->not show, 1->show in hexadecimal(default), 2->show in decimal - * @param value format of register value: 0->not show, 1->show in hexadecimal, 2->show in decimal, 3->show in binary(default) - */ +// /** Set format of breakpoint message +// * @param break_number format of number of actual breakpoint: 0->not show, 1->show in hexadecimal, 2->show in decimal(default) +// * @param line format of line of actual breakpoint: 0->not show, 1->show in hexadecimal, 2->show in decimal(default) +// * @param address format of address of register: 0->not show, 1->show in hexadecimal(default), 2->show in decimal +// * @param value format of register value: 0->not show, 1->show in hexadecimal, 2->show in decimal, 3->show in binary(default) +// */ void format(int break_number = 2, int line = 2, int address = 1, int value = 3); - /** Perform one breakpoint and print one register value - * @param line_number line number of breakpoint, macro __LINE__ is recommended - * @param address address of register , must be divisible by 4 - */ + // /** Perform one breakpoint and print one register value +// * @param line_number line number of breakpoint, macro __LINE__ is recommended +// * @param address address of register , must be divisible by 4 +// */ void breakpoint(int line_number, uint32_t address, int number_of_words = 1);