debug tool for STM32F042F6P6
Diff: Debug.h
- Revision:
- 24:bc7c4e8f3fe0
- Parent:
- 23:2e1f37405365
- Child:
- 25:807b447e4995
--- a/Debug.h Thu May 09 21:37:50 2019 +0000 +++ b/Debug.h Mon May 27 00:15:37 2019 +0000 @@ -1,5 +1,19 @@ #pragma once +// define constants +//------------------------------------------------------------------------------------------------------------------ +#define AFRL_Offset 0x20 +#define AFRH_Offset 0x24 +#define MODER_Offset 0x00 +#define PUPDR_Offset 0x0C +#define OSPEEDR_Offset 0x08 +#define OTYPER_Offset 0x04 +#define IDR_Offset 0x10 +#define ODR_Offset 0x14 +#define gpioa 0x48000000 +#define gpiob 0x48000400 +#define gpiof 0x48001400 + // include files //------------------------------------------------------------------------------------------------------------------ #include "mbed.h" @@ -14,7 +28,6 @@ extern "C" int check_1_bit(uint32_t gpiox, uint32_t offset, uint32_t pin); extern "C" int check_2_bit(uint32_t gpiox, uint32_t offset, uint32_t pin); extern "C" int check_alternative_mode(uint32_t gpiox, uint32_t offset, uint32_t pin); -extern "C" int read_word(uint32_t address, uint32_t offset); // structs //------------------------------------------------------------------------------------------------------------------ @@ -94,14 +107,13 @@ void show_pwm_config(int timer, int channel); // print configuration of pin in analog input mode void show_analog_config(int channel); - // print configuration of adc1 converter + // print configuration of adc1 void show_adc1_config(); - //print configuration of board's clock + //print configuration of system clock void show_clk_config(); - // clear screen from m line up to n line - //void clear_from_n_up_to_m(int m, int n); - //initialization function + // initialization function void init(); + // prit line to serial port void line(); };