Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Disassembly of section .text:
- 080000b8 <__ctzsi2>:
- 80000b8: 4241 negs r1, r0
- 80000ba: 4008 ands r0, r1
- 80000bc: 211c movs r1, #28
- 80000be: 2301 movs r3, #1
- 80000c0: 041b lsls r3, r3, #16
- 80000c2: 4298 cmp r0, r3
- 80000c4: d301 bcc.n 80000ca <__ctzsi2+0x12>
- 80000c6: 0c00 lsrs r0, r0, #16
- 80000c8: 3910 subs r1, #16
- 80000ca: 0a1b lsrs r3, r3, #8
- 80000cc: 4298 cmp r0, r3
- 80000ce: d301 bcc.n 80000d4 <__ctzsi2+0x1c>
- 80000d0: 0a00 lsrs r0, r0, #8
- 80000d2: 3908 subs r1, #8
- 80000d4: 091b lsrs r3, r3, #4
- 80000d6: 4298 cmp r0, r3
- 80000d8: d301 bcc.n 80000de <__ctzsi2+0x26>
- 80000da: 0900 lsrs r0, r0, #4
- 80000dc: 3904 subs r1, #4
- 80000de: a202 add r2, pc, #8 @ (adr r2, 80000e8 <__ctzsi2+0x30>)
- 80000e0: 5c10 ldrb r0, [r2, r0]
- 80000e2: 1a40 subs r0, r0, r1
- 80000e4: 4770 bx lr
- 80000e6: 46c0 nop @ (mov r8, r8)
- 80000e8: 1d1d1c1b .word 0x1d1d1c1b
- 80000ec: 1e1e1e1e .word 0x1e1e1e1e
- 80000f0: 1f1f1f1f .word 0x1f1f1f1f
- 80000f4: 1f1f1f1f .word 0x1f1f1f1f
- 080000f8 <deregister_tm_clones>:
- 80000f8: 4804 ldr r0, [pc, #16] @ (800010c <deregister_tm_clones+0x14>)
- 80000fa: 4b05 ldr r3, [pc, #20] @ (8000110 <deregister_tm_clones+0x18>)
- 80000fc: b510 push {r4, lr}
- 80000fe: 4283 cmp r3, r0
- 8000100: d003 beq.n 800010a <deregister_tm_clones+0x12>
- 8000102: 4b04 ldr r3, [pc, #16] @ (8000114 <deregister_tm_clones+0x1c>)
- 8000104: 2b00 cmp r3, #0
- 8000106: d000 beq.n 800010a <deregister_tm_clones+0x12>
- 8000108: 4798 blx r3
- 800010a: bd10 pop {r4, pc}
- 800010c: 20000004 .word 0x20000004
- 8000110: 20000004 .word 0x20000004
- 8000114: 00000000 .word 0x00000000
- 08000118 <register_tm_clones>:
- 8000118: 4806 ldr r0, [pc, #24] @ (8000134 <register_tm_clones+0x1c>)
- 800011a: 4907 ldr r1, [pc, #28] @ (8000138 <register_tm_clones+0x20>)
- 800011c: 1a09 subs r1, r1, r0
- 800011e: 108b asrs r3, r1, #2
- 8000120: 0fc9 lsrs r1, r1, #31
- 8000122: 18c9 adds r1, r1, r3
- 8000124: b510 push {r4, lr}
- 8000126: 1049 asrs r1, r1, #1
- 8000128: d003 beq.n 8000132 <register_tm_clones+0x1a>
- 800012a: 4b04 ldr r3, [pc, #16] @ (800013c <register_tm_clones+0x24>)
- 800012c: 2b00 cmp r3, #0
- 800012e: d000 beq.n 8000132 <register_tm_clones+0x1a>
- 8000130: 4798 blx r3
- 8000132: bd10 pop {r4, pc}
- 8000134: 20000004 .word 0x20000004
- 8000138: 20000004 .word 0x20000004
- 800013c: 00000000 .word 0x00000000
- 08000140 <__do_global_dtors_aux>:
- 8000140: b510 push {r4, lr}
- 8000142: 4c07 ldr r4, [pc, #28] @ (8000160 <__do_global_dtors_aux+0x20>)
- 8000144: 7823 ldrb r3, [r4, #0]
- 8000146: 2b00 cmp r3, #0
- 8000148: d109 bne.n 800015e <__do_global_dtors_aux+0x1e>
- 800014a: f7ff ffd5 bl 80000f8 <deregister_tm_clones>
- 800014e: 4b05 ldr r3, [pc, #20] @ (8000164 <__do_global_dtors_aux+0x24>)
- 8000150: 2b00 cmp r3, #0
- 8000152: d002 beq.n 800015a <__do_global_dtors_aux+0x1a>
- 8000154: 4804 ldr r0, [pc, #16] @ (8000168 <__do_global_dtors_aux+0x28>)
- 8000156: e000 b.n 800015a <__do_global_dtors_aux+0x1a>
- 8000158: bf00 nop
- 800015a: 2301 movs r3, #1
- 800015c: 7023 strb r3, [r4, #0]
- 800015e: bd10 pop {r4, pc}
- 8000160: 20000004 .word 0x20000004
- 8000164: 00000000 .word 0x00000000
- 8000168: 08000b48 .word 0x08000b48
- 0800016c <frame_dummy>:
- 800016c: 4b05 ldr r3, [pc, #20] @ (8000184 <frame_dummy+0x18>)
- 800016e: b510 push {r4, lr}
- 8000170: 2b00 cmp r3, #0
- 8000172: d003 beq.n 800017c <frame_dummy+0x10>
- 8000174: 4904 ldr r1, [pc, #16] @ (8000188 <frame_dummy+0x1c>)
- 8000176: 4805 ldr r0, [pc, #20] @ (800018c <frame_dummy+0x20>)
- 8000178: e000 b.n 800017c <frame_dummy+0x10>
- 800017a: bf00 nop
- 800017c: f7ff ffcc bl 8000118 <register_tm_clones>
- 8000180: bd10 pop {r4, pc}
- 8000182: 46c0 nop @ (mov r8, r8)
- 8000184: 00000000 .word 0x00000000
- 8000188: 20000008 .word 0x20000008
- 800018c: 08000b48 .word 0x08000b48
- 08000190 <(anonymous namespace)::HandleButtonPress(mcu::stm32g070::Gpio::GpioId)>:
- #include "platform/mcu-hal/gpio.hpp"
- namespace {
- bool button_pressed = false;
- void HandleButtonPress([[maybe_unused]] GpioId pin) {
- button_pressed = true;
- 8000190: 4b01 ldr r3, [pc, #4] @ (8000198 <(anonymous namespace)::HandleButtonPress(mcu::stm32g070::Gpio::GpioId)+0x8>)
- 8000192: 2201 movs r2, #1
- 8000194: 701a strb r2, [r3, #0]
- }
- 8000196: 4770 bx lr
- 8000198: 20000020 .word 0x20000020
- 0800019c <void rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::FunctionStub<&(anonymous namespace)::HandleButtonPress>(void*, mcu::stm32g070::Gpio::GpioId)>:
- using StubType = ReturnType (*)(void*, Args...);
- void* object_ptr = nullptr;
- StubType stub_ptr = nullptr;
- template <ReturnType (*Function)(Args...)>
- static ReturnType FunctionStub(void*, Args... args) {
- 800019c: b510 push {r4, lr}
- 800019e: 0008 movs r0, r1
- return Function(std::forward<Args>(args)...);
- 80001a0: f7ff fff6 bl 8000190 <(anonymous namespace)::HandleButtonPress(mcu::stm32g070::Gpio::GpioId)>
- }
- 80001a4: bd10 pop {r4, pc}
- 080001a6 <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)>:
- void Transmit(const uint8_t *data, size_t len) {
- impl_.Transmit(data, len);
- }
- void Transmit(const char *str) {
- 80001a6: b570 push {r4, r5, r6, lr}
- 80001a8: 0005 movs r5, r0
- 80001aa: 000c movs r4, r1
- while (*str != '\0') {
- 80001ac: e005 b.n 80001ba <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)+0x14>
- impl_.Transmit(reinterpret_cast<const uint8_t *>(str), 1);
- 80001ae: 2201 movs r2, #1
- 80001b0: 0021 movs r1, r4
- 80001b2: 0028 movs r0, r5
- 80001b4: f000 fbe7 bl 8000986 <mcu::stm32g070::Uart::Transmit(unsigned char const*, unsigned int)>
- str++;
- 80001b8: 3401 adds r4, #1
- while (*str != '\0') {
- 80001ba: 7823 ldrb r3, [r4, #0]
- 80001bc: 2b00 cmp r3, #0
- 80001be: d1f6 bne.n 80001ae <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)+0x8>
- }
- }
- 80001c0: bd70 pop {r4, r5, r6, pc}
- ...
- 080001c4 <main>:
- } // namespace
- extern "C" int main(void) {
- 80001c4: b530 push {r4, r5, lr}
- 80001c6: b087 sub sp, #28
- Board::Init();
- 80001c8: f000 f85c bl 8000284 <Board::Init()>
- LogicLevel Read() {
- return Impl::Read(pinId);
- }
- void Write(LogicLevel value) {
- Impl::Write(pinId, value);
- 80001cc: 2100 movs r1, #0
- 80001ce: 2005 movs r0, #5
- 80001d0: f000 f9ed bl 80005ae <mcu::stm32g070::Gpio::Write(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::LogicLevel)>
- bool operator!=(const Delegate& other) const {
- return !(*this == other);
- }
- private:
- Delegate(void* object, StubType stub) : object_ptr(object), stub_ptr(stub) {
- 80001d4: 2200 movs r2, #0
- 80001d6: 9200 str r2, [sp, #0]
- 80001d8: 4b16 ldr r3, [pc, #88] @ (8000234 <main+0x70>)
- 80001da: 9301 str r3, [sp, #4]
- : object_ptr(other.object_ptr), stub_ptr(other.stub_ptr) {
- 80001dc: 9202 str r2, [sp, #8]
- 80001de: 9303 str r3, [sp, #12]
- 80001e0: 9204 str r2, [sp, #16]
- 80001e2: 9305 str r3, [sp, #20]
- Impl::Toggle(pinId);
- }
- void ConfigureInterrupt(InterruptEvent interrupt_mode,
- InterruptDelegate callback) {
- Impl::ConfigureInterrupt(pinId, interrupt_mode, callback);
- 80001e4: aa04 add r2, sp, #16
- 80001e6: 2101 movs r1, #1
- 80001e8: 202d movs r0, #45 @ 0x2d
- 80001ea: f000 fa09 bl 8000600 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)>
- IOPin<BoardPin::kButton> button;
- auto button_handler = GpioInterruptFunc::Create<HandleButtonPress>();
- button.ConfigureInterrupt(mcu::hal::gpio::InterruptEvent::kFallingEdge,
- button_handler);
- auto &console_uart = Board::ConsoleUart();
- 80001ee: f000 f86f bl 80002d0 <Board::ConsoleUart()>
- 80001f2: 0005 movs r5, r0
- impl_.Enable();
- 80001f4: f000 fbb8 bl 8000968 <mcu::stm32g070::Uart::Enable()>
- console_uart.Enable();
- console_uart.Transmit("Board Init Complete\n");
- 80001f8: 490f ldr r1, [pc, #60] @ (8000238 <main+0x74>)
- 80001fa: 0028 movs r0, r5
- 80001fc: f7ff ffd3 bl 80001a6 <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)>
- uint32_t counter = 0;
- 8000200: 2400 movs r4, #0
- while (true) {
- if (counter == 0x1ffff0) {
- 8000202: 4b0e ldr r3, [pc, #56] @ (800023c <main+0x78>)
- 8000204: 429c cmp r4, r3
- 8000206: d00c beq.n 8000222 <main+0x5e>
- led.Toggle();
- counter = 0;
- console_uart.Transmit("Hello World!\n");
- }
- counter++;
- 8000208: 3401 adds r4, #1
- if (button_pressed) {
- 800020a: 4b0d ldr r3, [pc, #52] @ (8000240 <main+0x7c>)
- 800020c: 781b ldrb r3, [r3, #0]
- 800020e: 2b00 cmp r3, #0
- 8000210: d0f7 beq.n 8000202 <main+0x3e>
- console_uart.Transmit("Button pressed\n");
- 8000212: 490c ldr r1, [pc, #48] @ (8000244 <main+0x80>)
- 8000214: 0028 movs r0, r5
- 8000216: f7ff ffc6 bl 80001a6 <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)>
- button_pressed = false;
- 800021a: 4b09 ldr r3, [pc, #36] @ (8000240 <main+0x7c>)
- 800021c: 2200 movs r2, #0
- 800021e: 701a strb r2, [r3, #0]
- 8000220: e7ef b.n 8000202 <main+0x3e>
- Impl::Toggle(pinId);
- 8000222: 2005 movs r0, #5
- 8000224: f000 f9d6 bl 80005d4 <mcu::stm32g070::Gpio::Toggle(mcu::stm32g070::Gpio::GpioId)>
- console_uart.Transmit("Hello World!\n");
- 8000228: 4907 ldr r1, [pc, #28] @ (8000248 <main+0x84>)
- 800022a: 0028 movs r0, r5
- 800022c: f7ff ffbb bl 80001a6 <mcu::hal::Uart<mcu::stm32g070::Uart>::Transmit(char const*)>
- counter = 0;
- 8000230: 2400 movs r4, #0
- 8000232: e7e9 b.n 8000208 <main+0x44>
- 8000234: 0800019d .word 0x0800019d
- 8000238: 08000b60 .word 0x08000b60
- 800023c: 001ffff0 .word 0x001ffff0
- 8000240: 20000020 .word 0x20000020
- 8000244: 08000b88 .word 0x08000b88
- 8000248: 08000b78 .word 0x08000b78
- 0800024c <__assert_func>:
- __attribute__((noreturn)) void __assert_func(
- [[maybe_unused]] const char* file, [[maybe_unused]] int line,
- [[maybe_unused]] const char* func,
- [[maybe_unused]] const char* failedexpr) {
- while (1) {
- 800024c: e7fe b.n 800024c <__assert_func>
- ...
- 08000250 <Board::Board()>:
- .rx_pin = static_cast<GpioId>(BoardPin::kConsoleUartRx),
- .baud_rate = BaudRate::k115200,
- };
- } // namespace
- Board::Board()
- 8000250: b530 push {r4, r5, lr}
- 8000252: b083 sub sp, #12
- 8000254: 0004 movs r4, r0
- template<contiguous_iterator _It>
- requires __is_compatible_ref<iter_reference_t<_It>>::value
- constexpr explicit(extent != dynamic_extent)
- span(_It __first, size_type __count)
- noexcept
- : _M_ptr(std::to_address(__first)), _M_extent(__count)
- 8000256: 4b09 ldr r3, [pc, #36] @ (800027c <Board::Board()+0x2c>)
- 8000258: 6003 str r3, [r0, #0]
- : _M_extent_value(__extent)
- 800025a: 2304 movs r3, #4
- 800025c: 6043 str r3, [r0, #4]
- 800025e: 466b mov r3, sp
- 8000260: c822 ldmia r0!, {r1, r5}
- 8000262: c322 stmia r3!, {r1, r5}
- : impl_(default_pin_configurations) {
- 8000264: 9900 ldr r1, [sp, #0]
- 8000266: 2204 movs r2, #4
- 8000268: f000 f922 bl 80004b0 <mcu::stm32g070::Gpio::Gpio(std::span<mcu::stm32g070::Gpio::GpioConfig const, 4294967295u>)>
- Uart(UartConfig const &uart_config) : impl_(uart_config) {
- 800026c: 4904 ldr r1, [pc, #16] @ (8000280 <Board::Board()+0x30>)
- 800026e: 0020 movs r0, r4
- 8000270: 3010 adds r0, #16
- 8000272: f000 fb49 bl 8000908 <mcu::stm32g070::Uart::Uart(mcu::stm32g070::Uart::UartConfig const&)>
- : gpio_config_{gpio_config},
- gpio_(gpio_config_),
- console_uart_(console_uart) {
- }
- 8000276: 0020 movs r0, r4
- 8000278: b003 add sp, #12
- 800027a: bd30 pop {r4, r5, pc}
- 800027c: 08001110 .word 0x08001110
- 8000280: 08001108 .word 0x08001108
- 08000284 <Board::Init()>:
- void Board::Init() {
- 8000284: b570 push {r4, r5, r6, lr}
- mcu::stm32g070::SysClock::Init();
- 8000286: f000 fae5 bl 8000854 <mcu::stm32g070::SysClock::Init()>
- assert(instance_ptr == nullptr);
- 800028a: 4b0c ldr r3, [pc, #48] @ (80002bc <Board::Init()+0x38>)
- 800028c: 681b ldr r3, [r3, #0]
- 800028e: 2b00 cmp r3, #0
- 8000290: d10e bne.n 80002b0 <Board::Init()+0x2c>
- instance_ptr = new (board_object_storage) Board();
- 8000292: 4c0b ldr r4, [pc, #44] @ (80002c0 <Board::Init()+0x3c>)
- 8000294: 0020 movs r0, r4
- 8000296: f7ff ffdb bl 8000250 <Board::Board()>
- 800029a: 4d08 ldr r5, [pc, #32] @ (80002bc <Board::Init()+0x38>)
- 800029c: 602c str r4, [r5, #0]
- impl_.ConfigureAllToDefault();
- 800029e: 0020 movs r0, r4
- 80002a0: 3008 adds r0, #8
- 80002a2: f000 f973 bl 800058c <mcu::stm32g070::Gpio::ConfigureAllToDefault()>
- instance_ptr->gpio_.ConfigureAllToDefault();
- instance_ptr->console_uart_.Init();
- 80002a6: 6828 ldr r0, [r5, #0]
- impl_.Init();
- 80002a8: 3010 adds r0, #16
- 80002aa: f000 fb35 bl 8000918 <mcu::stm32g070::Uart::Init()>
- }
- 80002ae: bd70 pop {r4, r5, r6, pc}
- assert(instance_ptr == nullptr);
- 80002b0: 4b04 ldr r3, [pc, #16] @ (80002c4 <Board::Init()+0x40>)
- 80002b2: 4a05 ldr r2, [pc, #20] @ (80002c8 <Board::Init()+0x44>)
- 80002b4: 4805 ldr r0, [pc, #20] @ (80002cc <Board::Init()+0x48>)
- 80002b6: 2146 movs r1, #70 @ 0x46
- 80002b8: f7ff ffc8 bl 800024c <__assert_func>
- 80002bc: 20000024 .word 0x20000024
- 80002c0: 20000028 .word 0x20000028
- 80002c4: 08000b98 .word 0x08000b98
- 80002c8: 08000bb0 .word 0x08000bb0
- 80002cc: 08000bcc .word 0x08000bcc
- 080002d0 <Board::ConsoleUart()>:
- mcu::hal::Gpio<mcu::stm32g070::Gpio> &Board::Gpio() {
- assert(instance_ptr != nullptr);
- return instance_ptr->gpio_;
- }
- mcu::hal::Uart<mcu::stm32g070::Uart> &Board::ConsoleUart() {
- 80002d0: b510 push {r4, lr}
- assert(instance_ptr != nullptr);
- 80002d2: 4b06 ldr r3, [pc, #24] @ (80002ec <Board::ConsoleUart()+0x1c>)
- 80002d4: 6818 ldr r0, [r3, #0]
- 80002d6: 2800 cmp r0, #0
- 80002d8: d001 beq.n 80002de <Board::ConsoleUart()+0xe>
- return instance_ptr->console_uart_;
- 80002da: 3010 adds r0, #16
- }
- 80002dc: bd10 pop {r4, pc}
- assert(instance_ptr != nullptr);
- 80002de: 4b04 ldr r3, [pc, #16] @ (80002f0 <Board::ConsoleUart()+0x20>)
- 80002e0: 4a04 ldr r2, [pc, #16] @ (80002f4 <Board::ConsoleUart()+0x24>)
- 80002e2: 4805 ldr r0, [pc, #20] @ (80002f8 <Board::ConsoleUart()+0x28>)
- 80002e4: 2152 movs r1, #82 @ 0x52
- 80002e6: f7ff ffb1 bl 800024c <__assert_func>
- 80002ea: 46c0 nop @ (mov r8, r8)
- 80002ec: 20000024 .word 0x20000024
- 80002f0: 08000be8 .word 0x08000be8
- 80002f4: 08000c3c .word 0x08000c3c
- 80002f8: 08000bcc .word 0x08000bcc
- 080002fc <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)>:
- };
- std::array<GpioInterruptInfo, 16> irq_callback_table{};
- GPIO_TypeDef *GetPortRegister(mcu::stm32g070::Gpio::GpioId pin) {
- uint8_t port_num = pin >> kNumPinsPerPortShift;
- 80002fc: 0903 lsrs r3, r0, #4
- switch (port_num) {
- 80002fe: 284f cmp r0, #79 @ 0x4f
- 8000300: d80c bhi.n 800031c <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x20>
- 8000302: 009b lsls r3, r3, #2
- 8000304: 4a07 ldr r2, [pc, #28] @ (8000324 <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x28>)
- 8000306: 58d3 ldr r3, [r2, r3]
- 8000308: 469f mov pc, r3
- 800030a: 20a0 movs r0, #160 @ 0xa0
- 800030c: 05c0 lsls r0, r0, #23
- case 4:
- return GPIOF;
- default:
- return nullptr;
- }
- }
- 800030e: 4770 bx lr
- return GPIOC;
- 8000310: 4805 ldr r0, [pc, #20] @ (8000328 <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x2c>)
- 8000312: e7fc b.n 800030e <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x12>
- return GPIOD;
- 8000314: 4805 ldr r0, [pc, #20] @ (800032c <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x30>)
- 8000316: e7fa b.n 800030e <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x12>
- return GPIOF;
- 8000318: 4805 ldr r0, [pc, #20] @ (8000330 <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x34>)
- 800031a: e7f8 b.n 800030e <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x12>
- return nullptr;
- 800031c: 2000 movs r0, #0
- 800031e: e7f6 b.n 800030e <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x12>
- return GPIOB;
- 8000320: 4804 ldr r0, [pc, #16] @ (8000334 <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x38>)
- 8000322: e7f4 b.n 800030e <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)+0x12>
- 8000324: 08001128 .word 0x08001128
- 8000328: 50000800 .word 0x50000800
- 800032c: 50000c00 .word 0x50000c00
- 8000330: 50001400 .word 0x50001400
- 8000334: 50000400 .word 0x50000400
- 08000338 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)>:
- void SetPullResistor(GPIO_TypeDef *port, uint8_t port_pin,
- mcu::stm32g070::Gpio::GpioPullResistor mode) {
- 8000338: b510 push {r4, lr}
- uint8_t bit_value = (mode == mcu::stm32g070::Gpio::kPullNone) ? 0b00
- 800033a: 2a02 cmp r2, #2
- 800033c: d003 beq.n 8000346 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0xe>
- 800033e: 2a00 cmp r2, #0
- 8000340: d110 bne.n 8000364 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0x2c>
- 8000342: 3201 adds r2, #1
- 8000344: e000 b.n 8000348 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0x10>
- 8000346: 2200 movs r2, #0
- : (mode == mcu::stm32g070::Gpio::kPullUp)
- ? 0b01
- : 0b10; // pull-down
- port->PUPDR &= ~(0b11 << (port_pin < 1));
- 8000348: 68c4 ldr r4, [r0, #12]
- 800034a: 2900 cmp r1, #0
- 800034c: d10c bne.n 8000368 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0x30>
- 800034e: 2307 movs r3, #7
- 8000350: 425b negs r3, r3
- 8000352: 4023 ands r3, r4
- 8000354: 60c3 str r3, [r0, #12]
- port->PUPDR |= bit_value << (port_pin < 1);
- 8000356: 68c3 ldr r3, [r0, #12]
- 8000358: 424c negs r4, r1
- 800035a: 4161 adcs r1, r4
- 800035c: 408a lsls r2, r1
- 800035e: 4313 orrs r3, r2
- 8000360: 60c3 str r3, [r0, #12]
- }
- 8000362: bd10 pop {r4, pc}
- uint8_t bit_value = (mode == mcu::stm32g070::Gpio::kPullNone) ? 0b00
- 8000364: 2202 movs r2, #2
- 8000366: e7ef b.n 8000348 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0x10>
- port->PUPDR &= ~(0b11 << (port_pin < 1));
- 8000368: 2304 movs r3, #4
- 800036a: 425b negs r3, r3
- 800036c: e7f1 b.n 8000352 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)+0x1a>
- 0800036e <(anonymous namespace)::SetOutputConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioOutputType, mcu::stm32g070::Gpio::GpioOutputSpeed)>:
- void SetOutputConfig(GPIO_TypeDef *port, uint8_t port_pin,
- mcu::stm32g070::Gpio::GpioOutputType output_type,
- mcu::stm32g070::Gpio::GpioOutputSpeed speed) {
- 800036e: b510 push {r4, lr}
- 8000370: 001c movs r4, r3
- if (output_type == mcu::stm32g070::Gpio::kPushPull) {
- 8000372: 2a00 cmp r2, #0
- 8000374: d10e bne.n 8000394 <(anonymous namespace)::SetOutputConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioOutputType, mcu::stm32g070::Gpio::GpioOutputSpeed)+0x26>
- port->OTYPER &= ~(0b1 << port_pin);
- 8000376: 6843 ldr r3, [r0, #4]
- 8000378: 3201 adds r2, #1
- 800037a: 408a lsls r2, r1
- 800037c: 4393 bics r3, r2
- 800037e: 6043 str r3, [r0, #4]
- } else {
- port->OTYPER |= 0b1 << port_pin;
- }
- port->OSPEEDR &= ~(0b11 << port_pin);
- 8000380: 6883 ldr r3, [r0, #8]
- 8000382: 2203 movs r2, #3
- 8000384: 408a lsls r2, r1
- 8000386: 4393 bics r3, r2
- 8000388: 6083 str r3, [r0, #8]
- port->OSPEEDR |= speed << port_pin;
- 800038a: 6883 ldr r3, [r0, #8]
- 800038c: 408c lsls r4, r1
- 800038e: 4323 orrs r3, r4
- 8000390: 6083 str r3, [r0, #8]
- }
- 8000392: bd10 pop {r4, pc}
- port->OTYPER |= 0b1 << port_pin;
- 8000394: 6843 ldr r3, [r0, #4]
- 8000396: 2201 movs r2, #1
- 8000398: 408a lsls r2, r1
- 800039a: 4313 orrs r3, r2
- 800039c: 6043 str r3, [r0, #4]
- 800039e: e7ef b.n 8000380 <(anonymous namespace)::SetOutputConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioOutputType, mcu::stm32g070::Gpio::GpioOutputSpeed)+0x12>
- 080003a0 <(anonymous namespace)::SetAltConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioAltFunc)>:
- void SetAltConfig(GPIO_TypeDef *port, uint8_t port_pin,
- mcu::stm32g070::Gpio::GpioAltFunc af) {
- 80003a0: b530 push {r4, r5, lr}
- uint8_t low_hi_sel = port_pin >> 3;
- 80003a2: 08cb lsrs r3, r1, #3
- uint8_t af_pin_shift = (port_pin & 0x7) << 2;
- 80003a4: 0089 lsls r1, r1, #2
- 80003a6: 241c movs r4, #28
- 80003a8: 4021 ands r1, r4
- port->AFR[low_hi_sel] &= ~(0xf << af_pin_shift);
- 80003aa: 3308 adds r3, #8
- 80003ac: 009b lsls r3, r3, #2
- 80003ae: 581c ldr r4, [r3, r0]
- 80003b0: 250f movs r5, #15
- 80003b2: 408d lsls r5, r1
- 80003b4: 43ac bics r4, r5
- 80003b6: 501c str r4, [r3, r0]
- port->AFR[low_hi_sel] |= (af << af_pin_shift);
- 80003b8: 581c ldr r4, [r3, r0]
- 80003ba: 408a lsls r2, r1
- 80003bc: 4314 orrs r4, r2
- 80003be: 501c str r4, [r3, r0]
- }
- 80003c0: bd30 pop {r4, r5, pc}
- ...
- 080003c4 <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)>:
- GpioPortRefCounter io_port_ref_counters[kNumPorts];
- void EnablePortClockIfFirstUse(GpioPortId port_id) {
- GpioPortRefCounter *ref_counter = &io_port_ref_counters[port_id];
- uint8_t ref_count = ref_counter->gpio_ref_count + ref_counter->adc_ref_count;
- 80003c4: 4b08 ldr r3, [pc, #32] @ (80003e8 <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)+0x24>)
- 80003c6: 0041 lsls r1, r0, #1
- 80003c8: 5cca ldrb r2, [r1, r3]
- 80003ca: 185b adds r3, r3, r1
- 80003cc: 785b ldrb r3, [r3, #1]
- 80003ce: 18d3 adds r3, r2, r3
- 80003d0: b2db uxtb r3, r3
- if (ref_count == 1) {
- 80003d2: 2b01 cmp r3, #1
- 80003d4: d000 beq.n 80003d8 <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)+0x14>
- // First instance of IO port usage, enable RCC IO port clock
- uint32_t mask = 0b1 << port_id;
- RCC->IOPENR |= mask;
- }
- }
- 80003d6: 4770 bx lr
- uint32_t mask = 0b1 << port_id;
- 80003d8: 2201 movs r2, #1
- 80003da: 4082 lsls r2, r0
- RCC->IOPENR |= mask;
- 80003dc: 4903 ldr r1, [pc, #12] @ (80003ec <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)+0x28>)
- 80003de: 6b4b ldr r3, [r1, #52] @ 0x34
- 80003e0: 4313 orrs r3, r2
- 80003e2: 634b str r3, [r1, #52] @ 0x34
- }
- 80003e4: e7f7 b.n 80003d6 <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)+0x12>
- 80003e6: 46c0 nop @ (mov r8, r8)
- 80003e8: 20000050 .word 0x20000050
- 80003ec: 40021000 .word 0x40021000
- 080003f0 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)>:
- GpioPortId GetPortIdFromPortRegisters(GPIO_TypeDef *port) {
- 80003f0: b510 push {r4, lr}
- if (port == GPIOA) {
- 80003f2: 23a0 movs r3, #160 @ 0xa0
- 80003f4: 05db lsls r3, r3, #23
- 80003f6: 4298 cmp r0, r3
- 80003f8: d013 beq.n 8000422 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x32>
- } else if (port == GPIOB) {
- 80003fa: 4b0e ldr r3, [pc, #56] @ (8000434 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x44>)
- 80003fc: 4298 cmp r0, r3
- 80003fe: d012 beq.n 8000426 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x36>
- } else if (port == GPIOC) {
- 8000400: 4b0d ldr r3, [pc, #52] @ (8000438 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x48>)
- 8000402: 4298 cmp r0, r3
- 8000404: d011 beq.n 800042a <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x3a>
- } else if (port == GPIOD) {
- 8000406: 4b0d ldr r3, [pc, #52] @ (800043c <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x4c>)
- 8000408: 4298 cmp r0, r3
- 800040a: d010 beq.n 800042e <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x3e>
- } else if (port == GPIOF) {
- 800040c: 4b0c ldr r3, [pc, #48] @ (8000440 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x50>)
- 800040e: 4298 cmp r0, r3
- 8000410: d101 bne.n 8000416 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x26>
- return kPortF;
- 8000412: 2004 movs r0, #4
- }
- 8000414: bd10 pop {r4, pc}
- assert(0);
- 8000416: 4b0b ldr r3, [pc, #44] @ (8000444 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x54>)
- 8000418: 4a0b ldr r2, [pc, #44] @ (8000448 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x58>)
- 800041a: 480c ldr r0, [pc, #48] @ (800044c <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x5c>)
- 800041c: 2154 movs r1, #84 @ 0x54
- 800041e: f7ff ff15 bl 800024c <__assert_func>
- return kPortA;
- 8000422: 2000 movs r0, #0
- 8000424: e7f6 b.n 8000414 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x24>
- return kPortB;
- 8000426: 2001 movs r0, #1
- 8000428: e7f4 b.n 8000414 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x24>
- return kPortC;
- 800042a: 2002 movs r0, #2
- 800042c: e7f2 b.n 8000414 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x24>
- return kPortD;
- 800042e: 2003 movs r0, #3
- 8000430: e7f0 b.n 8000414 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)+0x24>
- 8000432: 46c0 nop @ (mov r8, r8)
- 8000434: 50000400 .word 0x50000400
- 8000438: 50000800 .word 0x50000800
- 800043c: 50000c00 .word 0x50000c00
- 8000440: 50001400 .word 0x50001400
- 8000444: 08000c80 .word 0x08000c80
- 8000448: 08000c84 .word 0x08000c84
- 800044c: 08000cd4 .word 0x08000cd4
- 08000450 <(anonymous namespace)::IncrementPortClockRefCount(GPIO_TypeDef*)>:
- if (ref_count == 0) {
- // TODO: Disable RCC IO port clock
- }
- }
- void IncrementPortClockRefCount(GPIO_TypeDef *port) {
- 8000450: b510 push {r4, lr}
- GpioPortId port_id = GetPortIdFromPortRegisters(port);
- 8000452: f7ff ffcd bl 80003f0 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)>
- io_port_ref_counters[port_id].gpio_ref_count++;
- 8000456: 4b04 ldr r3, [pc, #16] @ (8000468 <(anonymous namespace)::IncrementPortClockRefCount(GPIO_TypeDef*)+0x18>)
- 8000458: 0041 lsls r1, r0, #1
- 800045a: 5cca ldrb r2, [r1, r3]
- 800045c: 3201 adds r2, #1
- 800045e: 54ca strb r2, [r1, r3]
- EnablePortClockIfFirstUse(port_id);
- 8000460: f7ff ffb0 bl 80003c4 <(anonymous namespace)::EnablePortClockIfFirstUse((anonymous namespace)::GpioPortId)>
- }
- 8000464: bd10 pop {r4, pc}
- 8000466: 46c0 nop @ (mov r8, r8)
- 8000468: 20000050 .word 0x20000050
- 0800046c <(anonymous namespace)::GetPortIdFromPin(mcu::stm32g070::Gpio::GpioId)>:
- GpioPortId GetPortIdFromPin(mcu::stm32g070::Gpio::GpioId pin) {
- 800046c: b510 push {r4, lr}
- return GetPortIdFromPortRegisters(GetPortRegister(pin));
- 800046e: f7ff ff45 bl 80002fc <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)>
- 8000472: f7ff ffbd bl 80003f0 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)>
- }
- 8000476: bd10 pop {r4, pc}
- 08000478 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)>:
- void DecrementPortClockRefCount(GPIO_TypeDef *port) {
- 8000478: b510 push {r4, lr}
- GpioPortId port_id = GetPortIdFromPortRegisters(port);
- 800047a: f7ff ffb9 bl 80003f0 <(anonymous namespace)::GetPortIdFromPortRegisters(GPIO_TypeDef*)>
- assert(io_port_ref_counters[port_id].gpio_ref_count > 0);
- 800047e: 4b08 ldr r3, [pc, #32] @ (80004a0 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x28>)
- 8000480: 0042 lsls r2, r0, #1
- 8000482: 5cd3 ldrb r3, [r2, r3]
- 8000484: 2b00 cmp r3, #0
- 8000486: d004 beq.n 8000492 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x1a>
- io_port_ref_counters[port_id].gpio_ref_count--;
- 8000488: 4a05 ldr r2, [pc, #20] @ (80004a0 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x28>)
- 800048a: 0040 lsls r0, r0, #1
- 800048c: 3b01 subs r3, #1
- 800048e: 5483 strb r3, [r0, r2]
- DisablePortClockIfUnused(port_id);
- }
- 8000490: bd10 pop {r4, pc}
- assert(io_port_ref_counters[port_id].gpio_ref_count > 0);
- 8000492: 4b04 ldr r3, [pc, #16] @ (80004a4 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x2c>)
- 8000494: 4a04 ldr r2, [pc, #16] @ (80004a8 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x30>)
- 8000496: 4805 ldr r0, [pc, #20] @ (80004ac <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)+0x34>)
- 8000498: 217e movs r1, #126 @ 0x7e
- 800049a: f7ff fed7 bl 800024c <__assert_func>
- 800049e: 46c0 nop @ (mov r8, r8)
- 80004a0: 20000050 .word 0x20000050
- 80004a4: 08000d04 .word 0x08000d04
- 80004a8: 08000d38 .word 0x08000d38
- 80004ac: 08000cd4 .word 0x08000cd4
- 080004b0 <mcu::stm32g070::Gpio::Gpio(std::span<mcu::stm32g070::Gpio::GpioConfig const, 4294967295u>)>:
- } // namespace
- namespace mcu::stm32g070 {
- Gpio::Gpio(std::span<const GpioConfig> default_pin_configurations)
- 80004b0: b510 push {r4, lr}
- 80004b2: b082 sub sp, #8
- 80004b4: 466b mov r3, sp
- 80004b6: 9100 str r1, [sp, #0]
- 80004b8: 605a str r2, [r3, #4]
- : default_pin_cfg_{default_pin_configurations} {
- 80004ba: 0002 movs r2, r0
- 80004bc: cb12 ldmia r3!, {r1, r4}
- 80004be: c212 stmia r2!, {r1, r4}
- }
- 80004c0: b002 add sp, #8
- 80004c2: bd10 pop {r4, pc}
- 080004c4 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)>:
- break;
- }
- }
- }
- void Gpio::Configure(GpioId pin, const GpioConfig &config) {
- 80004c4: b5f8 push {r3, r4, r5, r6, r7, lr}
- 80004c6: 0005 movs r5, r0
- 80004c8: 000e movs r6, r1
- GPIO_TypeDef *port = GetPortRegister(pin);
- 80004ca: f7ff ff17 bl 80002fc <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)>
- 80004ce: 1e04 subs r4, r0, #0
- assert(port != nullptr);
- 80004d0: d00a beq.n 80004e8 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x24>
- uint8_t port_pin = pin & kPinMask;
- 80004d2: 200f movs r0, #15
- 80004d4: 4005 ands r5, r0
- uint8_t mode_bit_value =
- (config.mode == mcu::stm32g070::Gpio::kInput) ? 0b00
- 80004d6: 7873 ldrb r3, [r6, #1]
- 80004d8: 2b02 cmp r3, #2
- 80004da: d00b beq.n 80004f4 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x30>
- 80004dc: 2b03 cmp r3, #3
- 80004de: d00b beq.n 80004f8 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x34>
- 80004e0: 2b01 cmp r3, #1
- 80004e2: d123 bne.n 800052c <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x68>
- 80004e4: 2700 movs r7, #0
- 80004e6: e008 b.n 80004fa <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x36>
- assert(port != nullptr);
- 80004e8: 4b25 ldr r3, [pc, #148] @ (8000580 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0xbc>)
- 80004ea: 4a26 ldr r2, [pc, #152] @ (8000584 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0xc0>)
- 80004ec: 4826 ldr r0, [pc, #152] @ (8000588 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0xc4>)
- 80004ee: 21c9 movs r1, #201 @ 0xc9
- 80004f0: f7ff feac bl 800024c <__assert_func>
- (config.mode == mcu::stm32g070::Gpio::kInput) ? 0b00
- 80004f4: 2701 movs r7, #1
- 80004f6: e000 b.n 80004fa <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x36>
- 80004f8: 2702 movs r7, #2
- // TODO: Need to implement reference counting policy to disable the port
- // clock, but for now, just enable the port. Note that explicit setting to
- // analog mode assumes that the pin is being disabled. Analog usage is a
- // separate reference counting call that needs to be done in the ADC driver.
- if (config.mode == mcu::stm32g070::Gpio::kAnalog) {
- 80004fa: 2b00 cmp r3, #0
- 80004fc: d118 bne.n 8000530 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x6c>
- DecrementPortClockRefCount(port);
- 80004fe: 0020 movs r0, r4
- 8000500: f7ff ffba bl 8000478 <(anonymous namespace)::DecrementPortClockRefCount(GPIO_TypeDef*)>
- } else {
- IncrementPortClockRefCount(port);
- }
- if (config.mode == mcu::stm32g070::Gpio::kInput) {
- 8000504: 7873 ldrb r3, [r6, #1]
- 8000506: 2b01 cmp r3, #1
- 8000508: d016 beq.n 8000538 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x74>
- SetPullResistor(port, port_pin, config.input_cfg.pull_resistor);
- } else if (config.mode == mcu::stm32g070::Gpio::kOutput) {
- 800050a: 2b02 cmp r3, #2
- 800050c: d01a beq.n 8000544 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x80>
- SetPullResistor(port, port_pin, config.output_cfg.pull_resistor);
- SetOutputConfig(port, port_pin, config.output_cfg.output_type,
- config.output_cfg.speed);
- } else if (config.mode == mcu::stm32g070::Gpio::kAnalog) {
- 800050e: 2b00 cmp r3, #0
- 8000510: d001 beq.n 8000516 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x52>
- // No-op since pull up/down is automatically disconnected in analog mode
- } else if (config.mode == mcu::stm32g070::Gpio::kAlternateFunc) {
- 8000512: 2b03 cmp r3, #3
- 8000514: d022 beq.n 800055c <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x98>
- config.af_cfg.speed);
- SetAltConfig(port, port_pin, config.af_cfg.alt_func);
- }
- // Set GPIO mode last to avoid glitching
- port->MODER &= ~(0b11 << (port_pin << 1));
- 8000516: 6823 ldr r3, [r4, #0]
- 8000518: 006d lsls r5, r5, #1
- 800051a: 2203 movs r2, #3
- 800051c: 40aa lsls r2, r5
- 800051e: 4393 bics r3, r2
- 8000520: 6023 str r3, [r4, #0]
- port->MODER |= (mode_bit_value << (port_pin << 1));
- 8000522: 6823 ldr r3, [r4, #0]
- 8000524: 40af lsls r7, r5
- 8000526: 433b orrs r3, r7
- 8000528: 6023 str r3, [r4, #0]
- }
- 800052a: bdf8 pop {r3, r4, r5, r6, r7, pc}
- (config.mode == mcu::stm32g070::Gpio::kInput) ? 0b00
- 800052c: 2703 movs r7, #3
- 800052e: e7e4 b.n 80004fa <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x36>
- IncrementPortClockRefCount(port);
- 8000530: 0020 movs r0, r4
- 8000532: f7ff ff8d bl 8000450 <(anonymous namespace)::IncrementPortClockRefCount(GPIO_TypeDef*)>
- 8000536: e7e5 b.n 8000504 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x40>
- SetPullResistor(port, port_pin, config.input_cfg.pull_resistor);
- 8000538: 78b2 ldrb r2, [r6, #2]
- 800053a: 0029 movs r1, r5
- 800053c: 0020 movs r0, r4
- 800053e: f7ff fefb bl 8000338 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)>
- 8000542: e7e8 b.n 8000516 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x52>
- SetPullResistor(port, port_pin, config.output_cfg.pull_resistor);
- 8000544: 7932 ldrb r2, [r6, #4]
- 8000546: 0029 movs r1, r5
- 8000548: 0020 movs r0, r4
- 800054a: f7ff fef5 bl 8000338 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)>
- SetOutputConfig(port, port_pin, config.output_cfg.output_type,
- 800054e: 78b2 ldrb r2, [r6, #2]
- config.output_cfg.speed);
- 8000550: 78f3 ldrb r3, [r6, #3]
- SetOutputConfig(port, port_pin, config.output_cfg.output_type,
- 8000552: 0029 movs r1, r5
- 8000554: 0020 movs r0, r4
- 8000556: f7ff ff0a bl 800036e <(anonymous namespace)::SetOutputConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioOutputType, mcu::stm32g070::Gpio::GpioOutputSpeed)>
- 800055a: e7dc b.n 8000516 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x52>
- SetPullResistor(port, port_pin, config.af_cfg.pull_resistor);
- 800055c: 7972 ldrb r2, [r6, #5]
- 800055e: 0029 movs r1, r5
- 8000560: 0020 movs r0, r4
- 8000562: f7ff fee9 bl 8000338 <(anonymous namespace)::SetPullResistor(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioPullResistor)>
- SetOutputConfig(port, port_pin, config.af_cfg.output_type,
- 8000566: 78f2 ldrb r2, [r6, #3]
- config.af_cfg.speed);
- 8000568: 7933 ldrb r3, [r6, #4]
- SetOutputConfig(port, port_pin, config.af_cfg.output_type,
- 800056a: 0029 movs r1, r5
- 800056c: 0020 movs r0, r4
- 800056e: f7ff fefe bl 800036e <(anonymous namespace)::SetOutputConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioOutputType, mcu::stm32g070::Gpio::GpioOutputSpeed)>
- SetAltConfig(port, port_pin, config.af_cfg.alt_func);
- 8000572: 78b2 ldrb r2, [r6, #2]
- 8000574: 0029 movs r1, r5
- 8000576: 0020 movs r0, r4
- 8000578: f7ff ff12 bl 80003a0 <(anonymous namespace)::SetAltConfig(GPIO_TypeDef*, unsigned char, mcu::stm32g070::Gpio::GpioAltFunc)>
- 800057c: e7cb b.n 8000516 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)+0x52>
- 800057e: 46c0 nop @ (mov r8, r8)
- 8000580: 08000d74 .word 0x08000d74
- 8000584: 08000d84 .word 0x08000d84
- 8000588: 08000cd4 .word 0x08000cd4
- 0800058c <mcu::stm32g070::Gpio::ConfigureAllToDefault()>:
- void Gpio::ConfigureAllToDefault() {
- 800058c: b570 push {r4, r5, r6, lr}
- _GLIBCXX_CONSTEXPR __normal_iterator() _GLIBCXX_NOEXCEPT
- : _M_current(_Iterator()) { }
- explicit _GLIBCXX20_CONSTEXPR
- __normal_iterator(const _Iterator& __i) _GLIBCXX_NOEXCEPT
- : _M_current(__i) { }
- 800058e: 6805 ldr r5, [r0, #0]
- for (auto &config : default_pin_cfg_) {
- 8000590: 002c movs r4, r5
- { return this->_M_extent_value; }
- 8000592: 6842 ldr r2, [r0, #4]
- { return iterator(this->_M_ptr); }
- [[nodiscard]]
- constexpr iterator
- end() const noexcept
- { return iterator(this->_M_ptr + this->size()); }
- 8000594: 0053 lsls r3, r2, #1
- 8000596: 189b adds r3, r3, r2
- 8000598: 005b lsls r3, r3, #1
- 800059a: 18ed adds r5, r5, r3
- 800059c: e004 b.n 80005a8 <mcu::stm32g070::Gpio::ConfigureAllToDefault()+0x1c>
- Gpio::Configure(config.pin, config);
- 800059e: 7820 ldrb r0, [r4, #0]
- 80005a0: 0021 movs r1, r4
- 80005a2: f7ff ff8f bl 80004c4 <mcu::stm32g070::Gpio::Configure(mcu::stm32g070::Gpio::GpioId, mcu::stm32g070::Gpio::GpioConfig const&)>
- _GLIBCXX20_CONSTEXPR
- __normal_iterator&
- operator++() _GLIBCXX_NOEXCEPT
- {
- ++_M_current;
- 80005a6: 3406 adds r4, #6
- for (auto &config : default_pin_cfg_) {
- 80005a8: 42a5 cmp r5, r4
- 80005aa: d1f8 bne.n 800059e <mcu::stm32g070::Gpio::ConfigureAllToDefault()+0x12>
- }
- 80005ac: bd70 pop {r4, r5, r6, pc}
- 080005ae <mcu::stm32g070::Gpio::Write(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::LogicLevel)>:
- uint8_t port_pin = pin & kPinMask;
- uint32_t value = port->IDR & (0b1 << port_pin);
- return value ? Gpio::LogicLevel::kHigh : Gpio::LogicLevel::kLow;
- }
- void Gpio::Write(GpioId pin, Gpio::LogicLevel value) {
- 80005ae: b570 push {r4, r5, r6, lr}
- 80005b0: 0004 movs r4, r0
- 80005b2: 000d movs r5, r1
- GPIO_TypeDef *port = GetPortRegister(pin);
- 80005b4: f7ff fea2 bl 80002fc <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)>
- uint8_t port_pin = pin & kPinMask;
- 80005b8: 220f movs r2, #15
- 80005ba: 4022 ands r2, r4
- uint32_t mask = 0b1 << port_pin;
- 80005bc: 2301 movs r3, #1
- 80005be: 4093 lsls r3, r2
- if (value == Gpio::LogicLevel::kLow) {
- 80005c0: 2d01 cmp r5, #1
- 80005c2: d003 beq.n 80005cc <mcu::stm32g070::Gpio::Write(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::LogicLevel)+0x1e>
- port->ODR &= ~mask;
- } else {
- port->ODR |= mask;
- 80005c4: 6942 ldr r2, [r0, #20]
- 80005c6: 4313 orrs r3, r2
- 80005c8: 6143 str r3, [r0, #20]
- }
- }
- 80005ca: bd70 pop {r4, r5, r6, pc}
- port->ODR &= ~mask;
- 80005cc: 6942 ldr r2, [r0, #20]
- 80005ce: 439a bics r2, r3
- 80005d0: 6142 str r2, [r0, #20]
- 80005d2: e7fa b.n 80005ca <mcu::stm32g070::Gpio::Write(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::LogicLevel)+0x1c>
- 080005d4 <mcu::stm32g070::Gpio::Toggle(mcu::stm32g070::Gpio::GpioId)>:
- Gpio::LogicLevel Gpio::Toggle(GpioId pin) {
- 80005d4: b510 push {r4, lr}
- 80005d6: 0004 movs r4, r0
- GPIO_TypeDef *port = GetPortRegister(pin);
- 80005d8: f7ff fe90 bl 80002fc <(anonymous namespace)::GetPortRegister(mcu::stm32g070::Gpio::GpioId)>
- uint8_t port_pin = pin & kPinMask;
- 80005dc: 220f movs r2, #15
- 80005de: 4022 ands r2, r4
- uint32_t mask = 0b1 << port_pin;
- 80005e0: 2301 movs r3, #1
- 80005e2: 4093 lsls r3, r2
- uint32_t current_output_value = port->ODR & mask;
- 80005e4: 6942 ldr r2, [r0, #20]
- if (current_output_value) {
- 80005e6: 4213 tst r3, r2
- 80005e8: d004 beq.n 80005f4 <mcu::stm32g070::Gpio::Toggle(mcu::stm32g070::Gpio::GpioId)+0x20>
- port->ODR &= ~mask;
- 80005ea: 6942 ldr r2, [r0, #20]
- 80005ec: 439a bics r2, r3
- 80005ee: 6142 str r2, [r0, #20]
- return Gpio::LogicLevel::kLow;
- 80005f0: 2001 movs r0, #1
- } else {
- port->ODR |= mask;
- return Gpio::LogicLevel::kHigh;
- }
- }
- 80005f2: bd10 pop {r4, pc}
- port->ODR |= mask;
- 80005f4: 6942 ldr r2, [r0, #20]
- 80005f6: 4313 orrs r3, r2
- 80005f8: 6143 str r3, [r0, #20]
- return Gpio::LogicLevel::kHigh;
- 80005fa: 2000 movs r0, #0
- 80005fc: e7f9 b.n 80005f2 <mcu::stm32g070::Gpio::Toggle(mcu::stm32g070::Gpio::GpioId)+0x1e>
- ...
- 08000600 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)>:
- void Gpio::ConfigureInterrupt(GpioId pin, InterruptEvent interrupt_mode,
- InterruptDelegate callback) {
- 8000600: b5f0 push {r4, r5, r6, r7, lr}
- 8000602: 46c6 mov lr, r8
- 8000604: b500 push {lr}
- 8000606: 0006 movs r6, r0
- 8000608: 000d movs r5, r1
- uint8_t port_pin = pin & kPinMask;
- 800060a: 240f movs r4, #15
- 800060c: 4004 ands r4, r0
- return stub_ptr != nullptr;
- 800060e: 4b2f ldr r3, [pc, #188] @ (80006cc <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xcc>)
- 8000610: 0061 lsls r1, r4, #1
- 8000612: 1909 adds r1, r1, r4
- 8000614: 0089 lsls r1, r1, #2
- 8000616: 185b adds r3, r3, r1
- 8000618: 689b ldr r3, [r3, #8]
- auto &gpio_irq_info = irq_callback_table[port_pin];
- assert(!gpio_irq_info.callback.IsValid());
- 800061a: 2b00 cmp r3, #0
- 800061c: d13c bne.n 8000698 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x98>
- gpio_irq_info.pin = pin;
- 800061e: 4b2b ldr r3, [pc, #172] @ (80006cc <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xcc>)
- 8000620: 0061 lsls r1, r4, #1
- 8000622: 1908 adds r0, r1, r4
- 8000624: 0080 lsls r0, r0, #2
- 8000626: 54c6 strb r6, [r0, r3]
- object_ptr = other.object_ptr;
- 8000628: 6817 ldr r7, [r2, #0]
- 800062a: 1908 adds r0, r1, r4
- 800062c: 0080 lsls r0, r0, #2
- 800062e: 1818 adds r0, r3, r0
- 8000630: 6047 str r7, [r0, #4]
- stub_ptr = other.stub_ptr;
- 8000632: 6852 ldr r2, [r2, #4]
- 8000634: 6082 str r2, [r0, #8]
- gpio_irq_info.callback = callback;
- RCC->APBENR2 |= RCC_APBENR2_SYSCFGEN;
- 8000636: 4a26 ldr r2, [pc, #152] @ (80006d0 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd0>)
- 8000638: 6c13 ldr r3, [r2, #64] @ 0x40
- 800063a: 2101 movs r1, #1
- 800063c: 430b orrs r3, r1
- 800063e: 6413 str r3, [r2, #64] @ 0x40
- auto port_id = GetPortIdFromPin(pin);
- 8000640: 0030 movs r0, r6
- 8000642: f7ff ff13 bl 800046c <(anonymous namespace)::GetPortIdFromPin(mcu::stm32g070::Gpio::GpioId)>
- 8000646: 4680 mov r8, r0
- auto quadrant = port_pin >> 2;
- 8000648: 08a3 lsrs r3, r4, #2
- auto quadrant_line = port_pin & 0x3;
- 800064a: 2203 movs r2, #3
- 800064c: 4032 ands r2, r6
- EXTI->EXTICR[quadrant] &= ~(0x2f << (quadrant_line << 3));
- 800064e: 4921 ldr r1, [pc, #132] @ (80006d4 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd4>)
- 8000650: 3318 adds r3, #24
- 8000652: 009b lsls r3, r3, #2
- 8000654: 585f ldr r7, [r3, r1]
- 8000656: 00d2 lsls r2, r2, #3
- 8000658: 202f movs r0, #47 @ 0x2f
- 800065a: 4090 lsls r0, r2
- 800065c: 4387 bics r7, r0
- 800065e: 505f str r7, [r3, r1]
- EXTI->EXTICR[quadrant] |= (port_id << (quadrant_line << 3));
- 8000660: 585f ldr r7, [r3, r1]
- 8000662: 4640 mov r0, r8
- 8000664: 4090 lsls r0, r2
- 8000666: 4307 orrs r7, r0
- 8000668: 505f str r7, [r3, r1]
- if (interrupt_mode == InterruptEvent::kRisingEdge ||
- 800066a: 2d00 cmp r5, #0
- 800066c: d001 beq.n 8000672 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x72>
- 800066e: 2d02 cmp r5, #2
- 8000670: d105 bne.n 800067e <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x7e>
- interrupt_mode == InterruptEvent::kBothEdges) {
- EXTI->RTSR1 |= (1 << port_pin);
- 8000672: 4918 ldr r1, [pc, #96] @ (80006d4 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd4>)
- 8000674: 680b ldr r3, [r1, #0]
- 8000676: 2201 movs r2, #1
- 8000678: 40a2 lsls r2, r4
- 800067a: 4313 orrs r3, r2
- 800067c: 600b str r3, [r1, #0]
- }
- if (interrupt_mode == InterruptEvent::kFallingEdge ||
- 800067e: 3d01 subs r5, #1
- 8000680: b2ed uxtb r5, r5
- 8000682: 2d01 cmp r5, #1
- 8000684: d90f bls.n 80006a6 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xa6>
- interrupt_mode == InterruptEvent::kBothEdges) {
- EXTI->FTSR1 |= (1 << port_pin);
- }
- if (port_pin < 2) {
- 8000686: 230e movs r3, #14
- 8000688: 4233 tst r3, r6
- 800068a: d113 bne.n 80006b4 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xb4>
- __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
- {
- if ((int32_t)(IRQn) >= 0)
- {
- __COMPILER_BARRIER();
- NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- 800068c: 4b12 ldr r3, [pc, #72] @ (80006d8 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd8>)
- 800068e: 2220 movs r2, #32
- 8000690: 601a str r2, [r3, #0]
- } else if (port_pin < 4) {
- NVIC_EnableIRQ(EXTI2_3_IRQn);
- } else {
- NVIC_EnableIRQ(EXTI4_15_IRQn);
- }
- }
- 8000692: bc80 pop {r7}
- 8000694: 46b8 mov r8, r7
- 8000696: bdf0 pop {r4, r5, r6, r7, pc}
- assert(!gpio_irq_info.callback.IsValid());
- 8000698: 4b10 ldr r3, [pc, #64] @ (80006dc <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xdc>)
- 800069a: 4a11 ldr r2, [pc, #68] @ (80006e0 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xe0>)
- 800069c: 218a movs r1, #138 @ 0x8a
- 800069e: 4811 ldr r0, [pc, #68] @ (80006e4 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xe4>)
- 80006a0: 0049 lsls r1, r1, #1
- 80006a2: f7ff fdd3 bl 800024c <__assert_func>
- EXTI->FTSR1 |= (1 << port_pin);
- 80006a6: 490b ldr r1, [pc, #44] @ (80006d4 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd4>)
- 80006a8: 684b ldr r3, [r1, #4]
- 80006aa: 2201 movs r2, #1
- 80006ac: 40a2 lsls r2, r4
- 80006ae: 4313 orrs r3, r2
- 80006b0: 604b str r3, [r1, #4]
- 80006b2: e7e8 b.n 8000686 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x86>
- } else if (port_pin < 4) {
- 80006b4: 230c movs r3, #12
- 80006b6: 4233 tst r3, r6
- 80006b8: d103 bne.n 80006c2 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xc2>
- 80006ba: 4b07 ldr r3, [pc, #28] @ (80006d8 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd8>)
- 80006bc: 2240 movs r2, #64 @ 0x40
- 80006be: 601a str r2, [r3, #0]
- __COMPILER_BARRIER();
- }
- }
- 80006c0: e7e7 b.n 8000692 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x92>
- NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
- 80006c2: 4b05 ldr r3, [pc, #20] @ (80006d8 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0xd8>)
- 80006c4: 2280 movs r2, #128 @ 0x80
- 80006c6: 601a str r2, [r3, #0]
- }
- 80006c8: e7e3 b.n 8000692 <mcu::stm32g070::Gpio::ConfigureInterrupt(mcu::stm32g070::Gpio::GpioId, mcu::hal::gpio::InterruptEvent, rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>)+0x92>
- 80006ca: 46c0 nop @ (mov r8, r8)
- 80006cc: 2000005c .word 0x2000005c
- 80006d0: 40021000 .word 0x40021000
- 80006d4: 40021800 .word 0x40021800
- 80006d8: e000e100 .word 0xe000e100
- 80006dc: 08000f34 .word 0x08000f34
- 80006e0: 08000f58 .word 0x08000f58
- 80006e4: 08000cd4 .word 0x08000cd4
- 080006e8 <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const>:
- ReturnType operator()(Args... args) const {
- 80006e8: b510 push {r4, lr}
- assert(stub_ptr != nullptr);
- 80006ea: 6843 ldr r3, [r0, #4]
- 80006ec: 2b00 cmp r3, #0
- 80006ee: d002 beq.n 80006f6 <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const+0xe>
- return (*stub_ptr)(object_ptr, std::forward<Args>(args)...);
- 80006f0: 6800 ldr r0, [r0, #0]
- 80006f2: 4798 blx r3
- }
- 80006f4: bd10 pop {r4, pc}
- assert(stub_ptr != nullptr);
- 80006f6: 4b03 ldr r3, [pc, #12] @ (8000704 <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const+0x1c>)
- 80006f8: 4a03 ldr r2, [pc, #12] @ (8000708 <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const+0x20>)
- 80006fa: 4804 ldr r0, [pc, #16] @ (800070c <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const+0x24>)
- 80006fc: 214a movs r1, #74 @ 0x4a
- 80006fe: f7ff fda5 bl 800024c <__assert_func>
- 8000702: 46c0 nop @ (mov r8, r8)
- 8000704: 08000fb8 .word 0x08000fb8
- 8000708: 08000fcc .word 0x08000fcc
- 800070c: 0800105c .word 0x0800105c
- 08000710 <(anonymous namespace)::CommonISRHandler(unsigned short)>:
- void CommonISRHandler([[maybe_unused]] uint16_t exti_set_mask) {
- 8000710: b570 push {r4, r5, r6, lr}
- 8000712: 0005 movs r5, r0
- while (exti_set_mask) {
- 8000714: e00b b.n 800072e <(anonymous namespace)::CommonISRHandler(unsigned short)+0x1e>
- EXTI->RPR1 &= (1 << index);
- 8000716: 4a14 ldr r2, [pc, #80] @ (8000768 <(anonymous namespace)::CommonISRHandler(unsigned short)+0x58>)
- 8000718: 68d1 ldr r1, [r2, #12]
- 800071a: 2301 movs r3, #1
- 800071c: 40a3 lsls r3, r4
- 800071e: 4019 ands r1, r3
- 8000720: 60d1 str r1, [r2, #12]
- EXTI->FPR1 &= (1 << index);
- 8000722: 6911 ldr r1, [r2, #16]
- 8000724: 4019 ands r1, r3
- 8000726: 6111 str r1, [r2, #16]
- exti_set_mask &= ~(1 << index);
- 8000728: 43db mvns r3, r3
- 800072a: b21b sxth r3, r3
- 800072c: 401d ands r5, r3
- while (exti_set_mask) {
- 800072e: 2d00 cmp r5, #0
- 8000730: d018 beq.n 8000764 <(anonymous namespace)::CommonISRHandler(unsigned short)+0x54>
- uint8_t index = __builtin_ctz(exti_set_mask) & 0xf;
- 8000732: 0028 movs r0, r5
- 8000734: f7ff fcc0 bl 80000b8 <__ctzsi2>
- 8000738: 240f movs r4, #15
- 800073a: 4004 ands r4, r0
- return stub_ptr != nullptr;
- 800073c: 4b0b ldr r3, [pc, #44] @ (800076c <(anonymous namespace)::CommonISRHandler(unsigned short)+0x5c>)
- 800073e: 0062 lsls r2, r4, #1
- 8000740: 1912 adds r2, r2, r4
- 8000742: 0092 lsls r2, r2, #2
- 8000744: 189b adds r3, r3, r2
- 8000746: 689b ldr r3, [r3, #8]
- if (gpio_irq_info.callback.IsValid()) {
- 8000748: 2b00 cmp r3, #0
- 800074a: d0e4 beq.n 8000716 <(anonymous namespace)::CommonISRHandler(unsigned short)+0x6>
- gpio_irq_info.callback(gpio_irq_info.pin);
- 800074c: 4a07 ldr r2, [pc, #28] @ (800076c <(anonymous namespace)::CommonISRHandler(unsigned short)+0x5c>)
- 800074e: 0060 lsls r0, r4, #1
- 8000750: 1901 adds r1, r0, r4
- 8000752: 0089 lsls r1, r1, #2
- 8000754: 5c89 ldrb r1, [r1, r2]
- 8000756: 1900 adds r0, r0, r4
- 8000758: 0080 lsls r0, r0, #2
- 800075a: 1880 adds r0, r0, r2
- 800075c: 3004 adds r0, #4
- 800075e: f7ff ffc3 bl 80006e8 <rtlib::Delegate<void (mcu::stm32g070::Gpio::GpioId)>::operator()(mcu::stm32g070::Gpio::GpioId) const>
- 8000762: e7d8 b.n 8000716 <(anonymous namespace)::CommonISRHandler(unsigned short)+0x6>
- }
- 8000764: bd70 pop {r4, r5, r6, pc}
- 8000766: 46c0 nop @ (mov r8, r8)
- 8000768: 40021800 .word 0x40021800
- 800076c: 2000005c .word 0x2000005c
- 08000770 <EXTI0_1_IRQHandler>:
- extern "C" void EXTI0_1_IRQHandler(void) {
- 8000770: b510 push {r4, lr}
- uint16_t mask = SYSCFG->IT_LINE_SR[5] & 0b11;
- 8000772: 4a04 ldr r2, [pc, #16] @ (8000784 <EXTI0_1_IRQHandler+0x14>)
- 8000774: 2394 movs r3, #148 @ 0x94
- 8000776: 58d0 ldr r0, [r2, r3]
- 8000778: 3b91 subs r3, #145 @ 0x91
- 800077a: 4018 ands r0, r3
- CommonISRHandler(mask);
- 800077c: f7ff ffc8 bl 8000710 <(anonymous namespace)::CommonISRHandler(unsigned short)>
- }
- 8000780: bd10 pop {r4, pc}
- 8000782: 46c0 nop @ (mov r8, r8)
- 8000784: 40010000 .word 0x40010000
- 08000788 <EXTI2_3_IRQHandler>:
- extern "C" void EXTI2_3_IRQHandler(void) {
- 8000788: b510 push {r4, lr}
- uint16_t mask = (SYSCFG->IT_LINE_SR[6] & 0b11) << 2;
- 800078a: 4a04 ldr r2, [pc, #16] @ (800079c <EXTI2_3_IRQHandler+0x14>)
- 800078c: 2398 movs r3, #152 @ 0x98
- 800078e: 58d0 ldr r0, [r2, r3]
- 8000790: 0080 lsls r0, r0, #2
- 8000792: 3b8c subs r3, #140 @ 0x8c
- 8000794: 4018 ands r0, r3
- CommonISRHandler(mask);
- 8000796: f7ff ffbb bl 8000710 <(anonymous namespace)::CommonISRHandler(unsigned short)>
- }
- 800079a: bd10 pop {r4, pc}
- 800079c: 40010000 .word 0x40010000
- 080007a0 <EXTI4_15_IRQHandler>:
- extern "C" void EXTI4_15_IRQHandler(void) {
- 80007a0: b510 push {r4, lr}
- uint16_t mask = (SYSCFG->IT_LINE_SR[7] & 0xfff) << 4;
- 80007a2: 4a04 ldr r2, [pc, #16] @ (80007b4 <EXTI4_15_IRQHandler+0x14>)
- 80007a4: 239c movs r3, #156 @ 0x9c
- 80007a6: 58d0 ldr r0, [r2, r3]
- 80007a8: b280 uxth r0, r0
- 80007aa: 0100 lsls r0, r0, #4
- 80007ac: b280 uxth r0, r0
- CommonISRHandler(mask);
- 80007ae: f7ff ffaf bl 8000710 <(anonymous namespace)::CommonISRHandler(unsigned short)>
- }
- 80007b2: bd10 pop {r4, pc}
- 80007b4: 40010000 .word 0x40010000
- 080007b8 <mcu::stm32g070::SysClock::Set64MHzSysClk()>:
- // APB prescaled by 4 for 16 MHz PCLK
- static void Set64MHzSysClk(void) {
- // NOTE: Assume POR conditions at this point: SYSCLK = HSI @ 16 MHz
- // Disable PLL
- RCC->CR &= (uint32_t)(~RCC_CR_PLLON);
- 80007b8: 4a21 ldr r2, [pc, #132] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 80007ba: 6813 ldr r3, [r2, #0]
- 80007bc: 4921 ldr r1, [pc, #132] @ (8000844 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x8c>)
- 80007be: 400b ands r3, r1
- 80007c0: 6013 str r3, [r2, #0]
- while ((RCC->CR & RCC_CR_PLLRDY) != 0);
- 80007c2: 4b1f ldr r3, [pc, #124] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 80007c4: 681b ldr r3, [r3, #0]
- 80007c6: 019b lsls r3, r3, #6
- 80007c8: d4fb bmi.n 80007c2 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0xa>
- // Set flash latency to 2 wait states
- FLASH->ACR &= (uint32_t)(~FLASH_ACR_LATENCY);
- 80007ca: 4b1f ldr r3, [pc, #124] @ (8000848 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x90>)
- 80007cc: 681a ldr r2, [r3, #0]
- 80007ce: 2107 movs r1, #7
- 80007d0: 438a bics r2, r1
- 80007d2: 601a str r2, [r3, #0]
- FLASH->ACR |= FLASH_ACR_LATENCY_1;
- 80007d4: 681a ldr r2, [r3, #0]
- 80007d6: 3905 subs r1, #5
- 80007d8: 430a orrs r2, r1
- 80007da: 601a str r2, [r3, #0]
- while ((FLASH->ACR & FLASH_ACR_LATENCY) != FLASH_ACR_LATENCY_1);
- 80007dc: 4b1a ldr r3, [pc, #104] @ (8000848 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x90>)
- 80007de: 681a ldr r2, [r3, #0]
- 80007e0: 2307 movs r3, #7
- 80007e2: 4013 ands r3, r2
- 80007e4: 2b02 cmp r3, #2
- 80007e6: d1f9 bne.n 80007dc <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x24>
- // Enable instruction prefech & cache
- FLASH->ACR |= FLASH_ACR_PRFTEN;
- 80007e8: 4b17 ldr r3, [pc, #92] @ (8000848 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x90>)
- 80007ea: 6819 ldr r1, [r3, #0]
- 80007ec: 2280 movs r2, #128 @ 0x80
- 80007ee: 0052 lsls r2, r2, #1
- 80007f0: 430a orrs r2, r1
- 80007f2: 601a str r2, [r3, #0]
- FLASH->ACR |= FLASH_ACR_ICEN;
- 80007f4: 6819 ldr r1, [r3, #0]
- 80007f6: 2280 movs r2, #128 @ 0x80
- 80007f8: 0092 lsls r2, r2, #2
- 80007fa: 430a orrs r2, r1
- 80007fc: 601a str r2, [r3, #0]
- // fVCO = HSI * (N/M) = 16 MHz * 16 = 256 MHz
- // fPLLR = fVCO / 4 = 64 MHz
- RCC->PLLCFGR = (0b011 << RCC_PLLCFGR_PLLR_Pos) | RCC_PLLCFGR_PLLREN |
- 80007fe: 4b10 ldr r3, [pc, #64] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 8000800: 4a12 ldr r2, [pc, #72] @ (800084c <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x94>)
- 8000802: 60da str r2, [r3, #12]
- (0b100000 << RCC_PLLCFGR_PLLN_Pos) |
- (0b001 << RCC_PLLCFGR_PLLM_Pos) | RCC_PLLCFGR_PLLSRC_1;
- // Set APB prescalar to /4 for PCLK = 16 Mhz
- RCC->CFGR &= ~(RCC_CFGR_PPRE);
- 8000804: 689a ldr r2, [r3, #8]
- 8000806: 4912 ldr r1, [pc, #72] @ (8000850 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x98>)
- 8000808: 400a ands r2, r1
- 800080a: 609a str r2, [r3, #8]
- RCC->CFGR |= (0b101 << RCC_CFGR_PPRE_Pos);
- 800080c: 6899 ldr r1, [r3, #8]
- 800080e: 22a0 movs r2, #160 @ 0xa0
- 8000810: 01d2 lsls r2, r2, #7
- 8000812: 430a orrs r2, r1
- 8000814: 609a str r2, [r3, #8]
- // Enable PLL
- RCC->CR |= RCC_CR_PLLON;
- 8000816: 6819 ldr r1, [r3, #0]
- 8000818: 2280 movs r2, #128 @ 0x80
- 800081a: 0452 lsls r2, r2, #17
- 800081c: 430a orrs r2, r1
- 800081e: 601a str r2, [r3, #0]
- while ((RCC->CR & RCC_CR_PLLRDY) == 0);
- 8000820: 4b07 ldr r3, [pc, #28] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 8000822: 681b ldr r3, [r3, #0]
- 8000824: 019b lsls r3, r3, #6
- 8000826: d5fb bpl.n 8000820 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x68>
- // Use PLLRCLK as clock source for SYSCLK
- RCC->CFGR |= (uint32_t)(RCC_CFGR_SW_1);
- 8000828: 4a05 ldr r2, [pc, #20] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 800082a: 6893 ldr r3, [r2, #8]
- 800082c: 2102 movs r1, #2
- 800082e: 430b orrs r3, r1
- 8000830: 6093 str r3, [r2, #8]
- while ((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_1);
- 8000832: 4b03 ldr r3, [pc, #12] @ (8000840 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x88>)
- 8000834: 689a ldr r2, [r3, #8]
- 8000836: 2338 movs r3, #56 @ 0x38
- 8000838: 4013 ands r3, r2
- 800083a: 2b10 cmp r3, #16
- 800083c: d1f9 bne.n 8000832 <mcu::stm32g070::SysClock::Set64MHzSysClk()+0x7a>
- }
- 800083e: 4770 bx lr
- 8000840: 40021000 .word 0x40021000
- 8000844: feffffff .word 0xfeffffff
- 8000848: 40022000 .word 0x40022000
- 800084c: 70002012 .word 0x70002012
- 8000850: ffff8fff .word 0xffff8fff
- 08000854 <mcu::stm32g070::SysClock::Init()>:
- void Init() {
- 8000854: b510 push {r4, lr}
- Set64MHzSysClk();
- 8000856: f7ff ffaf bl 80007b8 <mcu::stm32g070::SysClock::Set64MHzSysClk()>
- }
- 800085a: bd10 pop {r4, pc}
- 0800085c <(anonymous namespace)::GetUartController(mcu::stm32g070::Uart::UartId)>:
- namespace {
- USART_TypeDef *GetUartController(mcu::stm32g070::Uart::UartId id) {
- static constexpr USART_TypeDef *table[mcu::stm32g070::Uart::kNumUartId] = {
- USART1, USART2, USART3, USART4};
- return table[id];
- 800085c: 4b01 ldr r3, [pc, #4] @ (8000864 <(anonymous namespace)::GetUartController(mcu::stm32g070::Uart::UartId)+0x8>)
- 800085e: 0080 lsls r0, r0, #2
- 8000860: 58c0 ldr r0, [r0, r3]
- }
- 8000862: 4770 bx lr
- 8000864: 0800113c .word 0x0800113c
- 08000868 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)>:
- void EnableUartClock(mcu::stm32g070::Uart::UartId id) {
- if (id == mcu::stm32g070::Uart::kUart1) {
- 8000868: 2800 cmp r0, #0
- 800086a: d106 bne.n 800087a <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x12>
- RCC->APBENR2 |= RCC_APBENR2_USART1EN;
- 800086c: 4a10 ldr r2, [pc, #64] @ (80008b0 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x48>)
- 800086e: 6c11 ldr r1, [r2, #64] @ 0x40
- 8000870: 2380 movs r3, #128 @ 0x80
- 8000872: 01db lsls r3, r3, #7
- 8000874: 430b orrs r3, r1
- 8000876: 6413 str r3, [r2, #64] @ 0x40
- } else if (id == mcu::stm32g070::Uart::kUart3) {
- RCC->APBENR1 |= RCC_APBENR1_USART3EN;
- } else if (id == mcu::stm32g070::Uart::kUart4) {
- RCC->APBENR1 |= RCC_APBENR1_USART4EN;
- }
- }
- 8000878: 4770 bx lr
- } else if (id == mcu::stm32g070::Uart::kUart2) {
- 800087a: 2801 cmp r0, #1
- 800087c: d00a beq.n 8000894 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x2c>
- } else if (id == mcu::stm32g070::Uart::kUart3) {
- 800087e: 2802 cmp r0, #2
- 8000880: d00f beq.n 80008a2 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x3a>
- } else if (id == mcu::stm32g070::Uart::kUart4) {
- 8000882: 2803 cmp r0, #3
- 8000884: d1f8 bne.n 8000878 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x10>
- RCC->APBENR1 |= RCC_APBENR1_USART4EN;
- 8000886: 4a0a ldr r2, [pc, #40] @ (80008b0 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x48>)
- 8000888: 6bd1 ldr r1, [r2, #60] @ 0x3c
- 800088a: 2380 movs r3, #128 @ 0x80
- 800088c: 031b lsls r3, r3, #12
- 800088e: 430b orrs r3, r1
- 8000890: 63d3 str r3, [r2, #60] @ 0x3c
- }
- 8000892: e7f1 b.n 8000878 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x10>
- RCC->APBENR1 |= RCC_APBENR1_USART2EN;
- 8000894: 4a06 ldr r2, [pc, #24] @ (80008b0 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x48>)
- 8000896: 6bd1 ldr r1, [r2, #60] @ 0x3c
- 8000898: 2380 movs r3, #128 @ 0x80
- 800089a: 029b lsls r3, r3, #10
- 800089c: 430b orrs r3, r1
- 800089e: 63d3 str r3, [r2, #60] @ 0x3c
- 80008a0: e7ea b.n 8000878 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x10>
- RCC->APBENR1 |= RCC_APBENR1_USART3EN;
- 80008a2: 4a03 ldr r2, [pc, #12] @ (80008b0 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x48>)
- 80008a4: 6bd1 ldr r1, [r2, #60] @ 0x3c
- 80008a6: 2380 movs r3, #128 @ 0x80
- 80008a8: 02db lsls r3, r3, #11
- 80008aa: 430b orrs r3, r1
- 80008ac: 63d3 str r3, [r2, #60] @ 0x3c
- 80008ae: e7e3 b.n 8000878 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)+0x10>
- 80008b0: 40021000 .word 0x40021000
- 080008b4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)>:
- void DisableUartClock(mcu::stm32g070::Uart::UartId id) {
- if (id == mcu::stm32g070::Uart::kUart1) {
- 80008b4: 2800 cmp r0, #0
- 80008b6: d105 bne.n 80008c4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x10>
- RCC->APBENR2 &= ~RCC_APBENR2_USART1EN;
- 80008b8: 4a0e ldr r2, [pc, #56] @ (80008f4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x40>)
- 80008ba: 6c13 ldr r3, [r2, #64] @ 0x40
- 80008bc: 490e ldr r1, [pc, #56] @ (80008f8 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x44>)
- 80008be: 400b ands r3, r1
- 80008c0: 6413 str r3, [r2, #64] @ 0x40
- } else if (id == mcu::stm32g070::Uart::kUart3) {
- RCC->APBENR1 &= ~RCC_APBENR1_USART3EN;
- } else if (id == mcu::stm32g070::Uart::kUart4) {
- RCC->APBENR1 &= ~RCC_APBENR1_USART4EN;
- }
- }
- 80008c2: 4770 bx lr
- } else if (id == mcu::stm32g070::Uart::kUart2) {
- 80008c4: 2801 cmp r0, #1
- 80008c6: d009 beq.n 80008dc <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x28>
- } else if (id == mcu::stm32g070::Uart::kUart3) {
- 80008c8: 2802 cmp r0, #2
- 80008ca: d00d beq.n 80008e8 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x34>
- } else if (id == mcu::stm32g070::Uart::kUart4) {
- 80008cc: 2803 cmp r0, #3
- 80008ce: d1f8 bne.n 80008c2 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0xe>
- RCC->APBENR1 &= ~RCC_APBENR1_USART4EN;
- 80008d0: 4a08 ldr r2, [pc, #32] @ (80008f4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x40>)
- 80008d2: 6bd3 ldr r3, [r2, #60] @ 0x3c
- 80008d4: 4909 ldr r1, [pc, #36] @ (80008fc <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x48>)
- 80008d6: 400b ands r3, r1
- 80008d8: 63d3 str r3, [r2, #60] @ 0x3c
- }
- 80008da: e7f2 b.n 80008c2 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0xe>
- RCC->APBENR1 &= ~RCC_APBENR1_USART2EN;
- 80008dc: 4a05 ldr r2, [pc, #20] @ (80008f4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x40>)
- 80008de: 6bd3 ldr r3, [r2, #60] @ 0x3c
- 80008e0: 4907 ldr r1, [pc, #28] @ (8000900 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x4c>)
- 80008e2: 400b ands r3, r1
- 80008e4: 63d3 str r3, [r2, #60] @ 0x3c
- 80008e6: e7ec b.n 80008c2 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0xe>
- RCC->APBENR1 &= ~RCC_APBENR1_USART3EN;
- 80008e8: 4a02 ldr r2, [pc, #8] @ (80008f4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x40>)
- 80008ea: 6bd3 ldr r3, [r2, #60] @ 0x3c
- 80008ec: 4905 ldr r1, [pc, #20] @ (8000904 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0x50>)
- 80008ee: 400b ands r3, r1
- 80008f0: 63d3 str r3, [r2, #60] @ 0x3c
- 80008f2: e7e6 b.n 80008c2 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)+0xe>
- 80008f4: 40021000 .word 0x40021000
- 80008f8: ffffbfff .word 0xffffbfff
- 80008fc: fff7ffff .word 0xfff7ffff
- 8000900: fffdffff .word 0xfffdffff
- 8000904: fffbffff .word 0xfffbffff
- 08000908 <mcu::stm32g070::Uart::Uart(mcu::stm32g070::Uart::UartConfig const&)>:
- } // namespace
- namespace mcu::stm32g070 {
- Uart::Uart(UartConfig const &config) : config_{config}, tx_busy_{false} {
- 8000908: 6001 str r1, [r0, #0]
- 800090a: 2300 movs r3, #0
- 800090c: 7103 strb r3, [r0, #4]
- Delegate() = default;
- 800090e: 6083 str r3, [r0, #8]
- 8000910: 60c3 str r3, [r0, #12]
- 8000912: 6103 str r3, [r0, #16]
- 8000914: 6143 str r3, [r0, #20]
- }
- 8000916: 4770 bx lr
- 08000918 <mcu::stm32g070::Uart::Init()>:
- void Uart::Init() {
- 8000918: b570 push {r4, r5, r6, lr}
- 800091a: 0004 movs r4, r0
- auto *uart_ctrl = GetUartController(config_.uart_id);
- 800091c: 6803 ldr r3, [r0, #0]
- 800091e: 781e ldrb r6, [r3, #0]
- 8000920: 0030 movs r0, r6
- 8000922: f7ff ff9b bl 800085c <(anonymous namespace)::GetUartController(mcu::stm32g070::Uart::UartId)>
- 8000926: 0005 movs r5, r0
- EnableUartClock(config_.uart_id);
- 8000928: 0030 movs r0, r6
- 800092a: f7ff ff9d bl 8000868 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)>
- uart_ctrl->CR1 &= ~USART_CR1_UE;
- 800092e: 682b ldr r3, [r5, #0]
- 8000930: 2201 movs r2, #1
- 8000932: 4393 bics r3, r2
- 8000934: 602b str r3, [r5, #0]
- assert(config_.baud_rate == mcu::hal::uart::k115200);
- 8000936: 6823 ldr r3, [r4, #0]
- 8000938: 685a ldr r2, [r3, #4]
- 800093a: 23e1 movs r3, #225 @ 0xe1
- 800093c: 025b lsls r3, r3, #9
- 800093e: 429a cmp r2, r3
- 8000940: d106 bne.n 8000950 <mcu::stm32g070::Uart::Init()+0x38>
- uart_ctrl->BRR = 138; // For PCLK = 16 MHz
- 8000942: 238a movs r3, #138 @ 0x8a
- 8000944: 60eb str r3, [r5, #12]
- DisableUartClock(config_.uart_id);
- 8000946: 6823 ldr r3, [r4, #0]
- 8000948: 7818 ldrb r0, [r3, #0]
- 800094a: f7ff ffb3 bl 80008b4 <(anonymous namespace)::DisableUartClock(mcu::stm32g070::Uart::UartId)>
- }
- 800094e: bd70 pop {r4, r5, r6, pc}
- assert(config_.baud_rate == mcu::hal::uart::k115200);
- 8000950: 4b02 ldr r3, [pc, #8] @ (800095c <mcu::stm32g070::Uart::Init()+0x44>)
- 8000952: 4a03 ldr r2, [pc, #12] @ (8000960 <mcu::stm32g070::Uart::Init()+0x48>)
- 8000954: 4803 ldr r0, [pc, #12] @ (8000964 <mcu::stm32g070::Uart::Init()+0x4c>)
- 8000956: 212d movs r1, #45 @ 0x2d
- 8000958: f7ff fc78 bl 800024c <__assert_func>
- 800095c: 08001084 .word 0x08001084
- 8000960: 080010b4 .word 0x080010b4
- 8000964: 080010d8 .word 0x080010d8
- 08000968 <mcu::stm32g070::Uart::Enable()>:
- void Uart::Enable() {
- 8000968: b510 push {r4, lr}
- 800096a: 0004 movs r4, r0
- EnableUartClock(config_.uart_id);
- 800096c: 6803 ldr r3, [r0, #0]
- 800096e: 7818 ldrb r0, [r3, #0]
- 8000970: f7ff ff7a bl 8000868 <(anonymous namespace)::EnableUartClock(mcu::stm32g070::Uart::UartId)>
- auto *uart_ctrl = GetUartController(config_.uart_id);
- 8000974: 6823 ldr r3, [r4, #0]
- 8000976: 7818 ldrb r0, [r3, #0]
- 8000978: f7ff ff70 bl 800085c <(anonymous namespace)::GetUartController(mcu::stm32g070::Uart::UartId)>
- uart_ctrl->CR1 |= USART_CR1_UE | USART_CR1_TE;
- 800097c: 6803 ldr r3, [r0, #0]
- 800097e: 2209 movs r2, #9
- 8000980: 4313 orrs r3, r2
- 8000982: 6003 str r3, [r0, #0]
- }
- 8000984: bd10 pop {r4, pc}
- 08000986 <mcu::stm32g070::Uart::Transmit(unsigned char const*, unsigned int)>:
- auto *uart_ctrl = GetUartController(config_.uart_id);
- uart_ctrl->CR1 &= ~(USART_CR1_UE | USART_CR1_TE);
- DisableUartClock(config_.uart_id);
- }
- void Uart::Transmit(const uint8_t *data, size_t len) {
- 8000986: b570 push {r4, r5, r6, lr}
- 8000988: 000d movs r5, r1
- 800098a: 0014 movs r4, r2
- auto *uart_ctrl = GetUartController(config_.uart_id);
- 800098c: 6803 ldr r3, [r0, #0]
- 800098e: 7818 ldrb r0, [r3, #0]
- 8000990: f7ff ff64 bl 800085c <(anonymous namespace)::GetUartController(mcu::stm32g070::Uart::UartId)>
- while (len--) {
- 8000994: e006 b.n 80009a4 <mcu::stm32g070::Uart::Transmit(unsigned char const*, unsigned int)+0x1e>
- while ((uart_ctrl->ISR & USART_ISR_TXE_TXFNF) == 0);
- 8000996: 69c3 ldr r3, [r0, #28]
- 8000998: 061b lsls r3, r3, #24
- 800099a: d5fc bpl.n 8000996 <mcu::stm32g070::Uart::Transmit(unsigned char const*, unsigned int)+0x10>
- uart_ctrl->TDR = *data++;
- 800099c: 782b ldrb r3, [r5, #0]
- 800099e: 6283 str r3, [r0, #40] @ 0x28
- while (len--) {
- 80009a0: 0014 movs r4, r2
- uart_ctrl->TDR = *data++;
- 80009a2: 3501 adds r5, #1
- while (len--) {
- 80009a4: 1e62 subs r2, r4, #1
- 80009a6: 2c00 cmp r4, #0
- 80009a8: d1f5 bne.n 8000996 <mcu::stm32g070::Uart::Transmit(unsigned char const*, unsigned int)+0x10>
- }
- }
- 80009aa: bd70 pop {r4, r5, r6, pc}
- 080009ac <Reset_Handler>:
- .section .text.Reset_Handler
- .weak Reset_Handler
- .type Reset_Handler, %function
- Reset_Handler:
- ldr r0, =_estack
- 80009ac: 480d ldr r0, [pc, #52] @ (80009e4 <LoopForever+0x2>)
- mov sp, r0 /* set stack pointer */
- 80009ae: 4685 mov sp, r0
- /* Call the clock system initialization function.*/
- bl SystemInit
- 80009b0: f000 f825 bl 80009fe <SystemInit>
- /* Copy the data segment initializers from flash to SRAM */
- ldr r0, =_sdata
- 80009b4: 480c ldr r0, [pc, #48] @ (80009e8 <LoopForever+0x6>)
- ldr r1, =_edata
- 80009b6: 490d ldr r1, [pc, #52] @ (80009ec <LoopForever+0xa>)
- ldr r2, =_sidata
- 80009b8: 4a0d ldr r2, [pc, #52] @ (80009f0 <LoopForever+0xe>)
- movs r3, #0
- 80009ba: 2300 movs r3, #0
- b LoopCopyDataInit
- 80009bc: e002 b.n 80009c4 <LoopCopyDataInit>
- 080009be <CopyDataInit>:
- CopyDataInit:
- ldr r4, [r2, r3]
- 80009be: 58d4 ldr r4, [r2, r3]
- str r4, [r0, r3]
- 80009c0: 50c4 str r4, [r0, r3]
- adds r3, r3, #4
- 80009c2: 3304 adds r3, #4
- 080009c4 <LoopCopyDataInit>:
- LoopCopyDataInit:
- adds r4, r0, r3
- 80009c4: 18c4 adds r4, r0, r3
- cmp r4, r1
- 80009c6: 428c cmp r4, r1
- bcc CopyDataInit
- 80009c8: d3f9 bcc.n 80009be <CopyDataInit>
- /* Zero fill the bss segment. */
- ldr r2, =_sbss
- 80009ca: 4a0a ldr r2, [pc, #40] @ (80009f4 <LoopForever+0x12>)
- ldr r4, =_ebss
- 80009cc: 4c0a ldr r4, [pc, #40] @ (80009f8 <LoopForever+0x16>)
- movs r3, #0
- 80009ce: 2300 movs r3, #0
- b LoopFillZerobss
- 80009d0: e001 b.n 80009d6 <LoopFillZerobss>
- 080009d2 <FillZerobss>:
- FillZerobss:
- str r3, [r2]
- 80009d2: 6013 str r3, [r2, #0]
- adds r2, r2, #4
- 80009d4: 3204 adds r2, #4
- 080009d6 <LoopFillZerobss>:
- LoopFillZerobss:
- cmp r2, r4
- 80009d6: 42a2 cmp r2, r4
- bcc FillZerobss
- 80009d8: d3fb bcc.n 80009d2 <FillZerobss>
- /* Call static constructors */
- bl __libc_init_array
- 80009da: f000 f811 bl 8000a00 <__libc_init_array>
- /* Call the application s entry point.*/
- bl main
- 80009de: f7ff fbf1 bl 80001c4 <main>
- 080009e2 <LoopForever>:
- LoopForever:
- b LoopForever
- 80009e2: e7fe b.n 80009e2 <LoopForever>
- ldr r0, =_estack
- 80009e4: 20009000 .word 0x20009000
- ldr r0, =_sdata
- 80009e8: 20000000 .word 0x20000000
- ldr r1, =_edata
- 80009ec: 20000004 .word 0x20000004
- ldr r2, =_sidata
- 80009f0: 08001158 .word 0x08001158
- ldr r2, =_sbss
- 80009f4: 20000004 .word 0x20000004
- ldr r4, =_ebss
- 80009f8: 200002b4 .word 0x200002b4
- 080009fc <ADC1_IRQHandler>:
- * @retval None
- */
- .section .text.Default_Handler,"ax",%progbits
- Default_Handler:
- Infinite_Loop:
- b Infinite_Loop
- 80009fc: e7fe b.n 80009fc <ADC1_IRQHandler>
- 080009fe <SystemInit>:
- {
- /* Configure the Vector Table location -------------------------------------*/
- #if defined(USER_VECT_TAB_ADDRESS)
- SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation */
- #endif /* USER_VECT_TAB_ADDRESS */
- }
- 80009fe: 4770 bx lr
- 08000a00 <__libc_init_array>:
- 8000a00: b570 push {r4, r5, r6, lr}
- 8000a02: 4b0d ldr r3, [pc, #52] @ (8000a38 <__libc_init_array+0x38>)
- 8000a04: 4d0d ldr r5, [pc, #52] @ (8000a3c <__libc_init_array+0x3c>)
- 8000a06: 1b5e subs r6, r3, r5
- 8000a08: 10b6 asrs r6, r6, #2
- 8000a0a: 42ab cmp r3, r5
- 8000a0c: d005 beq.n 8000a1a <__libc_init_array+0x1a>
- 8000a0e: 2400 movs r4, #0
- 8000a10: cd08 ldmia r5!, {r3}
- 8000a12: 3401 adds r4, #1
- 8000a14: 4798 blx r3
- 8000a16: 42a6 cmp r6, r4
- 8000a18: d8fa bhi.n 8000a10 <__libc_init_array+0x10>
- 8000a1a: f000 f895 bl 8000b48 <_init>
- 8000a1e: 4b08 ldr r3, [pc, #32] @ (8000a40 <__libc_init_array+0x40>)
- 8000a20: 4d08 ldr r5, [pc, #32] @ (8000a44 <__libc_init_array+0x44>)
- 8000a22: 1b5e subs r6, r3, r5
- 8000a24: 10b6 asrs r6, r6, #2
- 8000a26: 42ab cmp r3, r5
- 8000a28: d005 beq.n 8000a36 <__libc_init_array+0x36>
- 8000a2a: 2400 movs r4, #0
- 8000a2c: cd08 ldmia r5!, {r3}
- 8000a2e: 3401 adds r4, #1
- 8000a30: 4798 blx r3
- 8000a32: 42a6 cmp r6, r4
- 8000a34: d8fa bhi.n 8000a2c <__libc_init_array+0x2c>
- 8000a36: bd70 pop {r4, r5, r6, pc}
- 8000a38: 0800114c .word 0x0800114c
- 8000a3c: 0800114c .word 0x0800114c
- 8000a40: 08001154 .word 0x08001154
- 8000a44: 0800114c .word 0x0800114c
- 08000a48 <__retarget_lock_acquire_recursive>:
- 8000a48: 4770 bx lr
- 8000a4a: 46c0 nop @ (mov r8, r8)
- 08000a4c <__retarget_lock_release_recursive>:
- 8000a4c: 4770 bx lr
- 8000a4e: 46c0 nop @ (mov r8, r8)
- 08000a50 <register_fini>:
- 8000a50: 4b03 ldr r3, [pc, #12] @ (8000a60 <register_fini+0x10>)
- 8000a52: b510 push {r4, lr}
- 8000a54: 2b00 cmp r3, #0
- 8000a56: d002 beq.n 8000a5e <register_fini+0xe>
- 8000a58: 4802 ldr r0, [pc, #8] @ (8000a64 <register_fini+0x14>)
- 8000a5a: f000 f805 bl 8000a68 <atexit>
- 8000a5e: bd10 pop {r4, pc}
- 8000a60: 00000000 .word 0x00000000
- 8000a64: 08000a79 .word 0x08000a79
- 08000a68 <atexit>:
- 8000a68: b510 push {r4, lr}
- 8000a6a: 0001 movs r1, r0
- 8000a6c: 2300 movs r3, #0
- 8000a6e: 2200 movs r2, #0
- 8000a70: 2000 movs r0, #0
- 8000a72: f000 f815 bl 8000aa0 <__register_exitproc>
- 8000a76: bd10 pop {r4, pc}
- 08000a78 <__libc_fini_array>:
- 8000a78: b570 push {r4, r5, r6, lr}
- 8000a7a: 4c07 ldr r4, [pc, #28] @ (8000a98 <__libc_fini_array+0x20>)
- 8000a7c: 4d07 ldr r5, [pc, #28] @ (8000a9c <__libc_fini_array+0x24>)
- 8000a7e: 1b64 subs r4, r4, r5
- 8000a80: 10a4 asrs r4, r4, #2
- 8000a82: d005 beq.n 8000a90 <__libc_fini_array+0x18>
- 8000a84: 3c01 subs r4, #1
- 8000a86: 00a3 lsls r3, r4, #2
- 8000a88: 58eb ldr r3, [r5, r3]
- 8000a8a: 4798 blx r3
- 8000a8c: 2c00 cmp r4, #0
- 8000a8e: d1f9 bne.n 8000a84 <__libc_fini_array+0xc>
- 8000a90: f000 f860 bl 8000b54 <_fini>
- 8000a94: bd70 pop {r4, r5, r6, pc}
- 8000a96: 46c0 nop @ (mov r8, r8)
- 8000a98: 08001158 .word 0x08001158
- 8000a9c: 08001154 .word 0x08001154
- 08000aa0 <__register_exitproc>:
- 8000aa0: b5f0 push {r4, r5, r6, r7, lr}
- 8000aa2: 46d6 mov lr, sl
- 8000aa4: 464f mov r7, r9
- 8000aa6: 4646 mov r6, r8
- 8000aa8: 4698 mov r8, r3
- 8000aaa: 4b24 ldr r3, [pc, #144] @ (8000b3c <__register_exitproc+0x9c>)
- 8000aac: b5c0 push {r6, r7, lr}
- 8000aae: 0006 movs r6, r0
- 8000ab0: 6818 ldr r0, [r3, #0]
- 8000ab2: 469a mov sl, r3
- 8000ab4: 000f movs r7, r1
- 8000ab6: 4691 mov r9, r2
- 8000ab8: f7ff ffc6 bl 8000a48 <__retarget_lock_acquire_recursive>
- 8000abc: 4b20 ldr r3, [pc, #128] @ (8000b40 <__register_exitproc+0xa0>)
- 8000abe: 681d ldr r5, [r3, #0]
- 8000ac0: 2d00 cmp r5, #0
- 8000ac2: d032 beq.n 8000b2a <__register_exitproc+0x8a>
- 8000ac4: 4653 mov r3, sl
- 8000ac6: 686c ldr r4, [r5, #4]
- 8000ac8: 6818 ldr r0, [r3, #0]
- 8000aca: 2c1f cmp r4, #31
- 8000acc: dc30 bgt.n 8000b30 <__register_exitproc+0x90>
- 8000ace: 2e00 cmp r6, #0
- 8000ad0: d10c bne.n 8000aec <__register_exitproc+0x4c>
- 8000ad2: 1c63 adds r3, r4, #1
- 8000ad4: 3402 adds r4, #2
- 8000ad6: 00a4 lsls r4, r4, #2
- 8000ad8: 606b str r3, [r5, #4]
- 8000ada: 5167 str r7, [r4, r5]
- 8000adc: f7ff ffb6 bl 8000a4c <__retarget_lock_release_recursive>
- 8000ae0: 2000 movs r0, #0
- 8000ae2: bce0 pop {r5, r6, r7}
- 8000ae4: 46ba mov sl, r7
- 8000ae6: 46b1 mov r9, r6
- 8000ae8: 46a8 mov r8, r5
- 8000aea: bdf0 pop {r4, r5, r6, r7, pc}
- 8000aec: 4649 mov r1, r9
- 8000aee: 2288 movs r2, #136 @ 0x88
- 8000af0: 00a3 lsls r3, r4, #2
- 8000af2: 18eb adds r3, r5, r3
- 8000af4: 5099 str r1, [r3, r2]
- 8000af6: 21c4 movs r1, #196 @ 0xc4
- 8000af8: 0049 lsls r1, r1, #1
- 8000afa: 468c mov ip, r1
- 8000afc: 44ac add ip, r5
- 8000afe: 4661 mov r1, ip
- 8000b00: 3a87 subs r2, #135 @ 0x87
- 8000b02: 40a2 lsls r2, r4
- 8000b04: 6809 ldr r1, [r1, #0]
- 8000b06: 4691 mov r9, r2
- 8000b08: 4311 orrs r1, r2
- 8000b0a: 4662 mov r2, ip
- 8000b0c: 6011 str r1, [r2, #0]
- 8000b0e: 2184 movs r1, #132 @ 0x84
- 8000b10: 4642 mov r2, r8
- 8000b12: 0049 lsls r1, r1, #1
- 8000b14: 505a str r2, [r3, r1]
- 8000b16: 2e02 cmp r6, #2
- 8000b18: d1db bne.n 8000ad2 <__register_exitproc+0x32>
- 8000b1a: 0029 movs r1, r5
- 8000b1c: 464a mov r2, r9
- 8000b1e: 318d adds r1, #141 @ 0x8d
- 8000b20: 31ff adds r1, #255 @ 0xff
- 8000b22: 680b ldr r3, [r1, #0]
- 8000b24: 4313 orrs r3, r2
- 8000b26: 600b str r3, [r1, #0]
- 8000b28: e7d3 b.n 8000ad2 <__register_exitproc+0x32>
- 8000b2a: 4d06 ldr r5, [pc, #24] @ (8000b44 <__register_exitproc+0xa4>)
- 8000b2c: 601d str r5, [r3, #0]
- 8000b2e: e7c9 b.n 8000ac4 <__register_exitproc+0x24>
- 8000b30: f7ff ff8c bl 8000a4c <__retarget_lock_release_recursive>
- 8000b34: 2001 movs r0, #1
- 8000b36: 4240 negs r0, r0
- 8000b38: e7d3 b.n 8000ae2 <__register_exitproc+0x42>
- 8000b3a: 46c0 nop @ (mov r8, r8)
- 8000b3c: 20000000 .word 0x20000000
- 8000b40: 20000120 .word 0x20000120
- 8000b44: 20000124 .word 0x20000124
- 08000b48 <_init>:
- 8000b48: b5f8 push {r3, r4, r5, r6, r7, lr}
- 8000b4a: 46c0 nop @ (mov r8, r8)
- 8000b4c: bcf8 pop {r3, r4, r5, r6, r7}
- 8000b4e: bc08 pop {r3}
- 8000b50: 469e mov lr, r3
- 8000b52: 4770 bx lr
- 08000b54 <_fini>:
- 8000b54: b5f8 push {r3, r4, r5, r6, r7, lr}
- 8000b56: 46c0 nop @ (mov r8, r8)
- 8000b58: bcf8 pop {r3, r4, r5, r6, r7}
- 8000b5a: bc08 pop {r3}
- 8000b5c: 469e mov lr, r3
- 8000b5e: 4770 bx lr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement